       Re: NDSolve and Parametric Plot

• To: mathgroup at smc.vnet.net
• Subject: [mg85468] Re: NDSolve and Parametric Plot
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Mon, 11 Feb 2008 06:15:27 -0500 (EST)
• References: <fomjh1\$hmn\$1@smc.vnet.net>

```Hi,

solution =
NDSolve[{x'[t] == 2 p[t], x == 2, p'[t] == -2 x[t],
p == Sqrt[-3]}, {x[t], p[t]}, {t, 0, 2*Pi}];

repart[tau_] := (Re[x[t] /. solution[]] ) /. t -> tau
impart[tau_] := (Im[x[t] /. solution[]] ) /. t -> tau

ParametricPlot[{repart[t], impart[t]}, {t, 0, 2 Pi},
PlotRange -> {{-2, 2}, {-2, 2}}]

may help.

Regards
Jens

Alex Cloninger wrote:
> So I'm trying to run a simple program that will solve this series of di=
fferential equations and plot the the x[t] function in the complex plane.=
Here's my code.
>
> solution = NDSolve[{x'[t] == 2p[t], x == 2, p'[t] == -=
2x[t], p == Sqrt[-3]}, {x, p}, {t, 0, 2*=CF=80}]
>
> repart[t_] := Re[x[t] /. solution]
> impart[t_] := Im[x[t] /. solution]
>
> ParametricPlot[{repart[t], impart[t]}, {t, 0, 2=CF=80}, PlotRange -> {{=
-2, 2}, {-2,2}}]
>
> For some reason, when I go to plot the curve, I get an error saying
> ParametricPlot::pptr: {repart[t], impart[t]} does not evaluate to a pai=
r of real numbers at t=2.617993877991494`*^-7
>