# Revision history [back]

### coupled second order differential equation

Hi,

I am working on the restricted three body problem, and it turns out it is a coupled second ODE.

code: a,t = var('a,t') x = function('x', t) y = function('y', t) dx2 = diff(x,t,2) == -(1-a)((x-a)/(sqrt((x-a)^2 + y^2))^3)-a((x+1-a)/(sqrt((x+1-a)^2 + y^2))^3)+x+2diff(y,t,1) dy2 = diff(y,t,2) == -(1-a)(y/(sqrt((x-a)^2 + y^2))^3)-a(y/(sqrt((x+1-a)^2 + y^2))^3)+y-2diff(x,t,1) desolve(dx2, x, ics=[0,1])

error:

ValueError Traceback (most recent call last)

/home/eric/<ipython console=""> in <module>()

/home/eric/programs/sage-5.5/local/lib/python2.7/site-packages/sage/calculus/desolvers.pyc in desolve(de, dvar, ics, ivar, show_method, contrib_ode) 418 ivars = [t for t in ivars if t is not dvar] 419 if len(ivars) != 1: --> 420 raise ValueError, "Unable to determine independent variable, please specify." 421 ivar = ivars[0] 422 def sanitize_var(exprs):

ValueError: Unable to determine independent variable, please specify.

I am not sure whats going on here. From what I have looked up on how to solve ODE in sage my code should be correct. I am using cantor for a graphical interface. I have also tried the code in the command line, and still get the same error.

 2 update code view calc314 4051 ●19 ●43 ●107

### coupled second order differential equation

Hi,

I am working on the restricted three body problem, and it turns out it is a coupled second ODE.

code: code:

a,t = var('a,t')
x = function('x', t)
y = function('y', t)
dx2 = diff(x,t,2) == -(1-a)((x-a)/(sqrt((x-a)^2 + y^2))^3)-a((x+1-a)/(sqrt((x+1-a)^2 + y^2))^3)+x+2diff(y,t,1)
-(1-a)*((x-a)/(sqrt((x-a)^2 + y^2))^3)-a*((x+1-a)/(sqrt((x+1-a)^2 + y^2))^3)+x+2*diff(y,t,1)
dy2 = diff(y,t,2) == -(1-a)(y/(sqrt((x-a)^2 + y^2))^3)-a(y/(sqrt((x+1-a)^2 + y^2))^3)+y-2diff(x,t,1)
-(1-a)*(y/(sqrt((x-a)^2 + y^2))^3)-a*(y/(sqrt((x+1-a)^2 + y^2))^3)+y-2*diff(x,t,1)
desolve(dx2, x, ics=[0,1])ics=[0,1])


error:

ValueError Traceback (most recent call last) last)

/home/eric/<ipython console=""> in <module>() console> in <module>()

/home/eric/programs/sage-5.5/local/lib/python2.7/site-packages/sage/calculus/desolvers.pyc in desolve(de, dvar, ics, ivar, show_method, contrib_ode)
418 ivars = [t for t in ivars if t is not dvar]
419 if len(ivars) != 1:
--> 420 raise ValueError, "Unable to determine independent variable, please specify."
421 ivar = ivars[0]
422 def sanitize_var(exprs): sanitize_var(exprs):

ValueError: Unable to determine independent variable, please specify.specify.


I am not sure whats going on here. From what I have looked up on how to solve ODE in sage my code should be correct. I am using cantor for a graphical interface. I have also tried the code in the command line, and still get the same error.