I am running Maple 6 on a Mac G3 and I am very pleased with its
performance. However, I do have a few questions about dsolve and someone
out there will probably have answers.

Here is the command I enter

Quote:> ans:=dsolve({eq1,eq2,eq3}union ic,[f(y),A(y),w(y)],type=numeric);

(ic is a set of initial conditions.)

To plot my solutions I enter, for example,

Quote:>plot('rhs(ans(y))',y=0..8.7,title=`w vs y`);

1) That is very awkward; is there a better way?

2) If my next command is

Quote:> ans(2);

the output is

[y = 2, f(y) = 4.27870735371794453, diff(f(y),y) = 1.66784699355773735,
A(y) = .350729197486994881, w(y) = .161303888719663890]

However, the system is singular and so, for large y (with infolevel set
to 2 ) I get

Quote:>ans(20);

ans:   Last values returned:
ans:    t =   5.06476724690444068
ans:    h =   .126926496554092524e-13
ans:    y =
ans:          11.2284126795603996
ans:          1616788.64420042886
ans:          .371735536516273383e-6
ans:          .99999891610531232
Error, (in ans) rkf45 is unable to achieve requested accuracy

I want to get hold of the last value of t returned; how do I do that? (Of
course, I can read it off but I want to assign that number to a variable.)

3) Does dsolve have the remember option? I want to enter, for example,

Quote:> plot('rhs(ans(y))*rhs(ans(y))',y=0.001..8.5,title=`A w vs y`);

Does Maple have to recalculate the values?

4) I usually use aliases to simplify typing; for example, I would like to
say alias(f=f(y)). I cannot make dsolve accept aliases when I have
initial conditions. The condition f(0)=1 is misinterpreted as f(y)(0)=1
which makes no sense. Asny suggestions?

Thanks.

1) Try odeplot in the plots package.

2) I don't know if there's a standard way, but here's a
rather tricky one.  The information is returned by
userinfo, so we redefine userinfo.

Quote:> oldui:= eval(userinfo):

unprotect(userinfo):
userinfo:= proc()
global lastt;
if nargs = 4 and args = {dsolve, `dsolve/rkf45`}
and args = ` t =` then lastt:= args fi;
oldui(args,args,args[3..nargs])
end:

And now after an error, the final t value should be stored
in the variable lastt.

To return userinfo to normal operation, use

Quote:> userinfo:= eval(oldui):

3) No, it doesn't have option remember.  It recalculates.
If you want to avoid this, you can use the value option
in dsolve,numeric to return an array of values, and plot
using this array.

4) Use a different letter:

Quote:> alias(F=f(y));

Then you can use F instead of f(y) in the DE, and f(0) in

Department of Mathematics        http://www.math.ubc.ca/~israel
University of British Columbia

I have tried suggestions 1, 2, and 4; they all work and they will
simplify things greatly for me. Thank you.

I will resort to suggestion 3 when my machine is taking too long to do
computations; right now it appears instantaneous.

I must say I feel quite stupid for not seeing the answer to 4. Oh, well.

I am trying to use the dsolve to numerically solve a system of two
equations.

dx/dp = x(p)cos(p) / ( x(p)y(p) - sin(p) )
dy/dp = x(p)sin(p) / ( x(p)y(p) - sin(p) )

with initial conditions x(0) = 0 and y(0) = constant.  Where the constant is
given.  When I make the call to dsolve it spits out its procedure.
However, when I go to evaluate it at anything other than p=0 I get "can not
evaluate solution farther right of zero, probably a singularity".  I think
this is because it is getting a zero over zero in the evaluation of dx/dp
and dy/dp.  Using l'Hopital's rule I get

dx/dp(at p=0) = 2/y(0)
dy/dp(at p=0) = 0

So, there shouldn't be any problems?  Is there some way I can impart this
information to maple so that it can correctly use its Runga-Kutta routine to
solve this problem for me?  Any ideas or would be greatly appreciated.

Thanks,
Ed

3. dsolve