Why do you want to convert this system of ODEs to cartesian coordinates?
As you have presented the system, the two equations are not connected. You can solve the theta equation: theta(t)=t+C1. The r equation is separable, and it's possible to obtain an explicit expression for r(t).
SYS := [ diff(r(t),t)=sin(Pi*r(t)), diff(theta(t),t)=1 ];
SOL := dsolve( SYS, [r(t),theta(t)] );
[
[
[
[{theta(t) = t + _C1},
[
/ / 2 exp(Pi t + _C2 Pi) exp(2 Pi t + 2 _C2 Pi) - 1\\ ]
| arctan|--------------------------, - --------------------------|| ]
< \1 + exp(2 Pi t + 2 _C2 Pi) 1 + exp(2 Pi t + 2 _C2 Pi)/ >]
|r(t) = ----------------------------------------------------------------| ]
\ Pi /
From here you can find explicit expressions for the Cartesian coordinates
CART := [ x(t)=r(t)*cos(theta(t)), y(t)=r(t)*sin(theta(t)) ]:
eval( q1, map(op,SOL) );
[
[
[
[x(t) =
[
/ 2 exp(Pi t + _C2 Pi) exp(2 Pi t + 2 _C2 Pi) - 1\
arctan|--------------------------, - --------------------------| cos(t + _C1)
\1 + exp(2 Pi t + 2 _C2 Pi) 1 + exp(2 Pi t + 2 _C2 Pi)/
-----------------------------------------------------------------------------,
Pi
y(t) =
/ 2 exp(Pi t + _C2 Pi) exp(2 Pi t + 2 _C2 Pi) - 1\
arctan|--------------------------, - --------------------------| sin(t + _C1)
\1 + exp(2 Pi t + 2 _C2 Pi) 1 + exp(2 Pi t + 2 _C2 Pi)/
-----------------------------------------------------------------------------
Pi
]
]
]
]
]
But, if you really want to put these ODEs into cartesian coordinates, here is how I would do it:
This looks like a real mess. And, when Maple tries to solve these ODEs, it encounters some difficulties.
dsolve( %, [x(t),y(t)] );
Error, (in dsolve) numeric exception: division by zero
If I have missed something, please do not hesitate to ask again.
Doug
---------------------------------------------------------------------
Douglas B. Meade <><
Math, USC, Columbia, SC 29208 E-mail: mailto:meade@math.sc.edu
Phone: (803) 777-6183 URL: http://www.math.sc.ed
The original post included a question about plotting the phase portrait. This is easily obtained, using plots:-odeplot, when working with the ODEs in polar coordinates.
You did not provide any initial conditions, so I will have to make a guess: r(0)=1/2, theta(0)=0.
<p>Doug, yes that is brilliant. You have been an excellent help. I think i was chasing a red herring by trying to convert to cartesian.</p>
<p>I predicted that the fixed points occured at r = 0,1,2,3,.... and that Pi*r is unstable when r is even and stable when r is odd. Which is what your phase portrait confirms. Am i correct in saying that this implies that in the xy-plane there will be a unstable spiral at the origin and a stable limit cycle for all odd values of r where r=1,3,5,... and similarly a stable limit cycle for all even values of r, where r=2,4,6,...</p>
<p>Your phase portrait is brilliant. I'm not nearly familiar enough with Maple to come up with such things. Thanks for all your help.</p>
<p> </p>
<p>Regards</p>
<p> </p>
<p> </p>
why?
Why do you want to convert this system of ODEs to cartesian coordinates?
As you have presented the system, the two equations are not connected. You can solve the theta equation: theta(t)=t+C1. The r equation is separable, and it's possible to obtain an explicit expression for r(t).
SYS := [ diff(r(t),t)=sin(Pi*r(t)), diff(theta(t),t)=1 ]; SOL := dsolve( SYS, [r(t),theta(t)] ); [ [ [ [{theta(t) = t + _C1}, [ / / 2 exp(Pi t + _C2 Pi) exp(2 Pi t + 2 _C2 Pi) - 1\\ ] | arctan|--------------------------, - --------------------------|| ] < \1 + exp(2 Pi t + 2 _C2 Pi) 1 + exp(2 Pi t + 2 _C2 Pi)/ >] |r(t) = ----------------------------------------------------------------| ] \ Pi /From here you can find explicit expressions for the Cartesian coordinates
But, if you really want to put these ODEs into cartesian coordinates, here is how I would do it:
If I have missed something, please do not hesitate to ask again.
Doug
Phase Portrait
The original post included a question about plotting the phase portrait. This is easily obtained, using plots:-odeplot, when working with the ODEs in polar coordinates.
You did not provide any initial conditions, so I will have to make a guess: r(0)=1/2, theta(0)=0.
with( plots ): SYS := [ diff(r(t),t)=sin(Pi*r(t)), diff(theta(t),t)=1 ]; IC := [ r(0)=0.5, theta(0)=0 ]; SOL := dsolve( [SYS[],IC[]], [r(t),theta(t)], numeric ); odeplot( SOL, [r(t)*cos(theta(t)),r(t)*sin(theta(t))], t=0..10, numpoints=1000, scaling=constrained );
This looks believable.
I hope this is helpful.
Doug
<p>Doug, yes that is
<p>Doug, yes that is brilliant. You have been an excellent help. I think i was chasing a red herring by trying to convert to cartesian.</p>
<p>I predicted that the fixed points occured at r = 0,1,2,3,.... and that Pi*r is unstable when r is even and stable when r is odd. Which is what your phase portrait confirms. Am i correct in saying that this implies that in the xy-plane there will be a unstable spiral at the origin and a stable limit cycle for all odd values of r where r=1,3,5,... and similarly a stable limit cycle for all even values of r, where r=2,4,6,...</p>
<p>Your phase portrait is brilliant. I'm not nearly familiar enough with Maple to come up with such things. Thanks for all your help.</p>
<p> </p>
<p>Regards</p>
<p> </p>
<p> </p>