0
|
7994 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
GROUPS:

# Problem with Mathematica 9 or the equation is insoluble?

Posted 9 years ago
 Hi, I have got this differential equation: y''=x*sin(y) I am trying to use Mathematica 9 to solve this equation, so I write the following expression: A = First[ y /. NDSolve[{y''[x] == x*Sin[y[x]], y[0] == 1, y'[0] == 1}, y, {x, 0, 19}]] But Mathematica always answers with something like that: "NDSolve::deqn: Equation or list of equations expected instead of True in the first argument {(y^[Prime][Prime])[x]==x Sin[y[x]],y[0]==1,True}. >>" And "ReplaceAll::reps: {NDSolve[{(y^[Prime][Prime])[x]==x Sin[y[x]],y[0]==1,True},y,{x,0,19}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>" But a friend of mine has tried to input exactly what I wrote, and she got a normal result. She has Mathematica 10. By answering a question, how many maximum and minimum has the function, the answer should be 8. And my question is: Is there any problem with Mathematica or can you see if I write something wrong? Thanks to anyone who has tried solving this Attachments:
3 Replies
Sort By:
Posted 9 years ago
 I think you may have had an uncleared variable. In[1]:= sln = NDSolve[{y''[x] == x*Sin[y[x]], y[0] == 1, y'[0] == 1}, y, {x, 0, 19}] Out[1]= {{y -> InterpolatingFunction[{{0., 19.}}, <>]}} 
Posted 9 years ago
 Since the error message includesy^[Prime][Prime])[x]that ^ makes me believe you are somehow putting your ' and ' into superscript notation and making Mathematica think you are taking y to the '' power.If you start Mathematica fresh and just literally type only and nothing more thanA = First[ y /. NDSolve[{y''[x] == x Sin[y[x]], y[0] == 1, y[0] == 1}, y, {x, 0, 19}]]; Plot[A[x], {x, 0, 19}]without any anything to make anything into a superscript and don't use any palettes to try to publish your notation, just type, or maybe even scrape off the screen and paste the text above, then I think the problem will go away
Posted 9 years ago
Community posts can be styled and formatted using the Markdown syntax.