# is it possible to solve diff eqns in polar coordinates?

Discussion in 'Maple' started by Jase, Oct 21, 2003.

1. ### JaseGuest

Dear Group,

I was wondering how it might be possible to solve a system of coupled
ordinary differential equations expressed in polar coordinates. Also does
anyone have any idea how it might be possible to generate phase portraits
and such for this type of system? I suppose one way is to somehow convert
the polar coordinates into cartesian and then use the usual cartesian
versions?

Jase

Jase, Oct 21, 2003

2. ### Robert IsraelGuest

|>I was wondering how it might be possible to solve a system of coupled
|>ordinary differential equations expressed in polar coordinates.

A system of DE's is a system of DE's: there are no coordinates involved
as such.
You could, if you wish, apply a change of variables to your original
system which could be interpreted as expressing the original system in
polar coordinates. That change of variables is completely separate
from solving the system, however. For example:
diff(Y(t),t) = -X(t)*(X(t)^2 + Y(t)^2)};
syspolar:= simplify(solve(eval(sys,
{X(t)=r(t)*cos(theta(t)), Y(t)=r(t)*sin(theta(t))}),
{diff(r(t),t),diff(theta(t),t)}));
dsolve(syspolar, {r(t), theta(t)});

|>Also does
|>anyone have any idea how it might be possible to generate phase
portraits
|>and such for this type of system? I suppose one way is to somehow
convert
|>the polar coordinates into cartesian and then use the usual cartesian
|>versions?

Or perhaps the other way around: plot using odeplot (which does not accept
a "coords" option), and change coordinates using changecoords so this will
be displayed in polar coordinates.

Oops: it looks like there's a bug in changecoords here:
plots[changecoords](plots[odeplot](S,[r(t),theta(t)],t=0..2*Pi),polar);

Error, Array must have datatype = float[8]

This is in Maple 9: the bug also affects Maple 8, but with a different
error message.

A work-around is to use changecoords2d from my Maple Advisor Database,
Robert Israel
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia

Robert Israel, Oct 22, 2003

3. ### Robert IsraelGuest

|>Oops: it looks like there's a bug in changecoords here:

|>> S:= dsolve(syspolar union {theta(0)=0,
r(0)=1},{theta(t),r(t)},numeric):
|> plots[changecoords](plots[odeplot](S,[r(t),theta(t)],t=0..2*Pi),polar);

|>Error, Array must have datatype = float[8]

Another work-around:
plots[changecoords](applyop(convert,[1,1],P,listlist),polar);

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

Robert Israel, Oct 22, 2003
4. ### JaseGuest

Thanks for the help Robert! I think it is a rather strange omission that
odeplot doesn't work outright with the common alternatives to cartesian
coordinates. After all many systems are easier to study in different
coordinate systems.

Jase, Oct 22, 2003