0
$\begingroup$

I have solved a set of coupled differential equations and now I need to convert them into different dependent variables and sketch their trajectories.

Here is the code I have written so far:

zeta1 = x[t] + I y[t];
Eqn1 = (I/zeta1 + 1/Im[zeta1])/(8 Pi Conjugate[zeta1]);
s = NDSolve[{x'[t] == Re[Eqn1], y'[t] == -Im[Eqn1], x[0] == 1, 
y[0] == 1}, {x, y}, {t, 0, 10}];

The new coordinates are obtained as follows:

p[t] = -x[t]^2 + y[t]^2

q[t] = -2 x[t] y[t]

Any ideas how should I do this ?

$\endgroup$
1
  • $\begingroup$ Look up Table and Map. $\endgroup$
    – Sektor
    Nov 29, 2013 at 15:47

1 Answer 1

1
$\begingroup$
zeta1 = x[t] + I y[t];
eqn1 = (I/zeta1 + 1/Im[zeta1])/(8 Pi Conjugate[zeta1]);
s = NDSolve[{x'[t] == Re[eqn1], y'[t] == -Im[eqn1],x[0] == y[0] == 1}, {x, y}, {t, 0, 10}]; 
Grid[{Plot[# /. s,           {t, 0, 10}, Evaluated -> True, PlotLabel -> ##], 
      ParametricPlot[# /. s, {t, 0, 10}, Evaluated -> True, PlotLabel -> ##]} & /@ 
                                    {{x[t], y[t]}, {-x[t]^2 + y[t]^2, -2 x[t] y[t]}}, Frame -> All]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.