MathGroup Archive 2007

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

Search the Archive

Re: NDSolve with functions of vectors


Hi, I tried your code and got these errors. What did I miss? 
Thanks.

Part::partw: Part 2 of x[s] does not exist. >>

Part::partw: Part 3 of x[s] does not exist. >>

Steve Luttrell wrote:
> This does what you want:
> 
> solution =
>  NDSolve[{x'[s] == {2*x[s][[2]], x[s][[1]]/3, x[s][[3]]},
>    x[0] == {1, 1, 1}}, x[s], {s, 0, 1}]
> 
> gives
> 
> {{x[s]->InterpolatingFunction[{{0.,1.}},<>][s]}}
> 
> Then
> 
> ParametricPlot3D[Expand[x[s]/.solution[[1]]],{s,0,1}]
> 
> gives a 3D plot of the trajectory for 0<=s<=1.
> 


  • Prev by Date: Re: Displaying graphics with the MathKernel in OS X
  • Next by Date: Re: Help on drawing intervals
  • Previous by thread: Re: NDSolve with functions of vectors
  • Next by thread: Re: Re: NDSolve with functions of vectors