Re: NDolve + ParametricPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg67533] Re: [mg67513] NDolve + ParametricPlot
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Fri, 30 Jun 2006 04:13:57 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
sol = NDSolve[{x''[t] == x[t], x[0] == 1, x'[0] == 1.1},
x, {t, 0, 3}];
Plot[x[t] /. sol, {t, 0, 3}];
Plot[D[x[t]] /. sol, {t, 0, 3}];
ParametricPlot[{x[t] , D[x[t]]}/.sol, {t, 0, 3}];
The exact solution is
x[t]/.DSolve[{x''[t] == x[t], x[0] == 1, x'[0] == 11/10},
x[t], t][[1]]
((1/20)*(-1 + 21*E^(2*t)))/E^t
%//FullSimplify
Cosh[t] + (11*Sinh[t])/10
Bob Hanlon
---- Paolo Pani <paolopani at RIMUOVEREgmail.com> wrote:
> Hi, i'm new with Mathematica..i'm getting mad with expressions like this:
>
> sol = NDSolve[{x''[t] == x[t], x[0] == 1, x'[0] == 1.1}, x, {t, 0, 3}];
> Plot[x[t] /. sol, {t, 0, 3}];
> Plot[D[x[t]] /. sol, {t, 0, 3}];
> ParametricPlot[Evaluate[{x[t] /. sol, D[x[t] /. sol]}], {t, 0, 3}];
>
> The first two Plots are ok, the third give me:
>
>
>
> ParametricPlot::pptr: {InterpolatingFunction[{{0., 3.}}, {2, 2, True,
> Real, \
> {3}, {0}}, {{\[LeftSkeleton]1\[RightSkeleton]}}, {{0, 3, 6, 9, 12, 15, 18, \
> 21, 24, 27, \[LeftSkeleton]32\[RightSkeleton]}, {1., 1.1, \[LeftSkeleton]8\
> \[RightSkeleton], \[LeftSkeleton]113\[RightSkeleton]}}, {Automatic}][t]}
> does \
> not evaluate to a pair of real numbers at t = 1.25`*^-7.
>
>
>
>
> ... and "More..." does tell nothing more.
>
> Where is my mistake?
>
> Thanks and sorry for my bad english
>
> Paolo
>