I'm trying to solve this ODE [itex]R'(t)=\frac{-a}{R(t)^2}[/itex] numerically in Mathematica (a, b are non-zero constants). Here's what I have:
It's returning with
What does it mean there's a non-numerical value for a derivative at t=0 and how do I fix it?
Code:
NDSolve[{R'[t]==-a/R[t]^2, R[0]==b,
WhenEvent[R[t]==0, end=t; "StopIntegration"]}, R, {t,0,1}]
It's returning with
Code:
NDSolve:::ndnum : Encountered non-numerical value for a derivative at t==0.'
What does it mean there's a non-numerical value for a derivative at t=0 and how do I fix it?
0 commentaires:
Enregistrer un commentaire