MaplePrimes Questions

I have a problem that seems rather simple in theory, yet if implemented in maple there arise problems. I want to solve systems of linear equations that involve roots of unity.

This problem arises when trying to find explicit equations of multivariate polynomials of fixed degree through given points (together with conditions on the derivatives of the curve at these points). In the following case, the points are dented by P[i] and I'm looking for the explicit equation of the degree 9 polynomial through these points. Actually, I know there is a two parameter family of such polynomials, so the solution will be of dimension two.

Sorry for the rather crude implementation.

with(Groebner): with(algcurves): with(LinearAlgebra):

t := exp((1/9)*(2*Pi*I)):
s := exp((1/3)*(2*Pi*I)):
a_1 := -1*t:
a_2 := -s*t:
a_3 := -s^2*t:
P[1] := a_1, 0, 1: P[2] := a_2, 0, 1: P[3] := a_3, 0, 1:
P[4] := 1, t*a_1, 0: P[5] := 1, t*a_2, 0: P[6] := 1, t*a_3, 0:
P[7] := 0, 1, a_1: P[8] := 0, 1, a_2: P[9] := 0, 1, a_3:

G := 0: var1 := 0:
for n from 0 to 9 do
G := G+add(c[k, n-k]*x^k*y^(n-k), k = 0 .. n):
for k from 0 to n do var1 := var1, c[k, n-k]:
end do: 
end do:
F := Homogenize(G, z):
Fx := diff(F, x):
Fy := diff(F, y):
Fz := diff(F, z):
Fxx := diff(F, x, x):
Fxy := diff(F, x, y):
Fyx := Fxy:
Fyy := diff(F, y, y):
Fxz := diff(F, x, z):
Fzx := Fxz:
Fzz := diff(F, z, z):
Fyz := diff(F, y, z):
Fzy := diff(F, z, y):

f := unapply(F, [x, y, z]): fx := unapply(Fx, [x, y, z]): fy := unapply(Fy, [x, y, z]): fz := unapply(Fz, [x, y, z]): fxx := unapply(Fxx, [x, y, z]): fxy := unapply(Fxy, [x, y, z]): fyx := unapply(Fyx, [x, y, z]): fyy := unapply(Fyy, [x, y, z]): fxz := unapply(Fxz, [x, y, z]): fzx := unapply(Fzx, [x, y, z]): fzz := unapply(Fzz, [x, y, z]): fyz := unapply(Fyz, [x, y, z]): fzy := unapply(Fzy, [x, y, z]):

sys := [f(P[1]) = 0, fx(P[1]) = 0, fy(P[1]) = 0, fz(P[1]) = 0, fxy(P[1]) = 0, fxz(P[1]) = 0, fxx(P[1]) = 0, fyy(P[1]) = 0, fzz(P[1]) = 0, fyz(P[1]) = 0, f(P[2]) = 0, fx(P[2]) = 0, fy(P[2]) = 0, fz(P[2]) = 0, fxy(P[2]) = 0, fxz(P[2]) = 0, fxx(P[2]) = 0, fyy(P[2]) = 0, fzz(P[2]) = 0, fyz(P[2]) = 0, f(P[3]) = 0, fx(P[3]) = 0, fy(P[3]) = 0, fz(P[3]) = 0, fxy(P[3]) = 0, fxz(P[3]) = 0, fxx(P[3]) = 0, fyy(P[3]) = 0, fzz(P[3]) = 0, fyz(P[3]) = 0, f(P[4]) = 0, fx(P[4]) = 0, fy(P[4]) = 0, fz(P[4]) = 0, fxy(P[4]) = 0, fxz(P[4]) = 0, fxx(P[4]) = 0, fyy(P[4]) = 0, fzz(P[4]) = 0, fyz(P[4]) = 0, f(P[5]) = 0, fx(P[5]) = 0, fy(P[5]) = 0, fz(P[5]) = 0, fxy(P[5]) = 0, fxz(P[5]) = 0, fxx(P[5]) = 0, fyy(P[5]) = 0, fzz(P[5]) = 0, fyz(P[5]) = 0, f(P[6]) = 0, fx(P[6]) = 0, fy(P[6]) = 0, fz(P[6]) = 0, fxy(P[6]) = 0, fxz(P[6]) = 0, fxx(P[6]) = 0, fyy(P[6]) = 0, fzz(P[6]) = 0, fyz(P[6]) = 0, f(P[7]) = 0, fx(P[7]) = 0, fy(P[7]) = 0, fz(P[7]) = 0, fxy(P[7]) = 0, fxz(P[7]) = 0, fxx(P[7]) = 0, fyy(P[7]) = 0, fzz(P[7]) = 0, fyz(P[7]) = 0, f(P[8]) = 0, fx(P[8]) = 0, fy(P[8]) = 0, fz(P[8]) = 0, fxy(P[8]) = 0, fxz(P[8]) = 0, fxx(P[8]) = 0, fyy(P[8]) = 0, fzz(P[8]) = 0, fyz(P[8]) = 0, f(P[9]) = 0, fx(P[9]) = 0, fy(P[9]) = 0, fz(P[9]) = 0, fxy(P[9]) = 0, fxz(P[9]) = 0, fxx(P[9]) = 0, fyy(P[9]) = 0, fzz(P[9]) = 0, fyz(P[9]) = 0]:
var := [c[0, 0], c[0, 1], c[1, 0], c[0, 2], c[1, 1], c[2, 0], c[0, 3], c[1, 2], c[2, 1], c[3, 0], c[0, 4], c[1, 3], c[2, 2], c[3, 1], c[4, 0], c[0, 5], c[1, 4], c[2, 3], c[3, 2], c[4, 1], c[5, 0], c[0, 6], c[1, 5], c[2, 4], c[3, 3], c[4, 2], c[5, 1], c[6, 0], c[0, 7], c[1, 6], c[2, 5], c[3, 4], c[4, 3], c[5, 2], c[6, 1], c[7, 0], c[0, 8], c[1, 7], c[2, 6], c[3, 5], c[4, 4], c[5, 3], c[6, 2], c[7, 1], c[8, 0], c[0, 9], c[1, 8], c[2, 7], c[3, 6], c[4, 5], c[5, 4], c[6, 3], c[7, 2], c[8, 1], c[9, 0]]:
A, b := GenerateMatrix(sys, var):

Solving this with

simplify(LinearSolve(A, b))

Gives a rather nicely looking solution. But the calculation strongly depends on the form of s, t and the a_i.

For example if we instead define 

s:=t^3:

The computation takes much longer and the result doesn't take a particularly nice form. Similarly if we instead take

a_1 := -t: a_2 := -t^4: a_3 := -t^7:

the computation takes hours / days and the result looks rather ugly (huge coefficients). Yet both of these inputs are mathematically equivalent to the original one.

The thing is that I have similar systems of linear equations that I know must have solutions, but the solution vector that maple puts out has coefficients with thousands of digits (which after the above I suspect to be wrong). I know the systems are vastly overdetermined, but even removing all redundant equations does not solve the problen.

Is there a way to get the correct solutions with maple? Does anyone know whether a different program would handle this problem better?

How can I add legend to a multicolored histogram using display?

 

I want to make some equation and convert to LaTeX to have some Exercises "Solve the equation" 
My code:
restart; A := [1, 2, 3/2, 4, 5/9]; B := [2, 5, -7, 1, 8]; C := [-1, -2, -3, -4, -5/3]; for i to nops(A) do 'solve*the*equation'*A[i]*x^2+B[i]*x+C[i] = 0 end do
How can I get code in LaTeX, it's mean, I get "Solve the equation $x^2+2x-1=0$" and get roots (if have)

how to approximate this number to The nearest decimal number by maple

0.6364562590

a:=[1,2,3,4,5]:

if I want b to have all elements less than 4 why can't I just write

b:=a<4;

?

 

In the link below is my code which generates numerical data of a Fourier series of an impulse function (not to be confused with the DIRAC DELTA IMPULSE).  The issue is as k increases the harmonic frequencies become faster than the time step which causes resolution issues at higher k values.  Is there a way to iteratively change the time step for each iteration of k value?  However, the range for t would have to correspondingly decrease or the file size would balloon by the corresponding change in k value.

So lets say my time step for k = 1 is 0.001 and my time range is 0..1, now for k = 1000 my time step would be 0.000001, but my time range would shrink from 0..1 to 0..0.001.  I hope this is not too confusing.  Maybe experimenting with my code will aid in understanding my request.

Thanks for any assistance

MATRIX_loop.mw


 

`` 

``

sol1 := dsolve([diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))-(diff(f(eta), eta))^2 = 0, diff(diff(diff(g(eta), eta), eta), eta)+f(eta)*(diff(diff(g(eta), eta), eta))+2*g(eta)*(diff(diff(f(eta), eta), eta))-3*(diff(g(eta), eta))*(diff(f(eta), eta)) = 0, (diff(diff(g(eta), eta), eta))*(diff(diff(g(eta), eta), eta))-g(eta)*(diff(diff(diff(g(eta), eta), eta), eta))*f(0) = 1, (D(f))(0) = 1, (D(f))(5) = 0, g(0) = 1, (D(g))(0) = -1, (D(g))(5) = 0], numeric, method = bvp); plots[odeplot](sol1, color = red)

Error, (in dsolve/numeric/bvp/convertsys) unable to convert to an explicit first-order system

 

 

``

``


 In this link i attache the code , which is working on this Download Three_euqtions.mw and i got an error which is i couldnot understand. So, kindly can you help on this ??

Thats the solution

a)   -(2x+10)+8=4*(-x+1)

b)   5x+27=-9*(x-10)+7

c)   12x+2*(x-3)=7*(x-5)+1

d)    -4*(x+8) +14=7*(x-2)+29

 

 

Using a Maple procedure is a very common task. For instance, here, F is a differential operator applied to any expression f

restart;
F := proc (f) options operator, arrow; x*(diff(f, y))-y*(diff(f, x)) end proc;
                            / d   \     / d   \
                F := f -> x |--- f| - y |--- f|
                            \ dy  /     \ dx  /
F(sin(x*y));
                    2             2         
                   x  cos(x y) - y  cos(x y)

It is also possible to index a procedure. There is an appropriate syntax. At the end, one should not forget to assign the procedure to a table. Here, F simply returns its indices.

restart;
`index/F` := proc (idx) return idx end proc;
F := table(F);
                       F := TABLE(F, [])
F[i, j, k, 1, 2, 3];
                       [i, j, k, 1, 2, 3]

My question is how to define a procedure that uses both indexed and non-indexed arguments? That is, a procedure that returns a result according inputs of the type:

F[i, j, k,...](x, y, z,...)

I need such a syntax to define a differential operator (like the first example) that is further defined as a tensor within the Physics package (Physics:-Define). This differential operator thus needs to be indexed.

 

Hi, there! I came across a problem that needs your help. When I added the following codes in the "Click action" (I'm not sure if it is this name, My Maple version is not English), it returns the error: "too many levels of recursion". Please help me out. The codes are

if elenum = 1 then
    faultcom := theDiagnosis[1][1][1][1];
    faultloc := theDiagnosis[1][1][1][2];
else
    for numi from 1 to elenum do
        faultcom := faultcom union theDiagnosis[1][1][i][1];
        faultloc := faultloc union theDiagnosis[1][1][i][2];
    end do;
end if;

Plot the two curves defined by

−x* y^2+4 *x=5

and

(1/3)*x^3+y^2=1

and find the number of intersections of these curves in the square

 

Help me out.

Cheers.

 

This is what I typed in the Maple and only got 1 answer...but the answer should be 4..

eqn1:=−x* y^2+4 *x=5
eqn2:=(1/3)*x^3+y^2=1;

sol:=fsolve({eqn1,eqn2},{x=-10..10,y=-10..10});
              {x = 1.324605526, y = -0.4746486082}

To answer this question you need to create a Maple function using Maple's arrow (->) notation.

Your function should take a Maple list of complex numbers as its input and return the largest modulus from that list.

Enter your function in the box below.

 

Really need help 

Cheers.

Hello,

I'm new as to write programs in Maple.

My problem is: How can i write program code into an empty worksheet?

How can i insert new commands into an existing program/procedure?

What do i have to do?

Can you help me please for my first steps, i didn't find any helpful information about this.

Thanks in advance

Volker

Hi, I am new to Maple 2017. I would appreciate advice on how to plot the following integral over the range a = -10 to a = 10

I(a):=int(exp(-x^2)*sin(a*x),x=0..infinity)

 

Thank you.

Aidan

Where I can found inverted pendulum on maple sim or good book?thanks

First 828 829 830 831 832 833 834 Last Page 830 of 2330