# NDSolve Example doesn't work

Posted 5 months ago
754 Views
|
1 Reply
|
0 Total Likes
|
 I needed to solve following differential equation: {y''[x] == -Sin[y[x]], y == 1, y' == 0}.
However calling NDSolve[{y''[x] == -Sin[y[x]], y == 1, y' == 0}, y, {x, 0, 30}] produced an error NDSolve::deqn: Equation or list of equations expected instead of True in the first argument {(y^\[Prime]\[Prime])[x]==-Sin[y[x]],y==1,True}. After creating a new Notebook and trying example from the documentation of NDSolve (Namely this one: s = NDSolve[{y''[x] + Sin[y[x]] y[x] == 0, y == 1, y' == 0}, y, {x, 0, 30}] I get as an output still: NDSolve::deqn: Equation or list of equations expected instead of True in the first argument {Sin[y[x]] y[x]+(y^\[Prime]\[Prime])[x]==0,y==1,True}. I tried ClearAll[y, x] but it didn't seem to work.. My Mathematica Version is 12.1, installed on Windows Pro 64-bit, Version 2004, OS build 19041.572Thanks a lot for your feedback! Answer
1 Reply
Sort By:
Posted 5 months ago
 Hi Pavel,Unable to reproduce sol = NDSolve[{y''[x] == -Sin[y[x]], y == 1, y' == 0}, y, {x, 0, 30}] Plot[y[x] /. First@sol, {x, 0, 30}] I am running "12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020)", but I doubt the problem has to do with version or platform.Try restarting the kernel. Answer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments