Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Carl Love In Maple 2021.1 numerical integration of KummerM doesn't work with method=_d01ajc. Thus h[1] [1] doesn't get evaluated.in the double loop. I have submitted an SCR.
 

restart;
K:=KummerM(-0.0847656450, 5., 10.33906258*r^2);
int(K,r=0..1,numeric, method = _d01ajc);

 

@mmcdara To your first question: That is what I thought of first. You are right, your shorter version works too.

The type And(relation,satisfies(r->lhs(r)=t)) is satisfied by expressions that are both of type relation and also of the special type 'satisfies'. The argument to 'satisfies' is a procedure that returns true (in this example) if the relation (here t < something, or x(t)<something) has left hand side equal to t.
See type/satisfies.

@itsme You may be right. The acceptance of vector input is fairly new.

By the way there is another inconsistency: dsolve with method=laplace or type=series will not work without the variable(s) as a second argument. That I have been told is due to different people writing those parts.
 

restart;

sys:=Vector([diff(x(t),t),diff(y(t),t)]) = Matrix([[1,2],[0,3]]).Vector([x(t),y(t)]);
init:=<x(0),y(0)> = <x0,y0>; # vector equation
### I think the form of the following outputs are quite fine:
dsolve(sys);         # output set of eqs
dsolve({sys,init}); # output set of eqs
## Giving the second argument as a vector forces vector output:
dsolve({sys,init},<x(t),y(t)>); # output vector equation
dsolve(sys,<x(t),y(t)>);         # output vector equation

### The next outputs are also fine.
### The second argument, however, MUST be present when using method = laplace or (type=)series

dsolve(sys,[x(t),y(t)],method=laplace);   # output set of eqs
dsolve(sys,[x(t),y(t)],series);                   # output set of eqs
dsolve(sys,<x(t),y(t)>,method=laplace); # output vector equation
dsolve(sys,<x(t),y(t)>,series);                 # output vector equation

 

@Carl Love In the help page for seq the following two illustrations are given. Here adapted to the present discussion.
 

restart;
S:=NULL;
old:=x[4];
for x[4] from 1 to 10 do S:=S,u(x[4]) end do;
x[4]:=old;
S;
restart;
S:=NULL;
old:=x[4];
for x[4] in [1,2,3,4,5,6,7,8,9,10] do S:=S,u(x[4]) end do;
x[4]:=old;
S;

Here we get the assignment 11 to x[4] in the first and 10 to x[4] in the second.

This behavior is very old. Most likely goes back to the introduction of add and seq.

At least it exists in Maple 8 too. I remember noticing it years ago.

PS. I just cranked up an old computer with Maple V, Release 4.

The behavior is still an assignment to x[4]. The value assigned is, however, not 10 but 11.

That old computer also has Maple 6. That behaves as Maple 8, i.e. the assigned value is 10.

 

One reason might be that it has not been seen as important enough to merit attention; and I would agree.

You should provide a link to the worksheet.

I tried to copy what you posted. I had to terminate Maple with Ctrl+Delete.

@Sradharam If you insist on a symbolic solution of your ode in f alone, then you are out of luck.

If you want anything out of that equation you must use an approximate method of some kind.
The way I solved the full system with dsolve/numeric works just as well with your ode in f only.

So if you have no interest in g just use:

restart;
ode:=diff(diff(diff(f(x), x), x), x) = 1/2*(-2*diff(f(x), x)*c^2*t^2 - 6*diff(diff(f(x), x), x)*exp(c*x)*c^2*t - 6*diff(f(x), x)*f(x)*t^2 + diff(f(x), x)*t^2)/(exp(c*x)^2*c^2);
res:=dsolve({ode,f(0)=f0,D(f)(0)=f1,(D@@2)(f)(0)=f2},numeric,parameters=[c,t,f0,f1,f2],output=listprocedure);
#Setting parameters (an example):
res(parameters=[1,2,0.5,0.6,0]);

plots:-odeplot(res,[x,f(x)],-1..10);

## Here is a procedure that can be used by animate:
Q:=proc(c,t,f0,f1,f2,scene::list:=[x,f(x)],x_interval::range:=-1..10) 
   if not [c,t,f0,f1,f2]::list(realcons) then return 'procname(_passed)' end if;
   res(parameters=[c,t,f0,f1,f2]);
   plots:-odeplot(res,scene,x_interval,_rest)
end proc;

## Examples of use all with c, t, f1, f2 fixed
plots:-animate(Q,[1,2,f0,0.6,0.1,0..20],f0=-1..1,trace=24); 
plots:-animate(Q,[1,2,f0,0.6,0.1,[f(x),diff(f(x),x)],0..30],f0=-1..1);
plots:-animate(Q,[1,2,f0,0.6,0.1,[seq([x,diff(f(x),[x$k])],k=0..2)],-0.3..5],f0=0..5);

You can set c, t, f0, f1, f2 to any concrete value you like, but you won't get a formula in the usual sense for the solution.
PS. You may not be as interested in graphs or animations as I am.

If you only want numbers you can simply do this:
 

res(parameters=[1,2,0.5,0.6,0]);
F,F1,F2:=op(subs(res,[seq(diff(f(x),[x$k]),k=0..2)]));
X:=Vector([seq(i*0.5,i=-1..10)]);
# Values of f:
F~(X);
# Values of f'
F1~(X);
# Values of x, f, f', f'':
M:=<X|F~(X)|F1~(X)|F2~(X)>;
RES:=Matrix(2,1,{(1,1)=Array([x,f(x),diff(f(x),x),diff(f(x),x,x)]),(2,1)=M});
plots:-odeplot(RES); # even this you can plot with odeplot

Notice that I have changed the default output from dsolve/numeric to output=listprocedure.

@Carl Love Yes, Tom Leslie guesses right.

Since I use animations rather often I was surprised that that toolbar wasn't there when I clicked on the plot at the end.

 

P.S. On a new laptop acquired today (05/05/2021) I installed Maple 2021. No problem.

@Preben Alsholm The animation was produced in Maple 2020.

For some reason it doesn't work in Maple 2021.

I shall submit an SCR (a bug report).

PS. It works in your version Maple 17.

@acer How do you explain that f() + f() - f() + f(); returns 2*x?

@mmcdara Vectors are not accepted as input in dsolve in versions prior to Maple 18.
In versions before Maple 2018 diff wouldn't work on vectors unless you use the elementwise version diff~.

@tomleslie I use Windows 10 Home.

I didn't find any problem in my current version (beta) which is a week older than your version. I set the frame rate (FPS) at 3.

@Joe Riel

If RHERWOLF uses Maple 15 as he states and also uses Windows then he would find that
savelibname := "/home/maple/lib";
which doesn't seem to make any sense on a Windows computer.

First 20 21 22 23 24 25 26 Last Page 22 of 229