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;


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]));

Fifth I had to expand the determinate out to get the coefficients, and to 
create the determinate in terms of the eigenvalue to solve for the 
eigenvalue:

 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()


However, the computer hangs, and doesn't even finish the computation. 
Unless I assign values to either x,y, and/or a. Do I have to first assign 
values then take the real, and imaginary parts? If so that will end up 
being an issue with what I want to do with these eigenvalues.

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to