MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica code for Kepler's radial velocity equation?


Am 18.10.2012 08:44, schrieb Virgil Stokes:
> I would appreciate a look at Mathematica code for Kepler's radial velocity
> equation (Nonlinear with 6 parameters).
>
>

For the radial equation of motion there are only four, energy, 
angularMomentum,  time t0 and  radius r[t0]==r0 of start.

NDSolve[
{r'[t]==Sqrt[2 energy-angularMomentum^2/r[t]^2
     +SolarMass* GravitationalConstant/r[t],
r[t0]==r0},{t, t0, tmax})

This works only in an open intervall between zeros of r'[t] with motion 
direction outward  r'[t]> 0.

For the other case of moving downwards to the gravitational center at 
r=0, you have to take the negative sqrt.

Caution: At r'[t] = 0 the equation is not Lipschitz in r.

Newtons equation of second order for the radius does not suffer from 
signs and zeros of r'[t]

(remember: centrifugal force   r omega^2 -> (r omega)^2/r^3 -> 
angularMomentum^2/r^3)

NDsolve[
{r''[t]==angularmomentum^2/r[t]^3 -SolarMass*GravitationalConstant/r[t]2,
r[t0]==R,
r'[t0]==v0},
{t,t0,tmax}]

Here the energy parameter is replaced by r'[t0] by replacement
energy ->  r'[t0]^2/2 + angularMomentum^2/r[t0]^2/2

-- 

Roland Franzius



  • Prev by Date: Re: Plot in function
  • Next by Date: Re: Export Data from Mathematica to Excel
  • Previous by thread: Mathematica code for Kepler's radial velocity equation?
  • Next by thread: Filling between lines in ListPlot not working