Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@smokeybob A particular solution is usually defined as any solution to the inhomogeneous equation. Thus replacing the arbitrary constants by any values (e.g. zero) will give you a particular solution.

@smokeybob A particular solution is usually defined as any solution to the inhomogeneous equation. Thus replacing the arbitrary constants by any values (e.g. zero) will give you a particular solution.

@Peter_Parker Sorry no typing error,  but the order in series is the problem. See my answer to the question asked separately.

@Peter_Parker Sorry no typing error,  but the order in series is the problem. See my answer to the question asked separately.

I was puzzled by the empty list in the procedure

proc(x,y) []; evalf(y+I*10^(-x)); end proc

What purpose does that serve?

@PatrickT It is interesting that the picture displayed on MaplePrimes has the label "Right" appearing horizontally.

It is correctly displayed on the monitor screen in Maple 15.

@PatrickT It is interesting that the picture displayed on MaplePrimes has the label "Right" appearing horizontally.

It is correctly displayed on the monitor screen in Maple 15.

You can get vertical labels by using labeldirections.

dualaxisplot(plot(x^3,x=-1..1,labels=["Bottom","Left"],labelfont=["Times","Roman",15],labeldirections=[default,vertical]),
plot(x^5,x=-1..1,labels=["Bottom","Right"],labelfont=["Times","Roman",15],labeldirections=[default,vertical]),
axis=[gridlines=[5,majorlines=2]],title="Top",titlefont=["Times","Roman",15]);

You can get vertical labels by using labeldirections.

dualaxisplot(plot(x^3,x=-1..1,labels=["Bottom","Left"],labelfont=["Times","Roman",15],labeldirections=[default,vertical]),
plot(x^5,x=-1..1,labels=["Bottom","Right"],labelfont=["Times","Roman",15],labeldirections=[default,vertical]),
axis=[gridlines=[5,majorlines=2]],title="Top",titlefont=["Times","Roman",15]);

One way is to use fdiff and use output=listprocedure like this.

res:=dsolve(numeric,procedure=p,initial=Array([1,0,0,1]),number=4,procvars=[x(t),diff(x(t),t),y(t),diff(y(t),t)],start=0,output=listprocedure);
#As before:
plots:-odeplot(res,[[t,x(t)],[t,y(t)]],0..5);
#Now pull out the separate procedures for x(t), y(t), diff(x(t),t), and diff(y(t),t).
X,Y,X1,Y1:=op(subs(res,[x(t),y(t),diff(x(t),t),diff(y(t),t)]));
#Then use fdiff:
?fdiff

plot(fdiff(X1,[1],t),t=0..5);

One way is to use fdiff and use output=listprocedure like this.

res:=dsolve(numeric,procedure=p,initial=Array([1,0,0,1]),number=4,procvars=[x(t),diff(x(t),t),y(t),diff(y(t),t)],start=0,output=listprocedure);
#As before:
plots:-odeplot(res,[[t,x(t)],[t,y(t)]],0..5);
#Now pull out the separate procedures for x(t), y(t), diff(x(t),t), and diff(y(t),t).
X,Y,X1,Y1:=op(subs(res,[x(t),y(t),diff(x(t),t),diff(y(t),t)]));
#Then use fdiff:
?fdiff

plot(fdiff(X1,[1],t),t=0..5);

The number of elements in R is the number of function evaluations stored in the remember table of the procedure q. This will contain the information that input 't' returns literally q(t). It will have 2 entries for zero, one for the exact 0 and one for the float 0. (unless y(0)= 1 is replaced by y(0.) = 1).
My code attempted to find the actual stepsize used, so I removed the entry for 't'.

To find the number of steps for a non-classical method from the number of function evaluations, you have to know about the workings of the particular method.

nops(L) gives the number of operands in L (=elements, when L is a list as I used). I didn't use a vector, but if you want that you could just change the definition of Lix to

Lix:=<remove(type,map(op,[indices(R)]),name)>:

or equivalently

Lix:=Vector(remove(type,map(op,[indices(R)]),name)):

In Maple 15 the number of elements in a vector (or list, set, table, matrix) can be found by

numelems(Lix);

numelems(R);

In earlier versions you could e.g. do

LinearAlgebra:-Dimension(Lix);
nops({indices(R)});

Notice that the package linalg and the corresponding structures vector, matrix, array are deprecated. You should use the package LinearAlgebra and Vector, Matrix, and Array instead.

The number of elements in R is the number of function evaluations stored in the remember table of the procedure q. This will contain the information that input 't' returns literally q(t). It will have 2 entries for zero, one for the exact 0 and one for the float 0. (unless y(0)= 1 is replaced by y(0.) = 1).
My code attempted to find the actual stepsize used, so I removed the entry for 't'.

To find the number of steps for a non-classical method from the number of function evaluations, you have to know about the workings of the particular method.

nops(L) gives the number of operands in L (=elements, when L is a list as I used). I didn't use a vector, but if you want that you could just change the definition of Lix to

Lix:=<remove(type,map(op,[indices(R)]),name)>:

or equivalently

Lix:=Vector(remove(type,map(op,[indices(R)]),name)):

In Maple 15 the number of elements in a vector (or list, set, table, matrix) can be found by

numelems(Lix);

numelems(R);

In earlier versions you could e.g. do

LinearAlgebra:-Dimension(Lix);
nops({indices(R)});

Notice that the package linalg and the corresponding structures vector, matrix, array are deprecated. You should use the package LinearAlgebra and Vector, Matrix, and Array instead.

There is still a ws inIBCZ in your corrected version.

There is still a ws inIBCZ in your corrected version.

First 205 206 207 208 209 210 211 Last Page 207 of 231