a,l,x,y,u,v,xdot,ydot,udot,vdot = var('a,l,x,y,u,v,xdot,ydot,udot,vdot', domain = RR)
xdot = u;
ydot = v;
udot = -(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*v;
vdot = -(1-a)*(y/(sqrt((x-a)^2 + y^2))^3)-a*(y/(sqrt((x+1-a)^2 + y^2))^3)+y-2*u;
Third I had to process the Jacobian by long hand:
N = matrix([(diff(xdot,x)-l,diff(xdot,y),diff(xdot,u),diff(xdot,v)),(diff(ydot,x),diff(ydot,y)-l,diff(ydot,u),diff(ydot,v)),(diff(udot,x),diff(udot,y),diff(udot,u)-l,diff(udot,v)),(diff(vdot,x),diff(vdot,y),diff(vdot,u),diff(vdot,v)-l)]);
Fourth, I took the determinate by long hand. Sage wouldn't allow me to process it by using the built in determinate function:
dN = N[0,0]*(N[1,1]*(N[2,2]*N[3,3]-N[2,3]*N[3,2]) + N[1,2]*(N[1,2]*N[3,3]-N[3,2]*N[1,3]) + N[1,3]*(N[1,2]*N[2,3]-N[2,2]*N[1,3])) + N[1,0]*(N[0,1]*(N[2,2]*N[3,3]-N[3,2]*N[2,3]) + N[2,1]*(N[0,2]*N[3,3]-N[3,2]*N[0,3]) + N[3,1]*(N[0,2]*N[2,3]-N[2,2]*N[0,3])) + N[2,0]*(N[1,0]*(N[1,2]*N[3,3]-N[3,2]*N[1,3]) + N[1,1]*(N[0,2]*N[3,3]-N[3,2]*N[0,3]) + N[1,3]*(N[0,2]*N[1,3]-N[1,2]*N[0,3])) + N[3,0]*(N[0,1]*(N[1,2]*N[2,3]-N[2,2]*N[1,3]) + N[1,1]*(N[0,2]*N[2,3]-N[2,2]*N[0,3]) + N[2,1]*(N[0,2]*N[1,3]-N[1,2]*N[0,3]));
dN1 = expand(dN);
dN2 = dN1.coeffs(l); f1 = (dN2[1][0])*l^(dN2[1][1])+(dN2[2][0])*l^(dN2[2][1])+(dN2[3][0])*l^(dN2[3][1])
f2 = dN2[0][0];
soln = solve([f1 == 0], l);
Last I then created the solutions which turned out to be four solutions:
rsol0(a,x,y) = sol0(a,x,y).real()
isol0(a,x,y) = sol0(a,x,y).imag()
rsol1(a,x,y) = sol1(a,x,y).real()
isol1(a,x,y) = sol1(a,x,y).imag()
rsol2(a,x,y) = sol2(a,x,y).real()
isol2(a,x,y) = sol2(a,x,y).imag()
rsol3(a,x,y) = sol3(a,x,y).real()
isol3(a,x,y) = sol3(a,x,y).imag()
sol0(a,x,y) = soln[0].rhs()+f2;
sol1(a,x,y) = soln[1].rhs()+f2;
sol2(a,x,y) = soln[2].rhs()+f2;
sol3(a,x,y) = soln[3].rhs()+f2;
Hi,
First of all I am using a coupled 2sd ODE.
First step was to declare variables:
a,l,x,y,u,v,xdot,ydot,udot,vdot = var('a,l,x,y,u,v,xdot,ydot,udot,vdot', domain = RR)
Second step turn the two 2sd ODE into four 1st ODE.
xdot = u;
ydot = v;
udot = -(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*v;
vdot = -(1-a)*(y/(sqrt((x-a)^2 + y^2))^3)-a*(y/(sqrt((x+1-a)^2 + y^2))^3)+y-2*u;
Interesting that there are only 3 coefficients insterad of 4 by going through the process you had mentioned. I originally started this project on mathematica 6.0 student edition back in college, and I now need to recreate it in sage so I can publish a paper.
There is a real and imaginary solution for each eigenvalue. So a total of 8 eigenvalues from when I did it on mathematica.