MaplePrimes Questions

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.

 

restart;
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);

restart;
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

Hi,

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.

 

 

-Thanks

Hello,

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";
    
    POS:
    return "B";
end proc:

f(-3);
                              "B"
f(3);
                              "A"

CodeTools[Profiling]:-Profile(f);
f(-3);
CodeTools[Profiling]:-PrintProfiles(f);
CodeTools[Profiling]:-UnProfile(f);

Error, (in f) goto to an undefined or unreachable label
f
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

Hello,

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)

and

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:

restart:
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);
with(plots);
plot3d(p(x,t),x=0..1,t=0..1)




Hello all
I want to integrate an equation involving different terms (some of them involve derivatives) the following picture shows the expression and the end result. I can do it manually by multiplying both sides with u'. but how can acheive that in maple
Picture

 

Eq4 := diff(u(xi), xi, xi) = a[0]+a[1]*u(xi)+a[2]*u(xi)^2; Eq5 := int(Eq4, xi); simplify(%)

diff(diff(u(xi), xi), xi) = a[0]+a[1]*u(xi)+a[2]*u(xi)^2

 

Error, (in int) wrong number (or type) of arguments: wrong type of integrand passed to indefinite integration.

 

diff(diff(u(xi), xi), xi) = a[0]+a[1]*u(xi)+a[2]*u(xi)^2

(1)

``

 

Download try.mw

Hello out there,

i just started using maple for some kinetik calculations.

it is a combination of the following formulas:

 

Lo := piecewise(sin(t) < 0, 0, sin(t) >= 0, sin(t))

L := Lo*(int(2*exp(-b*x(t)*(j*cos(phi)+sqrt(J^2-j^2*sin(phi)^2))), phi = 0 .. Pi))/Pi

r:= (int(u*L*j/(L+k), j = 0 .. J))/J^2

diff(x(t), t) = -B*x(t)+x(t)*r

 

The values would be:

 

b:=1
u:=1.2
J:=2.5
k:=3
B:=0.8

 

 

I want to plot x over t and get the values for it...
I tried several aproaches, but nothing realy worked...
Thanks a lot

Hey all,

my goal is to get a taylor expansion in Maple up to n-th order of a function y(t) (not defined in more detail, just abstract).

I want to taylor this function around tn, and I want the series for tn+1=tn + h. I would expect to get (as an example: 4th order)

y(tn+1) ≈ y(tn) + h* y'(tn) + h2/2*y''(tn) + h3/6*y'''(tn) + O(h4).

My command was:

and I get:

Can someone maybe point out what I am doing wrong and how I can fix it?

Thanks in advance!

Tim

First 1068 1069 1070 1071 1072 1073 1074 Last Page 1070 of 2434