Message Boards Message Boards

0
|
3927 Views
|
6 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Plot a phase portrait of two complex ODE

Posted 6 years ago

Hi, I have two ODE's, which list as:

y = x' and y' = -ibx -c

where b and c are exponential constants. How can I generate a phase portrait of this ODE in wolfram alpha?

Thanks!

POSTED BY: Ser Man
6 Replies
Posted 6 years ago

Dear Michael, thanks for the code. I will try it on Mathematica directly, however I have a final question,

you say a is not there in the ODE, which is true, however, it is in your code:

Subscript[a, b

iand it is further down given along with b and c, which are in the equation, as a defined value (1). Where is a in the system of the ODEs, if it is included here in your code, and if it is not-related to the ODE, what is the a for?

Thanks!

PS: I take I can replace b and c with some different values.

Cheers

POSTED BY: Ser Man

I used the original:

y = x' and y' = -ibx -c

There is no a.

I'm using Mathematica, not W|A. I figured if it could be worked out in M, W|A could be tried. Here is the code I used (not cleaned up):

{xx, yy} = 
 DSolveValue[{y'[t] == -I b x[t] - c, x'[t] == y[t], 
     x[0] == Subscript[\[FormalX], 0], 
     y[0] == Subscript[\[FormalY], 0]}, {x[t], y[t]}, t] /. 
   Subscript[a_, b_] :> a /. {\[FormalX] -> x, \[FormalY] -> y}

Block[{a, b, c, x, y, t1 = 0, t2 = 2},
 a = 1;
 b = 1;
 c = 1;
 Show[
  With[{sols = 
     Flatten[Table[
       Evaluate@{xx, yy}, {x, -4., 4., 1./1}, {y, -4., 4., 1./1}], 1]},
   {Table[
     ParametricPlot3D[
      Evaluate@Table[
        Block[{xx, yy, p}, {xx, yy} = s; p = ReleaseHold@param; 
         If[! FreeQ[p, x | y], Print[p]];
         p
         ],
        {s, sols}],
      {t, t1, t2}, 
      PlotStyle -> 
       If[MatchQ[param, _[{Except[0] ..}]], Thick, Thin]],
     {param, {(*Hold@{Re@xx,0,Im@xx},Hold@{0,Re@yy,Im@yy},*)
       Hold@{Re@xx, Re@yy, 0.5 Im@xx + 0.5 Im@yy}}}]
    }
   ],
  Graphics3D[{
    Opacity[0.3],
    (*Line@Table[{{Re@xx,0,Im@xx},{Re@xx,Re@yy,0.5Im@xx+0.5Im@yy},{0,
    Re@yy,Im@yy}},{t,t1,t2,1./2}],*)

    InfinitePlane[{0, 0, 0}, {{1, 0, 0}, {0, 0, 1}}],
    InfinitePlane[{0, 0, 0}, {{0, 1, 0}, {0, 0, 1}}]
    }],
  BoxRatios -> {1, 1, 1}, PlotRange -> 10, 
  AxesLabel -> {Re[x], Re[y], (Im[x] + Im[y])/2}
  ]
 ]
POSTED BY: Michael Rogers

OK, but normally one wants to plot the curves $(x(t),y(t))$ for a sampling of initial conditions in some region. Because of the $i$ in the ODE, any nontrivial solution with have nonzero real and imaginary components for each coordinate, $x(t)$ and $y(t)$, even if you stick to real initial conditions. Thus you have four real coordinates describing a phase curve:

(Re[x[t]], Im[x[t]], Re[y[t]], Im[y[t]]}

To plot such a curve, it seems to me that you must project it onto a lower dimension. Projecting tends to muddy the phase portrait, since the projected curves might appear to intersect, which they do not do in the actual 4D phase space. So it seems to me you cannot do what you ask in any system, whether W|A, Mathematica, or whatever. Which is why I asked: I wondered if you had a way of representing the phase portrait that I did not know.

Here's an example of what I'm talking about for b = c = 1 and initial values for $x$ and $y$ being integers from $-4$ to $4$. The projection is given by $$x' = \Re \lbrace x(t) \rbrace,\ y'=\Re \lbrace y(t) \rbrace,\ z'={1\over2} \ \big(\Im \lbrace x(t) \rbrace+\Im \lbrace y(t) \rbrace\big)$$

enter image description here

POSTED BY: Michael Rogers
Posted 6 years ago

Thanks Michael. If you set b = c = 1 in:

[ a, ib; 1, 1]

it would give:

[ a, ic; 1, 1]

Did you include a? Can I try this command somehow? I have some experimental values for a and b. a would be 1^-68 and b would be 2^7. So a and b (c) differ so much, that one may wonder if it is plottable at all.

Thanks!

POSTED BY: Ser Man
Posted 6 years ago

Hi Michael, it can be simplified to:

y = x' and y' = -icx

where c is a real number, and i is the imaginary unit. According to the signs of the eigenvalues, and their relationship to the matrix determinant of this system, it should be a source spiral, evolving out from the unstable origin.

The matrix is:

[ a, ib; 1, 1]

where a and b are combined to c in the simplified ODE.

The eigenvalues and eigenvectors suggest thus an outward spiral

Thanks

POSTED BY: Ser Man

Can you give an example of the kind of output you want? Like an image off the internet, or a pic of a hand drawing. It seems to me that the phase space is ${\bf C}^2$, which is 4-dimensional, I don't have a good idea how one would represent such a space graphically.

POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract