Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

The bug doesn't appear in Maple 8, but does come up in Maple 12, 15, 16, 17, 18, and 2015 besides Maple 2016.
All these (including Maple 8) use NAG hw_c02agc it appears by setting infolevel[fsolve]:=3.

@Christopher2222 I just tried right clicking on the output of

1000*evalf(Pi);

in Maple 12 and got

The use of comma is likely because my computer is speaking Danish.
I got the same using Maple 2016.
Using identify(%);  immediately after produced 1000*Pi in both versions.

@acer I think I checked all links labelled A.
Except for
http://www.mapleprimes.com/questions/201351-There-Were-Problems-During-The-Loading
which has English and what appears to me to be Chinese (in the beginning), I can confirm that the worksheets are in Danish (at least in parts).
"hj\303\246lp"  probably was "hjælp" .
"sammenh\303\246ngen"  undoubtably was "sammenhængen" .

@andreasamdisen The first worksheet shows up empty in Maple 2016 (but is not), the second has the collapsed section F1 Introduktion og føringsveje 30/1, which expands nicely to reveal subsections etc.
Maple complained about incompleteness for both worksheets though.
I have remarked on previous occasions that this unfortunate phenomenon seems to happen more often for Danes (as in this case). I have no explanation for that.

There are some people (not me) on this forum who can help you. Your worksheet may or may not be recoverable.
So upload the worksheet and hope for the best.

@maxwell You will probably find a numerical solution easier to find, but of course that means that all parameters must be concrete and that you won't have a formula.
Starting where I left off above i.e. with constants defined (and with sol3A found for comparison only) try this:

res3:=dsolve({deq3, v3(0) = v__0}, numeric);
plots:-odeplot(res3,[t,v3(t)],0..10);
plots:-odeplot(res3,[t,v3(t)-sol3A],0..10);

Here is the last plot. It represents the difference between the exact solution (sol3A) and the numerical solution:

You can make that error smaller if desired by decreasing the default values of abserr and relerr, which for method=rkf45 are abserr=1e-7 and relerr=1e-6. (See the help page ?dsolve/numeric/rkf45)

Digits:=15:
res3a:=dsolve({deq3, v3(0) = v__0}, numeric,abserr=1e-12,relerr=1e-12);
plots:-odeplot(res3a,[t,v3(t)-sol3A],0..10);

@nm You could try the functions initially known to Maple.
Examples: Replace foo by sin, exp, LambertW, or whatever you can come up with in
showstat(`evalf/foo`);

You can define your own procedure `evalf/myfunc` for your function myfunc.
See ?evalf  (details)

@ I added a second numerical version to my answer (at the bottom). It defines peano as before (adding option remember though). Then it defines two very simple procedures, which just call peano. peano1(...)  returns peano(...)[1] and peano2(...)  returns peano(...)[2].
Notice that if the second argument (depth, here 5) is fixed then peano(t,depth) is only a function of one variable, but peano returns two results. Thus the need for peano1 and peano2. But you cannot expect those two to have common zeros.

Here is a little history:
The bug doesn't appear in Maple 8 nor in Maple 12. (The representations of the solution are different in the two, but they are equivalent).
The bug appears in Maple 15, 16, 17, 18.
The bug doesn't appear in Maple 2015.2 nor in Maple 2016.2. (sin and cos are used for the imaginary roots as they also are in Maple 12).
Whether it is present in Maple 13 or 14 I don't know.
### The following does work in Maple 18 (with a,b,c unassigned):

ode2:=a*diff(y(x), x$4)+b*diff(y(x),x$2)+c*y(x) = 0;
sol2:=dsolve(ode2);
eval(sol2,{a=26,b=-50,c=-2});
simplify(%);

 

 

@DuncanNox You wrote:
"What is a large number of n (or dimension of system) for solving mentioned equation in maple? I mean how many steps is possible to do in this metod using todays PC."
I don't know. But you could try with higher values of n.

@DuncanNox We prefer text so we don't have to type.
1. You have a syntax error: It should be s[i]:=subs(Soln,y(x));  since the right hand sides in Soln are procedures.
2. You forgot known=s[i-1].
###
But here is the approach that I called simplest and best:

restart;
n:=50:
sys:=seq(diff(y[i](x),x)=6*x-2*y[i-1](x),i=1..n):
y[0]:=x->3;
ics:=seq(y[i](0)=3,i=1..n):
res:=dsolve({sys,ics},numeric);
plots:-odeplot(res,[seq([x,y[i](x)],i=0..n)],0..3);
#Animation shown below:
plots:-display(seq(plots:-odeplot(res,[x,y[i](x)],0..3,title=i),i=0..n),insequence,labels=[x,y]);
### Symbolic solution:
sol:=dsolve({sys,ics}):
nops(indets(sol,specfunc(Int)));# Unevaluated Int present
sol1:=value(sol): #No more!
nops(indets(sol1,specfunc(Int)));
Y:=subs(sol1,[seq(y[i](x),i=1..n)]):
plot(Y,x=0..3);
plots:-display(seq(plot(Y[i],x=0..3),i=1..n),insequence);

Animating the numerical solution:

 


 

 

@DuncanNox
You wrote: " that would work, while there only two ODE. Bud this is only a part of my problem. A want to take first solution to second ODE, second solution do third ODE, atc. many times. "

dsolve can solve large systems, so what is the problem? Could you give us a concrete example?

@vv You wrote " I don't see why including elif in the definition would be useful, except that g(x) is now undefined for a symbolic x. "
My point was only that IF you want to use is then you must include the elif part. The undefined might as well have been FAIL or 345.

@vv As I see it this is not a bug. Quoting the relevant section from the help page on this in full. (It talks about is(x1,prop1) ).

"The is routine determines whether x1 satisfies the property prop1. It returns true, false, or FAIL. The is routine returns true if all possible values of x1 satisfy the property prop1. The is routine returns false if any possible value of x1 does not satisfy the property prop1. The is function returns FAIL if it cannot determine whether the property is always satisfied. This is a result of insufficient information or an inability to compute the logical derivation."

Note: I have corrected the initial version of the following statement:
With r := sin(x)+x*cos(x),  abs(r) <1/2 is in fact false for some values of x in -1..1. Thus is(abs(r))<1/2 ought to return false. But it returns FAIL meaning in this case (probably) that is cannot determine if it is the case ('inability'  in the quote above).

If you want to use is you must include an elif:

g := proc(x) local r; r := sin(x)+x*cos(x); if is(abs(r) < 1/2) then sin(x) elif is(abs(r))>=1/2 then cos(x) else undefined end if; end proc;

I'm not saying that this makes symbolic integration work in this case (it doesn't), just pointing out the logic.

 

@Ronan Starting from SHM you can do:
 

SHM := dsolve({Eq1, Theta(0) = 0});
diffSHM := diff(SHM, t);
convert(diffSHM,D);
eval(%,t=0);
eval(%,D(Theta)(0)=Vmax);
solve(%,{_C1});
eval(SHM,%);

The two uses of eval can be combined into one by using eval[recurse]:

SHM := dsolve({Eq1, Theta(0) = 0});
diffSHM := diff(SHM, t);
convert(diffSHM,D);
eval[recurse](%,{t=0,D(Theta)(0)=Vmax});
solve(%,{_C1});
eval(SHM,%);

There are several other ways it can be done, but let me stop here.
 

First 67 68 69 70 71 72 73 Last Page 69 of 231