MaplePrimes Questions


It is possible to display something like:

4 + 3 = x - 1

without Maple actually adding the 4 and 3 and putting that as a 7?


Same idea with sqrt. Is it possible to write sqrt(9) in a worksheet and actually seeing it as square root of 9 rather than a 3. Maple automatically simplifies everything so it's kinda hard to show a step by step process. Is there a way to solve this problem?

To be clear, I am talking about typing this into an active worsheet line. I know I can do a lot of this if I just do text becuase text lines obviously don't execute. They just display text. The reason I need to have this working is becuase sometimes I would have a command line where I want some of it to be excuted and some of it not so I can't just use text.

Thank you


Consider a simple differential equation:

f1 := t -> sin(t);
f2 := t -> cos(t);
dsys := {diff(x(t), t) = x(t)*f1(t)+f2(t), x(0) = 3};
solution_procedure := dsolve(dsys, type = numeric, output = listprocedure);

If initial condition is given like this: x(0)=3, then it compiles. But if I define x(0)=f1(3) then it gives an error:

Error, (in dsolve/numeric/process_input) invalid specification of initial conditions, got HFloat(3.0) = sin(3)

How can I handle this?

How can I ask Maple to wake me up after running the code?

It takes a long time to finish the job. So it would be helpful to play a beep or something to inform me the answer is ready.

Thank you in advance for your help.

Help me, please!

If i have boundary conditions with D(psi), i have no problem. But if i have condition with psi(infinity) (which i need), Maple says "too few boundary conditions". Maybe i make stupid mistakes, but i don't see.


assume(r, nonnegative);
ic_Re := `ψRe`(0) = 0, (D(`ψRe`))(0) = 0;
ic_Im := `ψIm`(0) = 0, (D(`ψIm`))(0) = 0;
V0 := 2.5; ERe := 1.5; EIm := 1.2; `ℏ` := 6.582; mu := 938.27*(1/2); Q0 := 1.5; Rq := 4.5; Rv := 2.5;
Q := proc (r) options operator, arrow; -Q0*exp(-r/Rq) end proc;
V := proc (r) options operator, arrow; -V0*exp(-r/Rv) end proc;
`Eqn_ψRe` := -`ℏ`^2*(diff(`ψRe`(r), r, r)+2*(diff(`ψRe`(r), r))/r)/(2*mu)-ERe*`ψRe`(r)+V(r)+EIm*`ψRe`(r) = Q(r);
`Eqn_ψIm` := -`ℏ`^2*(diff(`ψIm`(r), r, r)+2*(diff(`ψIm`(r), r))/r)/(2*mu)-EIm*`ψRe`(r)-ERe*`ψIm`(r) = 0;
F := dsolve({ic_Im, ic_Re, `Eqn_ψIm`, `Eqn_ψRe`}, numeric);
plots[odeplot](F, [r, `ψRe`(r)], r = 0 .. 20, numpoints = 500);

plots[odeplot](F, [r, `ψRe`(r)], r = 0 .. 20, numpoints = 500);

assume(r, nonnegative);
ic_Re := `ψRe`(0) = 0, `ψRe`(infinity) = 0;
ic_Im := `ψIm`(0) = 0, `ψIm`(infinity) = 0;
V0 := 2.5; ERe := 1.5; EIm := 1.2; `ℏ` := 6.582; mu := 938.27*(1/2); Q0 := 1.5; Rq := 4.5; Rv := 2.5;
Q := proc (r) options operator, arrow; -Q0*exp(-r/Rq) end proc;
V := proc (r) options operator, arrow; -V0*exp(-r/Rv) end proc;
`Eqn_ψRe` := -`ℏ`^2*(diff(`ψRe`(r), r, r)+2*(diff(`ψRe`(r), r))/r)/(2*mu)-ERe*`ψRe`(r)+V(r)+EIm*`ψRe`(r) = Q(r);
`Eqn_ψIm` := -`ℏ`^2*(diff(`ψIm`(r), r, r)+2*(diff(`ψIm`(r), r))/r)/(2*mu)-EIm*`ψRe`(r)-ERe*`ψIm`(r) = 0;
F := dsolve({ic_Im, ic_Re, `Eqn_ψIm`, `Eqn_ψRe`}, numeric);
Error, (in dsolve/numeric/bvp/convertsys) too few boundary conditions: expected 5, got 4

Hi, I have been trying to solve the Schrodinger equation for harmonic oscillators using dsolve and plot the the wavefunctions for the different energy levels. However I am struggling to plot all the different wavefuntions on the same plot. I also want to normalize the wavefunctions to help compare their shapes and values. Here's my code:- schro := {diff(psi(x), x, x)-(alpha*x^4+x^2-energy)*psi(x) = 0}; // d / d \\ / 4 2 \ \ { |--- |--- psi(x)|| - \alpha x + x - energy/ psi(x) = 0 } \\ dx \ dx // / ic := {psi(3) = 0, (D(psi))(3) = 1}; {psi(3) = 0, D(psi)(3) = 1} schro1 := subs(energy = 3.30687, alpha = .1, schro); soln1 := dsolve(schro1 union ic, {psi(x)}, type = numeric); // d / d \\ / 4 2 \ \ { |--- |--- psi(x)|| - \0.1 x + x - 3.30687/ psi(x) = 0 } \\ dx \ dx // / proc(x_rkf45) ... end; with(plots); [animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot] odeplot(soln1, [x, psi(x)], -3 .. 3); Thank in advance


Is there any way to generate a subplot in Maple2016?

I want to show many plots in one table at once.

I appreciate any idea you may have.


Hello again,

Everytime I start an (I thought deteministic) algorithm the number, how often a loop run through, is different. That makes debugging and profiling hard. But tests say, the algorithm works well.

I analized my code, I think different set orders can cause the problem.

Can indexing a set change its order ?
Can set operations like minus or union gives different result-orders in different times?

Can a set operation like minus or union change the order of the origin sets?

Hi, I need help with this little university assignment.

See the thumbnail below.

I have been away from the class because of a staph infection and missed the notes about vectors and Euler's formula.


It would be helpful if someone could give a rundown about how to solve the problems or give a general solution.





my problem is as follows. Given

g := [g1, g2, ... , g99];    # a list of polynomials,  high  in degree and with big coefficients

S := [1, 3, 14, 29];        # Set of indices, which polynomials we want to multiply

p := 11;   # the modulus


I want to calculate the product of the constant-terms of the indexed g, that means for example

cg1 * cg3 * cg14 * cg29  mod p         

where cgi means coeff(g[i], x, 0), and mod should be mods,  using symmetric representatives


Till now I'm using:

    mods(mul(coeff(g[i], x, 0), i in S), p)

It works, but the problem is, that the order is not optimal and costs too much time.

The order is for example:
(3  *  5 * 7 * 9) mod 11;

But I need for efficieny an order like:
(((3 * 5 mod 11) * 7 mod 11) * 9 mod 11

I read about the fold operators, but I've no idea how to combine these with mul and mods to get what I need.


Dear All

I calculate something with gr tensor, for example Ricciscalar. How can I save it in maple memory? As you know, in this situation you can not use your calculation directly and it seems that it saved in grtensor memory not maple memory. For example, if you want to plot Ricciscalar, you should save it as a new definition in maple and then plot it. 

Thank you.

Hi everybody,

I got an error message, when i try to profile code with a goto statement inside.
Here is my minimal-example in Maple18. Is there a known conflict or what's wrong?

f := proc(x)
    if x < 0 then goto(POS): end if;
    return "A";
    return "B";
end proc:



Error, (in f) goto to an undefined or unreachable label
f := proc(x)
     |Calls Seconds  Words|
PROC |    1   0.000      3|
      1 |    1   0.000      3| if x < 0 then
      2 |    1   0.000      0|   goto(POS)
                               end if;
      3 |    0   0.000      0| return "A";
      4 |    0   0.000      0| POS;
      5 |    0   0.000      0| return "B"
end proc


I'm a quiet perplexed  in front of the result of the function solve for trigonometric equations.

The result of this equation solve(cos(x)=a,x); is arccos(a) and the solution -arcos(a) is not given.

In order to have the other solution (-arccos(a)), I try this solve({cos(x)=a,x>Pi/2,x<3*(Pi/2)},x); but without success.

1) How can I obtain all the solution with the solve function with trigonometric equation and only symbolic equations (no numerical value)?

2) Is it possible to obtain a specific solution by defining the definition domain of the variables in the equation ?

Thanks a lot for your help

I am trying to solve a system of equations of motion of gravitational field and in this way, I deal with a second order differential equation containing Dirac delta function as follows:

Eq9 := -(l[f]^2/l[g]^2+2)*(diff(G(r, t), r, r)-2*(diff(G(r, t), r))/r)+l[f]^2*(diff(F(r, t), r, r)-2*(diff(F(r, t), r))/r)/l[g]^2+2*l[f]^2*(m^2*l[f]^2-3)*(G(r, t)/r^2-F(r, t)/r^2)/l[g]^2 = l[g]*E*exp(Pi*t*l[f]^2*(1-2*kappa)/l[g]^2)*Dirac(t)*Dirac(r)*Dirac(z)


Eq10 := diff(G(r, t), r, r)-2*(diff(G(r, t), r))/r-2*kappa*(diff(F(r, t), r, r)-2*(diff(F(r, t), r))/r)-(2*(m^2*l[f]^2-3))*(G(r, t)/r^2-F(r, t)/r^2) = l[g]*E*exp(Pi*t*l[f]^2*(1-2*kappa)/l[g]^2)*Dirac(t)*Dirac(r)*Dirac(z)

 want to solve these equations with MAPLE software symbolically.
Can anyone guide me in this way, please?

plz help! How to draw the three-dimensional graphics (p(x,t))? When I run,it can not run.I do not know where the problem lies.The code is as follows:

with(PDEtools); with(student); KN := 3;
C2 := 1/.3; C1 := 0.6e-2/(.3); C3 := 4.3/(.3); beta := 0.43e-1;
ADM1 := proc (n) options operator, arrow; convert(subs(lambda = 0, value((Diff(F(Sum(lambda^i*U[i], i = 0 .. n)), `$`(lambda, n)))/factorial(n))), diff) end proc; A0[0] := F(U[0]);
for n to KN do A0[n] := ADM1(n) end do;
for n from 0 to KN do A[n] := unapply(simplify(convert(C1*(diff(subs({seq(U[i] = p[i](x, t), i = 0 .. KN)}, expand(subs(F(U[0]) = U[0]*exp(U[0]), A0[n]))), t)), diff)+C2*convert(subs({seq(U[i] = Diff(p[i](x, t), x), i = 0 .. KN)}, expand(subs(F(U[0]) = U[0]^2, A0[n]))), diff)), x, t) end do;
p[0] := proc (x, t) options operator, arrow; .2*sin((1/2)*Pi*x)*exp((-1/4)*t*Pi*Pi/C1) end proc;
p[1] := proc (x, t) options operator, arrow; (-(int(subs(t = s, C3*(diff(p[0](x, t), x))), s = 0 .. t))+int(subs(t = s, A[0](x, t)), s = 0 .. t))/beta end proc;
p[2] := proc (x, t) options operator, arrow; -(int(subs(t = s, C3*(diff(p[1](x, t), x))), s = 0 .. t))+int(subs(t = s, A[1](x, t)), s = 0 .. t) end proc;
p := unapply(subs(x = Zeta, t = tau, p[0](x, t)+p[1](x, t)+p[2](x, t)), Zeta, tau);

3 4 5 6 7 8 9 Last Page 5 of 1372