NDSolve in Mathematica

  • Mathematica
  • Thread starter Niles
  • Start date
  • #1
1,868
0
Hi

Say I solve the following differential equation in Mathematica:
Code:
s = NDSolve[{y''[x] + Sin[y[x]] y[x] == 0, y[0] == 1, y'[0] == 0}, y, {x, 0, 30}]
Plot[Evaluate[{y[x], y'[x], y''[x]} /. s], {x, 0, 30}, PlotStyle -> Automatic]
The last line plots the solutions vs. x, but how can I plot e.g. y''[x] vs. y[x]?

Best regards,
Niles.
 

Answers and Replies

  • #2
kai_sikorski
Gold Member
162
0
ParametricPlot[Evaluate[{y[x], y''[x]} /. s], {x, 0, 30}]
 
  • #3
1,868
0
Hi

Thanks for that. Whenever I try and alter the PlotRange, it changes both x and y. I guess that is reasonable, since it is a parametric plot. But is there any way for me to determine the range of x and y independently?

Best,
Niles.
 
  • #4
1,868
0
PlotRange -> {{0, 10}, {0, 5}} works. Thanks!
 

Related Threads on NDSolve in Mathematica

Replies
3
Views
1K
Replies
2
Views
2K
  • Last Post
Replies
1
Views
7K
Replies
6
Views
2K
Replies
5
Views
3K
Replies
3
Views
4K
Replies
8
Views
8K
Replies
4
Views
5K
Replies
2
Views
2K
Replies
6
Views
1K
Top