Robert M. Corless
Department of Applied Mathematics
University of Western Ontario
London, Canada

Copyright 2001 by Robert M. Corless
All rights reserved

Programming in Maple 

Программирование в Maple

Sample Maple programs 

Пример программ Maple

Path-following in p(x, y) = 0 

Поэтапное решение уравнения p(x,y)=0

> restart;

> read "D:/books/ess/programs/pathDE.mpl";

> f := pathDE( x^2+y^2-1, x, y );

f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...
f := proc (N, t, xy, ypvec) local xr, xi, yr, yi, a...

> sol := dsolve( numeric, procedure=f, range=-Pi..Pi, start=0, initial=array([1,0,0,0]), procvars=[xr(s),xi(s),yr(s),yi(s)] );

sol := proc (rkf45_x) local i, comp_soln_data, odep...

> plots[odeplot]( sol, [xr(s),yr(s)], scaling=CONSTRAINED, colour=BLACK );

 

> sol := dsolve( numeric, procedure=f, range=-2*Pi..2*Pi, start=0, initial=array([0,1,sqrt(2),0]), procvars=[xr(s),xi(s),yr(s),yi(s)] );

sol := proc (rkf45_x) local i, comp_soln_data, odep...

> P1 := plots[odeplot]( sol, [[s,xr(s)]], linestyle=1, scaling=CONSTRAINED, axes=BOXED, labels=["",""], colour=BLACK):

> P2 := plots[odeplot]( sol, [[s,xi(s)]], linestyle=1, scaling=CONSTRAINED, axes=BOXED, labels=["",""], colour=BLACK):

> P3 := plots[odeplot]( sol, [[s,yr(s)]], linestyle=1, scaling=CONSTRAINED, axes=BOXED, labels=["",""], colour=BLACK):

> P4 := plots[odeplot]( sol, [[s,yi(s)]], linestyle=1, scaling=CONSTRAINED, axes=BOXED, labels=["",""], colour=BLACK):

> plots[display]({P1,P2,P3,P4});

> f2 := pathDE( y^2*exp(-y)-x, x, y );

f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...

f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...
f2 := proc (N, t, xy, ypvec) local xr, xi, yr, yi, ...

> sol2 := dsolve( numeric, procedure=f2, range=-4..4, start=0, initial=array([0,0,0,0]), procvars=[xr(s),xi(s),yr(s),yi(s)] );

sol2 := proc (rkf45_x) local i, comp_soln_data, ode...

> plots[odeplot]( sol2, [xr(s),yr(s)], colour=BLACK );

> plots[odeplot]( sol2, [s, abs((xr(s)+I*xi(s)-(yr(s)+I*yi(s))^2*exp(-(yr(s)+I*yi(s)))))], labels=["",""], style=POINT, symbolsize=15, symbol=CIRCLE, colour=BLACK );

С официального разрешения                    © 2002 Waterloo Maple, Inc

 
Hosted by uCoz