- #1
Deadstar
- 104
- 0
Hey folks I'm trying to code the Hamiltonian form of the circular restricted three body problem and would like a bit of help here. I've managed to code the non-Hamiltonian form and have gotten it to work fine but came run into trouble here.
I'm using the synodic coordinate system as described here http://en.wikipedia.org/wiki/Jacobi_integral#Synodic_system and have found the Hamiltonian form of the system to be...
[tex]H = \frac{1}{2}(p_x^2 + p_y^2) - xp_y + yp_x - \Omega[/tex]
where p is the particles momentum and [tex]\Omega = \frac{1-mu}{r_1} + \frac{\mu}{r_2}[/tex] . Note that I'm not involving the z-component yet until I get the basics sorted out.
Now this can be written as the following set of first order differential equations...
[tex]\dot{x} = p_x + y[/tex]
[tex]\dot{p_x} = p_y - \frac{\partial \Omega}{\partial x}[/tex]
[tex]\dot{y} = p_y - x[/tex]
[tex]\dot{p_y} = -p_x - \frac{\partial \Omega}{\partial y}[/tex]
(I prefer to write it like this, keeping x parts together and so on rather than keeping position parts together etc...)
Now this is where I get a bit stuck as I'm a bit confused about how to deal the the particles momentum. This is the code I wrote for the function...
function xdot = symCR3BP(t,x,mu)
xdot = zeros(4,1);
xdot(1) = x(2) + x(3);
xdot(2) = x(4) - (1-mu)*(x(1) + mu)/(((x(1) + mu)^2 + x(3)^2)^1.5) - mu*(x(1)-1+mu)/(((x(1) - (1 - mu))^2 + x(3)^2)^1.5);
xdot(3) = x(4) - x(1);
xdot(4) = -x(2) - (1-mu)*x(3)/(((x(1) + mu)^2 + x(3)^2)^1.5) - mu*x(3)/(((x(1) - (1 - mu))^2 + x(3)^2)^1.5);
end
Now notice I have never defined the particles mass and I'm not quite sure where to put it! An integration of this with a symplectic integrator just produces rubbish and any attempt to include mass in this yields momentums that are so small that they don't contribute to anything.
So where do I put the particles mass? I have tried to include it initial conditions but that did not work either. My usual test for integrators and this problem is to start near the L4 or L5 points and doing that with the above quickly sends the particle shooting out in an ever growing spiral which does not follow my other results. (my initial condition in the rotating frame is [0.5;0;0.9;0] which produces some form of horseshoe/tadpole type orbit for the standard 3 body problem function using any of my integrators.)
If anyones needs any more information just ask.
Thanks.
I'm using the synodic coordinate system as described here http://en.wikipedia.org/wiki/Jacobi_integral#Synodic_system and have found the Hamiltonian form of the system to be...
[tex]H = \frac{1}{2}(p_x^2 + p_y^2) - xp_y + yp_x - \Omega[/tex]
where p is the particles momentum and [tex]\Omega = \frac{1-mu}{r_1} + \frac{\mu}{r_2}[/tex] . Note that I'm not involving the z-component yet until I get the basics sorted out.
Now this can be written as the following set of first order differential equations...
[tex]\dot{x} = p_x + y[/tex]
[tex]\dot{p_x} = p_y - \frac{\partial \Omega}{\partial x}[/tex]
[tex]\dot{y} = p_y - x[/tex]
[tex]\dot{p_y} = -p_x - \frac{\partial \Omega}{\partial y}[/tex]
(I prefer to write it like this, keeping x parts together and so on rather than keeping position parts together etc...)
Now this is where I get a bit stuck as I'm a bit confused about how to deal the the particles momentum. This is the code I wrote for the function...
function xdot = symCR3BP(t,x,mu)
xdot = zeros(4,1);
xdot(1) = x(2) + x(3);
xdot(2) = x(4) - (1-mu)*(x(1) + mu)/(((x(1) + mu)^2 + x(3)^2)^1.5) - mu*(x(1)-1+mu)/(((x(1) - (1 - mu))^2 + x(3)^2)^1.5);
xdot(3) = x(4) - x(1);
xdot(4) = -x(2) - (1-mu)*x(3)/(((x(1) + mu)^2 + x(3)^2)^1.5) - mu*x(3)/(((x(1) - (1 - mu))^2 + x(3)^2)^1.5);
end
Now notice I have never defined the particles mass and I'm not quite sure where to put it! An integration of this with a symplectic integrator just produces rubbish and any attempt to include mass in this yields momentums that are so small that they don't contribute to anything.
So where do I put the particles mass? I have tried to include it initial conditions but that did not work either. My usual test for integrators and this problem is to start near the L4 or L5 points and doing that with the above quickly sends the particle shooting out in an ever growing spiral which does not follow my other results. (my initial condition in the rotating frame is [0.5;0;0.9;0] which produces some form of horseshoe/tadpole type orbit for the standard 3 body problem function using any of my integrators.)
If anyones needs any more information just ask.
Thanks.