Question: dsolve not solving differential equations with initial conditions

The dsolve function is not working to solve a set of differential equations I have written. No error message is showing, but the code does not work.
 

``

with*plots

G := 0.667408e-10

0.667408e-10

(1)

M := 0.56832e27+0.55855e19

0.5683200056e27

(2)

a := 0.1501e10

0.1501e10

(3)

ecc := .232

.232

(4)

orbit := proc (T) local Eqns, ICs, soln; Eqns := diff(xH(t), t) = vxH(t), diff(yH(t), t) = vyH(t), diff(vxH(t), t) = G*M*xH(t)/(xH(t)^2+yH(t)^2)^(3/2), diff(vyH(t), t) = G*M*yH(t)/(xH(t)^2+yH(t)^2)^(3/2); ICs := xH(0) = a*(1-ecc), yH(0) = 0., vxH(0) = 0., vyH(0) = sqrt(G*M*(1+ecc)/(a*(1-ecc))); soln := dsolve({Eqns, ICs}, numeric, method = classical[rk4]); odeplot(soln, [xH(t)/a, yH(t)/a], 0 .. T, scaling = constrained, labels = ["x/a", "y/a"], numpoints = 2000) end proc

proc (T) local Eqns, ICs, soln; Eqns := diff(xH(t), t) = vxH(t), diff(yH(t), t) = vyH(t), diff(vxH(t), t) = G*M*xH(t)/(xH(t)^2+yH(t)^2)^(3/2), diff(vyH(t), t) = G*M*yH(t)/(xH(t)^2+yH(t)^2)^(3/2); ICs := xH(0) = a*(1-ecc), yH(0) = 0., vxH(0) = 0., vyH(0) = sqrt(G*M*(1+ecc)/(a*(1-ecc))); soln := dsolve({Eqns, ICs}, numeric, method = classical[rk4]); odeplot(soln, [xH(t)/a, yH(t)/a], 0 .. T, scaling = constrained, labels = ["x/a", "y/a"], numpoints = 2000) end proc

(5)

orbit(20)

odeplot(soln, [0.6662225183e-9*xH(t), 0.6662225183e-9*yH(t)], 0 .. 20, scaling = constrained, labels = ["x/a", "y/a"], numpoints = 2000)

(6)

``


 

Download Project.mw

Please Wait...