Preben Alsholm

13471 Reputation

22 Badges

20 years, 263 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@rrbaldino An indication of the need for an assumption is given by the output from
Norm(`velθ`, 2);
    

Clearly the absolute values used are superfluous if the variables are real, which is an indication that Maple is open to the possibility that the variables are complex (as Maple generally is).

Could you upload a worksheet. We have no way of knowing what Vector[column](%id = 230612588) refers to.

@tsunamiBTP I believe it came with Maple 13. Cannot check though, I don't have that release anymore.

1. Don't you mean initial value problem instead of boundary value problem? Runge-Kutta methods are meant for initial value problems.
2. Once you have written the RK6 code for a single equation it shouldn't be much of a problem to extend it to systems.

Using the defining sum from the help pages we get:
 

restart;
S:=Sum(z^k*(product(pochhammer(n[i], k), i = 1 .. p))/(factorial(k)*(product(pochhammer(d[j], k), j = 1 .. q))), k = 0 .. infinity);
n:=[1, -1, 1/2];
d:= [-12,-3];
p:=nops(n);
q:=nops(d);
S;
value(S);

So the answer for z = 1 would be 71/72, which agrees with the numerical evaluation of the sum:

evalf(eval(S,z=1));
evalf(71/72);
# Interestingly, using the inert form with evalf gives the same answer (i.e. evalf(71/72)):

Hypergeom([1, -1, 1/2], [-12,-3], 1);
evalf(%);
Finally, you can try replacing z=1 with z=1.0:

hypergeom([1, -1, 1/2], [-12,-3], 1.0);

Thus I'm convinced you have found a bug. I shall report it as an SCR (Software Change Request).

@John Fredsted I couldn't agree more.

@denny The reason it doesn't make any difference in your case is that the ordering in sets is lexorder.
So try this:

restart;
{x(t),xdot(t)}; #order kept because x comes before xd in a dictionary.
restart;
{xdot(t),x(t)}; # same order in output as above.
restart;
{xm(t),xdot(t)}; #order reversed because xd comes before xm in a dictionary.
{xdot(t),xm(t)}; # order kept
### So use a list, when you want a particular order.

 

To be sure that the plot comes out with x along the horizontal axis and xdot along the vertical axis, use a list instead of a set.
Thus use [x(t), xdot(t)].
To see that it matters you could try your existing command with x(t) and xdot reversed just to see if you have control:
DEplot(sys,{xdot(t),x(t)}, ... and the rest ); #xdot along the vertical axis
Compare with
DEplot(sys,[xdot(t),x(t)], ... and the rest ); #x along the vertical axis

I got to think that you may wonder why the message `[Length of output exceeds limit of 1000000]`  came up, since Maple's own procedures are by default only printed as a meager skeleton.
To see why, try the simple code below.

restart;
ode:=diff(x(t),t)=x(t);
dsolve({ode,x(0)=1},numeric); # Only a skeleton is printed
interface(verboseproc); # default value 1
interface(verboseproc=2); # Setting the value to 2
dsolve({ode,x(0)=1},numeric); # Lots of stuff even for this simple problem.

 

The last value in HA, i.e. 0.8 can be handled by raising abserr and maxmesh some.
The following worked for me with the default setting of Digits at 10.

res[5] := dsolve(eval({Eq1, Eq2, Eq3, Eq4, IC1, IC2}, params union {K1 = lambda*HA[5]}), numeric,maxmesh=2048,abserr=1e-4,continuation=lambda);

It took a while and the message
`[Length of output exceeds limit of 1000000]`
came up. That is not an error message, so just ignore it.
The graphs of F and G at that value of K1:
plots:-odeplot(res[5],[[eta,F(eta)],[eta,G(eta)]]);

Actually, it is a bug in the local procedure InputCheck:

showstat(Student:-NumericalAnalysis::InputCheck,1..4);

InputCheck := proc(ODE, IC, trange)
local de, dvar, fde, ivar, range, dvar_i, ivar_r, leftend, inival;
   1   if has(lhs(ODE),'D') then
   2     de := convert(lhs(ODE),'diff') = fde
       else
   3     de := ODE
       end if;
   4   fde := rhs(de);
       ...
end proc

de is defined in line 2 (in your case)  as diff(y(t),t) = fde (not assigned yet).
Then in line 4 fde is assigned the value of rhs(de), which of course is just itself.
Thus fde remains unassigned at this stage and it remains so.
It is as simple as this:

ODE:=D(y)(t) = t*y(t)+1/y(t);
de:=convert(lhs(ODE),diff)=fde;
fde:=rhs(de);
de;

######### I shall report the bug via an SCR.

I interpreted your reply to ThU in http://mapleprimes.com/questions/220473-Getting-Maple-To-Simplify-A-Power-Series   as saying that you would post executable code instead of a picture in the future.
When does the future begin?

If we may assume that gamma is not Euler's constant, but some parameter, then it is pretty simple to find the maximal value for gamma for which the problematic denominator is negative on the whole interval 0..3.
The value is 0.348922854747400.

To get a concise answer you should tell us if you are talking about a function of one or several variables.
Better yet, give us an example of a function of the type you are thinking about.

@umar khan Just copy and paste the code I gave into a fresh worksheet.  You could then just execute, but when copied like that, all commands will be in the same execution group, so all commands will be executed with just one punch on Enter, which is most often not desired.
Use the F3 key on your keyboard to separate into several execution groups, one at a time. Place the cursor in front of a command, press F3 and watch the result. The F4 key does the opposite, it joins execution groups.
I did that on my own computer and the result is this:
MaplePrimes16-12-11odesysCP.mw

First 64 65 66 67 68 69 70 Last Page 66 of 225