Message Boards Message Boards

0
|
5226 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Fix this numerical analysis approach for Newton's gravity equation?

Posted 5 years ago

The following .nb file is simply Newton's equation for gravity after being integrated to obtain a related differential equation.
To obtain the new equation, one simply takes:
y" = k/y^2
Multiply by y' then integrate from 0 to t:
y'[t]^2/2-y'[0]^2/2 = -k/y[t]+k/y[0]

My real issue arises in that whenever I have y[0] (or y'[0]) in a differential equation, it returns an error that I don't know how to clear up. I'd rather be able to leave y'[0] and y[0] in the equation instead of renaming them a or b.

Attachments:
POSTED BY: Joshua Champion
2 Replies

Joshua,

Your problem is not formulated correctly. If you want to integrate your original problem use

NDSolve[{y''[t] == 5/y[t]^2, y[0] == 100, y'[0] == 0}, 
 y[t], {t, 0, 100}]

Your second version of the problem does not make sense. I can't understand how it follows from the first equation and besides, Its a first order ODE so you can only specify one initial condition (y[0]==0). You can't specify y'[0] because the differential equation is for y'[t]. To integrate the second equation (assuming it had some physical meaning) the proper formulation in MMA would be as follows (since y'[0] ==0 there can be no y'[0] term)

NDSolve[{y'[t]^2/2 == -5/y[t], y[0] == 100}, y[t], {t, 0, 100}]

I hope this helps.

Regards,

Neil

POSTED BY: Neil Singer

looking at the error msg, I'd say that having y'[0] in the differential equation looks like a different functional dependence. You may have to rename them.

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract