MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed



I would like to get Maple to solve a system of 3 equations, nonlinear. 

I use the solve command to get the correct solutions.


However I would like to see the steps, is there a way to do this?



I am trying to make a plot that shows the amplitude of a second order linear system relative to an external driving frequency ω, but I am having trouble defining my function. Here's what I have so far.



When I pass the amp function ω=0 and F=4, I don't get back what I expect. I would think that those symbols should evaluate to the values I passed in. I have tried different parameter names etc..


All I am trying to do is plot the function shown above for F=4 and 0≤ω≤5. I know I could manually plug the values in, but I thought I'd ask the proper way to do it. Any help is greatly appreciated. Thanks folks!

Hi guys!


I want to do a fractalzoom into the mandelbrot fractal. The basic idea was to produce all single plot pictures, and then display/animate the zoom by iterate through the list. But I cant find a solution that really works. Any help would be very appreciated :)


So where am I? A single picture is made like this: (Sorry math tool didnt take it)


plot3d(0, -2 .. 1, -1.5 .. 1.5, orientation = [-90, 0], grid = [250, 250], style = patchnogrid, color = mandelbrot, lightmodel = None):

As u can see, I use the colorfunc property to color the plane. The mandelbrot procedure evalueates how many iterations are needed to go beyond 2 (> 2).

I cant post pictures, so heres the code if u want to reproduce some:

mandelbrot := proc (x, y)

local c, z, iterationCount, position, iterations;

z := 0; iterations := 0; iterationCount := 35;

position := Complex(x, y);

c := evalf(position);

while iterations < iterationCount do

    if 2 <= abs(z) then return iterations;

    else z := z^2+c; iterations := iterations+1;

    end if


return iterations



As you can see i get a list of PLOT3D structures, each with different axis sizes or views. The problem now is when i use the straightforward way:

display(plots, insequence=true);

the animated frames get smaller and smaller, because the frame is set to the same size as the first frame. 

Do you have any idea how I can make the axis somewhat dynamic, or do you see a better approach?


Here's the rest of the code to produce the effect. Its nearly hardcoded, because its still in experimental phase, sorry for that :P

The test does the following: Start with window -2 .. 1, -1.5 .. 1.5 and with linear interpolation zoom in to the window -0.82 .. -0.7, -0.2 .. -0.08.

 v is used to store the view explicitely, is explained afterwards


steps := 3:

d1 := (2-0.82)/steps:

d2 := (1+0.7)/steps:

d3 := (1.5-0.2)/steps:

d4 := (1.5+0.08)/steps:

l := Array(1 .. 4):

v := Array(1 .. 4):

for i from 0 to steps do

    v(i+1) := [d1*i-2 .. -d2*i+1, -1.5+d3*i .. 1.5-d4*i, 0 .. 0];

    l(i+1) := plot3d(0, d1*i-2 .. -d2*i+1, -1.5+d3*i .. 1.5-d4*i, orientation = [-90, 0], grid = [100, 100], style = patchnogrid, color = mandelbrot, lightmodel = None);



display a single picture:



create the animation:

ll := convert(l, list):

display(ll, insequence = true);


Another approach:

I tried to explicitely give the view as argument:

display(l(i), view = v(i)), v(i) stored in previous render loop. This works, but then the question to resolve is how to draw each frame into the same plot figure and not creating a new plot window for each one?


Now you should have all informations, any help is very welcome!

Thanks in advance,



when i'm trying to solve, i get the following warning: Warning, solutions may have been lost


> TC := (p*A*((lambda-sigma)*(e^(lambda*t2)-1)+lambda*(e^((lambda-sigma)*T)-e^((lambda-sigma)*t2)))/(lambda*(lambda-sigma))-Ca-A*e^(lambda*t1)*((beta*a2+b2)*(e^(beta*t1)-1)/beta^2-(lambda*a2-b2)*(1-e^(-lambda*t1))/lambda^2)/(beta+lambda)+A*e^(lambda*t1)*b2*t1/(lambda*beta)-W*((alpha*a1+b1)*(1-e^(-alpha*t1))-alpha*b1*t1*e^(-alpha*t1))/alpha^2+A*(e^(lambda*t2)*((a1+b1*t2)*lambda*alpha+b1*(lambda-alpha))-e^(lambda*t1)*(b1*(alpha^2-lambda^2*e^((lambda+alpha)*(t2-t1)))-(a1+b1*t1)*lambda*alpha*(alpha+lambda*e^((lambda+alpha)*(t2-t1))))/(lambda+alpha))/(lambda^2*alpha^2)+Cs*A*e^((lambda-sigma)*t2)*((T-t2)*(lambda-sigma)-e^((T-t2)*(lambda-sigma))+1)/(lambda-sigma)^2-L*A*((e^(lambda*T)-e^(lambda*t2))/lambda-(e^((lambda-sigma)*T)-e^((lambda-sigma)*t2))/(lambda-sigma))-C*(A*(e^((beta+lambda)*t1)-1)/(beta+lambda)+W+A*(e^((lambda-sigma)*T)-e^((lambda-sigma)*t2))/(lambda-sigma)))/T;
> TC2 := subs(t2 = (ln(W*(lambda+alpha)/A)+(lambda+alpha)*t1)/(lambda+alpha), TC);
> x1 := diff(TC2, t1) = 0;
> x2 := diff(TC2, T) = 0;
> x3 := subs(A = 290, lambda = 4, a1 = .9, a2 = 2.4, b2 = 0.1e-1, b1 = 0.1e-2, alpha = 0.2e-1, beta = 0.4e-1, W = 90, Ca = 100, L = 11, C = 9, p = 12, Cs = 4, sigma = 0.2e-2, x1);
> x4 := subs(A = 290, lambda = 4, a1 = .9, a2 = 2.4, b2 = 0.1e-1, b1 = 0.1e-2, alpha = 0.2e-1, beta = 0.4e-1, W = 90, Ca = 100, L = 11, C = 9, p = 12, Cs = 4, sigma = 0.2e-2, x2);
> x5 := solve({x3, x4}, {T, t1});
Warning, solutions may have been lost

Maple gives wrong results?...

Yesterday at 10:45 PM zhangjf 52

evalf(Int(cosh(t)/(cosh((17/15)*t)+cosh(t)), t = 0 .. infinity));


evalf(int(cosh(t)/(cosh((17/15)*t)+cosh(t)), t = 0 .. infinity));



I am trying to setup a general metric with the Physics package.  The metric is composed of the Minkowski metric plus the product of two null vectors. Here is the code:




eta[mu,nu] := rhs(g_[]);



I get the following error:

Error, (in Physics:-Setup) wrong argument: g[mu, nu] = l[mu]*l[nu]+(Matrix(4, 4, {(1, 1) = -1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 2) = -1, (2, 3) = 0, (2, 4) = 0, (3, 3) = -1, (3, 4) = 0, (4, 4) = 1}, storage = triangular[upper], shape = [symmetric]))


My plan is to apply the rule g[~mu,~nu]*l[mu]*l[nu] = 0 and calculate the Christoffel symbols using the metric.

I am trying to use the Physics package because the DifferentialGeometry package seemed focused on Newman-Penrose.  I will not be using NP for the calculations, only a strict calculation of the Einstein field equations from the given metric.

Thank you.

Hi everybody,

In quantum mechanics, I want to draw the wave  of the electron in the hydrogen atom.  So in 3D, you will have a cricle and along the circle, there will be a cosine function that will meet after a full cercle (the standing wave that is possible).  The blue one and the red one at the same time.  But in 3D

The closest that I come to succes is with this commands:

But as you will see, the wave end at the same place as it started.  But instead of going in a cercle, is as a funny shape.


Thank you in advance for you trouble.


Mario Lemelin
Maple 18 Ubuntu 13.10 - 64 bits
Maple 18 Win 7 - 64 bits messagerie : téléphone :  (819) 376-0987

Grid:-Map no speed up...

Yesterday at 2:03 PM itsme 289

I have a complicated function that I call on a elements of a list. This function inside calls various other functions and in particular fsolve, which is not thread safe. In order to speed things up I tried using Grid:-Map, but have found a slight drop in performance.

So say a run with map takes 31 seconds, a run with Grid:-Map will take 32 seconds. By looking at the cpu activity, I can tell that only a single core is used at any one time (this is also evident from timing). By looking at the processes, I do see "mserver -gridnode 1/4", etc. present however, so new mserves are certainly spawned - they are just just not used concurrently.

Grid:-NumNodes() gives 4 for my CPU.

Any ideas how to force my code to run on all four nodes??

I am on ubuntu 12.04 x86_64.




AOA... There are three question

1. I want to convert exp(Iota*theta) into ternometric function i.e., 

exp(Iota*theta) = cos(theta)+Iota*sin(theta)

Is there any comand pl help...

2. Also i want to rationalize the complex number...

3. I want to seprate real and imaginary parts of a comaplex numbers



I try to sort a polynomial using the graded reverse lexicograpic order. According to the Documentation this is achieved via tdeg.
So here is what i tried:


sort( x+y+z, order = tdeg(x,y,z));


sort(x+y+z, [x,y,z], tdeg);

In both cases maple returns "x+y+z" instead of the expected "z+y+x". What am i doing wrong?




I have to simplify a piecewise function and Maple gets a more complicated solution than needed.

I don't know how to handle this kind of problems with Maple?
I don't understand why Maple doesn't see this?
Am I doing something wrong?

Thanks in advance for your help / advice.

# the code of my example
# Make a dimensionless function:
# -    Mf(x):= Mf(xi)*F*L
# -    variable ξ  ( xi:=x/L )
# F is the Force and L is the Length of the beam:
Mf(xi):=simplify(Mf(xi)) assuming F>0,L>0;
print("When I simplify this function by hand it will be");

Hello, everyone. I faced some promblems on maple. Hope you can help me.

I want to set up the commutation rules like Pauli sigma matrix in Physics Packages,

but failed to get the correct one.

Here is my maple code:

Setup(mathematicalnotation = true);

Setup(quantumop = {Q}, algebrarule = {%AntiCommutator(Q[j], Q[k]) = 2*KroneckerDelta[j, k], %Commutator(Q[j], Q[k]) = 2*I*(Sum(LeviCivita[i, k, l]*Q[l], l = 1 .. 3))});

Commutator(Q[1], Q[2]);
AntiCommutator(Q[1], Q[2]);
AntiCommutator(Q[1], Q[1]);
Commutator(Q[1], Q[1]);

In fact, Commutator(Q[1], Q[2]) give a incorrect result 0 while the correct answer is  2*I*Q[3].

Do anyone know how to resolve this?


can I remove tick marks from axis in plots ?


thank for any  help.

I need you help to make a movies ( animation)  according to the index k=1..10.  k is used in Vect_T[k], vector of time to make an animation of the true solution, and it's also used in Matrix(M[..,..,k]), h

True solution:ow can I make a seq of plots for different value of k. 


plot3d(True_solution(x,y,Vect_T[k]),x=0..a,y=0..b,axes=boxed,grid= [11,11]);

Analytic solution

plots:-matrixplot(Matrix(M[..,..,k]),axes=boxed,tickmarks= [[1="0", 2=" ", 3=" ", 4=" ", 5=".4", 6=" ", 7=" 0.6", 8=" ", 9=".8", 10=" ", 11="1"],[1="0", 2=" ", 3=" ", 4=" ", 5=".4", 6=" ", 7=" 0.6", 8=" ", 9=".8", 10=" ", 11="1"],default],labels=[x,y,u],axes = boxed);

I tried, this:

S:=seq(plots:-matrixplot(Matrix(M[..,..,i]),labels=[x,y,u],axes = boxed),i=1..10):
 But I get only one figure.


I tried

for k from 1 to 10 do
BoxTrue:=BoxTrue, plot3d(True_solution(x,y,Vector_time[k]),x=0..a,y=0..b,axes=boxed,grid= [11,11]): od:
display(BoxTrue, insequence=true);
also, no display


Given the lagrangian from the pendulum physics example on the help page,

or text format.

L := -sin(omega*t-phi(t))*(diff(phi(t), t))*a*l*m*omega+(1/2)*(diff(phi(t), t))^2*l^2*m+cos(phi(t))*g*l*m




1 2 3 4 5 6 7 Last Page 1 of 992