Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NDolve + ParametricPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67538] Re: [mg67513] NDolve + ParametricPlot
  • From: Selwyn Hollis <sh2.7183 at earthlink.net>
  • Date: Fri, 30 Jun 2006 04:14:13 -0400 (EDT)
  • References: <200606290409.AAA29004@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Paolo,

Look at the value of sol, and you will notice that NDSolve gives its  
result wrapped in an extra pair of braces. ParametricPlot doesn't  
like that. A simple fix is to put First@ in front of NDSolve, i.e.,

sol = First@NDSolve[{x''[t] == x[t], x[0] == 1, x'[0] == 1.1}, x, {t, 
0,3}];

--- Selwyn Hollis


On Jun 29, 2006, at 12:09 AM, Paolo Pani 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
>


  • Prev by Date: RE: Change Symbol in ListPlot
  • Next by Date: Re: Limit of an expression?
  • Previous by thread: NDolve + ParametricPlot
  • Next by thread: Re: NDolve + ParametricPlot