>> From: Roberto Sussman />
I found a nasty plot using Maple 7 with a Mac (G4 Tower 400 Mhz, Mac OS
X version 10.1). Since Maple is not native it runs under the "Classic"
Mac OS 9.2 emulation.
First I run the following simple commands related to solving numericaly
a system of two ODE's
> restart;
> eqMN:=(beta0,lambda0,x)->diff(M(x),x)=piecewise(x>0,
x^2*(exp(beta0-beta(x))+lambda0), x=0, 0);
> eqbN:=(lambda0,x)->diff(beta(x),x)=piecewise(x>0,
> (M(x)/x^2-lambda0*x)*beta(x), x=0, 0);
>
S0:=dsolve({eqMN(10^6,0,x),eqbN(0,x),M(0)=0,beta(0)=10^6},{M(x),beta(x)},type=
numeric);
> seq(S0(.5*i), i=1..5);
> plots[odeplot](S0,[x,log10(M(x))],0..2.5,color=black);
Up to this point everything is fine. But then, I want to redo the ODE's
with a different method, therefore I edit the dsolve commands adding
(say) "method = lsode" (the problem is independent of the method). I do
so and then re-run all the commands. It does the numerical solutions and
tabulates numerical values, but displays an error message as I try to
plot them with odeplot. The message is
Error, (in StringTools:-Remove) mapped expression must return `true'
or `false'
Though, you can obtain the plot by forming a list of lists with the
points by using instead of odeplot the command
plot([seq([i/10,log10(rhs(S0(i/10)[2]))], i=0..25)], color=black);
Afterwards, since I could not get any plot with odeplot I quit Maple
and tried to start a new session, but got the error message
"The application Maple has unexpectedly quit... etc"
Hence I had to force-quit the whole Classic environment. This annoying
bug does not happen if running the same commands under Mac OS 9.x.
Hopefuly the Mac OS X native version of Maple might come soon. I write
below the transcript of the Maple session (after re-executing the group
of commands)
Roberto Sussman
> restart;
> eqMN:=(beta0,lambda0,x)->diff(M(x),x)=piecewise(x>0,
> x^2*(exp(beta0-beta(x))+lambda0), x=0, 0);
eqMN := (beta0, lambda0, x) -> diff(M(x), x) = piecewise(0 < x,
2
x (exp(beta0 - beta(x)) + lambda0), x = 0, 0)
> eqbN:=(lambda0,x)->diff(beta(x),x)=piecewise(x>0,
> (M(x)/x^2-lambda0*x)*beta(x), x=0, 0);
eqbN := (lambda0, x) -> diff(beta(x), x) =
/M(x) \
piecewise(0 < x, |---- - lambda0 x| beta(x), x = 0, 0)
| 2 |
\ x /
>
> S0:=dsolve({eqMN(10^6,0,x),eqbN(0,x),M(0)=0,beta(0)=10^6},{M(x),beta(x
> )},type=numeric, method=lsode);
S0 := proc(x_lsode) ... end proc
> seq(S0(.5*i), i=1..5);
-5
[x = .5, M(x) = .107253635455685075 10 ,
7
beta(x) = .100001172170238756 10 ], [x = 1.0,
-5
M(x) = .207236310045923610 10 ,
7
beta(x) = .100001321418795199 10 ], [x = 1.5,
-5
M(x) = .300759851927367088 10 ,
7
beta(x) = .100001405604256631 10 ], [x = 2.0,
-5
M(x) = .391263046364007452 10 ,
7
beta(x) = .100001463943739084 10 ], [x = 2.5,
-5
M(x) = .480790975386358341 10 ,
7
beta(x) = .100001508190117218 10 ]
> plots[odeplot](S0,[x,log10(M(x))],0..2.5,color=black);
Error, (in StringTools:-Remove) mapped expression must return `true'
or `false'
> plot([seq([i/10,log10(rhs(S0(i/10)[2]))], i=0..25)], color=black);
>
%
%===================================================
% Dr Roberto A Sussman,
% Investigador Titular B,
% Instituto de Ciencias Nucleares,
% Circuito Exterior, CU, UNAM,
% Mexico DF, 04510
%
% tels: +52-55-56224690, 91, 92, fax: +52-55-56224693
% email: & />
% web: http://www.nuclecu.unam.mx/~sussman
%===================================================
|