Preben Alsholm

11664 Reputation

22 Badges

15 years, 227 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Abdoulaye Z(0) = 0 determines the value of the parameter C (when a > 0).

The limits (= sup here) of the solutions for x -> infinity can be found for any concrete value of a > 0 and for 0 < a <= 1 it is largest for a = 1. The limit is 3.
I have just modified my worksheet to include this discussion at the bottom.

@BarKop In acer's worksheet I tried adding summarize = true, and it worked:
W := sort(Statistics:-PolynomialFit(3, Rok, TrzbyCelkemEmco, x, svdtolerance=1e-20,summarize=true));

I'm not aware of any restrictions in Maple on the number of equations etc. The limitations are probably determined only by your computer. But how about giving us the equations?

@reza gugheri Try this:
 

restart;

ode:=diff(v(x),x,x)+diff(v(x),x)*cot(x)-v(x)*(cot(x)^2+nu)=a^2*Q(x)/D1;

sol:=dsolve(ode);
indets(sol,specfunc(anything,hypergeom));
?hypergeom

The generalized hypergeometric functions are described in the help.

The ones appearing in sol are found by indets as shown above:

hypergeom( [3/4+1/4*(-4*nu+5)^(1/2), 3/4-1/4*(-4*nu+5)^(1/2)], [1/2], cos(x)^2),
hypergeom( [5/4+1/4*(-4*nu+5)^(1/2), 5/4-1/4*(-4*nu+5)^(1/2)], [3/2], cos(x)^2),
hypergeom( [7/4+1/4*(-4*nu+5)^(1/2), 7/4-1/4*(-4*nu+5)^(1/2)], [3/2], cos(x)^2),
hypergeom( [9/4+1/4*(-4*nu+5)^(1/2), 9/4-1/4*(-4*nu+5)^(1/2)], [5/2], cos(x)^2)

All four are of the form

hypergeom( [n1, n2], [d1], z)

i.e. the first 2 arguments are lists (lenths 2 and 1 respectively). The third argument is cos(x)^2.

 

@Carl Love Carl, my guess is that suvetha2000 is struggling to understand the code (or has given up).
You always write very neat and compact code, but often it does require some insight to understand it.

@JanBSDenmark 

To your remark: " The issue is that my high school students rely on Maple reporting actual solutions ... "

I will say that your students shouldn't rely (or at least not blindly rely) on Maple or any other computer software to give the correct answer at all times. There will always be bugs in computer software, so a healthy suspicion is called for.

Thus in my opinion students should'nt be shielded from bugs, but should learn from them.

This is not meant (of course) to imply that known bugs should not be fixed.

Have you contacted Customer Service?
Does this only happen for plot3d?

@Zeineb Your syntax is still wrong. Please have a closer look at my code and compare it to yours.

There are problems with = instead of := and with the syntax of mod.
(assume still has the space I mentioned.

In your 2D-math you have a space between assume and (a>0 ). In 2D-math input that space is interpreted as multiplication.
So remove the space.
Furthermore, you are making assumptions on a twice. They need to be in the same call to assume:
assume(a>0,a<1);
See ?assume, where it says:
"When the assume function is used to make an assumption about an expression x, all previous assumptions on x are removed."

There are more syntactical problems, e.g. that a loop cannot run unless the upper limit (here N) is concrete.

@Kitonum plot uses numerical integration thus never sees the symbolict result.

Compare to:
 

G:=int(eval(sqrt(1+((k*Pi)/l*cos((Pi*x)/l))^2),{k=2,l=2}), x);
plot(G, x=0..6,discont=true);

From G you can construct a differentiable (thus continuous) F using piecewise:
 

L:=limit(G,x=2,left);
R:=limit(G,x=2,right);
F:=piecewise(x<2,G,x=2,L,x<4,G+L-R,x=4,2*L-R,x<6,G+2*(L-R),x=6,2*(L-R)+L);
plot(F, x=0..6);

 

Then check:

diff(F,x) assuming x<6;
simplify(%-eval(sqrt(1+((k*Pi)/l*cos((Pi*x)/l))^2),{k=2,l=2}));  # 0

@amirhadiz Using dsolve/numeric with the parameters option is better than using your current approach.
Here is what you can do:
 

restart;
ode12:=
   {-0.1*a*diff(u(z),z,z) + 
     (z-2*diff(v(z)^(-1/2),z))*diff(u(z),z)+(3-2*b*diff(v(z)^(-1/2),z,z))*u(z)= 0, 0.1*diff(v(z),z,z)+0.01*z*a*diff(v(z),z)+0.02*v(z)-u(z)*b*v(z)^(1/2)=0,u(0)=c0, v(0)=0.1, D(u)(0)=c1, D(v)(0)=0};
sol:=dsolve(ode12, numeric,parameters=[a,b,c0,c1]);
sol(parameters=[1,1,0,1]); # Setting parameters
sol(1);
lastexception;
lastexception[-1];
plots:-odeplot(sol,[z,u(z)],0..0.25);
FindSingularity:= proc(params::list(realcons), max::realcons)
     sol(parameters=params);
     try sol(max)
     catch "cannot evaluate the solution further": 
          return lastexception[-1]
     end try;
     FAIL
end proc:

FindSingularity([1,1,0,1], 4);
FindSingularity([3,2,0,-1], 4);
## I would prefer not to assign to a and b. They are names appearing in dsolve.
## Thus I use aa and bb below:
for aa from 0.1 by 0.1 to 1 do
  for bb from -1 by 0.1 to 1 do 
    print(a=aa, b=bb, `singularity at` = FindSingularity([aa,bb,0,1],5))
  end do
end do;

In the loops above c0 = 0, c1 = 1 as you see.

Since I cannot reproduce the behavior you describe in any version of Maple that I have checked, I think you should tell us which version (release) you are using.

@vv  I tried doing rsolve({req, x(1)=1}, x, makeproc);   in the first worksheet by acer.

But I hadn't noticed that you used a different name (req) than his (eqa) for the recurrence relation.

What I got surprised me:  {req = 0, x(1) = 1}, x, makeproc

I was expecting either an error or a return unevaluated.
The call is sent to `rsolve/makeproc`, which returns unevaluated, but then rsolve itself strips rsolve from the result (called solution):
return op(solution)

 

@Jan Jensen I should point out the worst problem with the exact solution: It doesn't satisfy the initial condition given x(0) = 0, and yet odetest claims that it does:
 

sol3:=dsolve({eval(ode,{k=1,a=1,b=3}),x(0)=0});
eval(sol3,{t=0,x(t)=0});
evalf(%); # 0. = 2.664536887
odetest(sol3,[eval(ode,{k=1,a=1,b=3}),x(0)=0]); # [0,0]

The [0,0] from odetest means that (1) the ode is satisfies and (2) the initial condition is.

The blame is probably to be put on solve (not really dsolve).

@Jan Jensen To get the same use the option implicit in dsolve:
 

restart;
ode := diff(x(t), t) = k*(a - x(t))*(b - 2*x(t))^2;
sol:=dsolve(ode,implicit);
eval(sol,{t=0,x(t)=0});
solve(%,{_C1});
sol1:=eval(sol,%);
sol2:=op(solve(sol1,{x(t)}));

There are problems with this approach in this case as you will find out (or have already).

So I suggest solving numerically:
 

res:=dsolve({ode,x(0)=c},numeric,parameters=[a,b,c,k]);
res(parameters=[1,3,0,1]);
plots:-odeplot(res,[t,x(t)],0..10);
res(parameters=[a=1,k=1,b=3,c=1.1]); # In this form the order is irrelevant
plots:-odeplot(res,[[t,x(t)],[t,1]],0..10,view=0..1.5,color=["Green",blue]);
Q:=proc(a,b,c,k,R::range(realcons):=0..10) if not [a,b,c,k]::list(realcons) then return 'procname(_passed)' end if;
   res('parameters'=[a,b,c,k]);
   plots:-odeplot(res,[[t,x(t)],[t,a],[t,b/2]],R,_rest)
end proc;
plots:-animate(c->Q(1,3,c,1),[c],c=0..3);
plots:-animate(c->Q(1,3,c,1),[c],c=0..3,trace=24);

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