Вы находитесь на странице: 1из 2

# Basic 2-body system, masses M & m

# in circular orbit around centre of mass at origin, separation l


# positions M: (-l*m/(M+m), 0) and m: (l*M/(M+m), 0)
# centripetal gravitational force = GMm/l^2
# Circular orbits, angular velocity = w radians/sec
# acceleration = w*w*r
# F = m*a
# GMm/l*l = m*w*w*(l*M/(M+m)) = M*w*w*(l*m/(M+m))
# G/l*l = w*w*(l/(M+m))
# w*w = G(M+m)/l^3
# w = sqrt(G(M+m))*l^(-3/2)
#
# Write u = l*m/(M+m)
# Write v = l*M/(M+m)
# Test particle at (p,q) mass t, corotating at angular velocity w
# Vectors _a = (-u, 0) - (p,q) = (-u - p, -q)
# Vectors _b = (v, 0) - (p,q) = (v - p, -q)
# Vectors _c = (p,q)
# |_a|^2 = (u+p)^2 + q^2 = pp + qq + uu + 2pu = A
# |_b|^2 = (v-p)^2 + q^2 = pp + qq + vv - 2pv = B
# Specific energy of particle is
# K.E. + grav P.E. M + grav P. E. m
# K.E./mass = 0.5* vel^2 = 0.5*(r*w)^2 = 0.5*(ww)*(pp+qq)
# grav/mass = -GM/sqrt(A) - Gm/sqrt(B)
# SE = 0.5*(ww)*(pp+qq) - GM/sqrt(pp + qq + uu + 2pu) - Gm/sqrt(pp + qq + vv - 2
pv)
# SE = 0.5*(G(M+m)/l^3)*(pp+qq) - GM/sqrt(pp + qq + uu + 2pu) - Gm/sqrt(pp + qq
+ vv - 2pv)
# SE/G = 0.5*((M+m)/l^3)*(pp+qq) - M/sqrt(pp + qq + uu + 2pu) - m/sqrt(pp + qq +
vv - 2pv)
# u+v=l; u=kl; v=(1-k)l;p=xl;q=yl
# SE/G = 0.5*((M+m)/l^3)*(xlxl+ylyl) - M/sqrt(xlxl + ylyl + klkl + 2xlkl) - m/sq
rt(xlxl + ylyl + (1-k)l(1-k)l - 2xl(1-k)l)
# SE/G = 0.5*((M+m)/l)*(xx+yy) - M/lsqrt(xx + yy + kk + 2xk) - m/lsqrt(xx + yy +
(1-k)(1-k) - 2x(1-k))
# SE*l/G = 0.5*((M+m))*(xx+yy) - M/sqrt(xx + yy + kk + 2xk) - m/sqrt(xx + yy + (
1-k)(1-k) - 2x(1-k))
# SE*l/GM = 0.5*((1+m/M))*(xx+yy) - 1/sqrt(xx + yy + kk + 2xk) - (m/M)/sqrt(xx +
yy + (1-k)(1-k) - 2x(1-k))
# v/u = M/m = (1-k)/k; m/M = k/(1-k)
# SE*l/GM = 0.5*((1+((k/(1-k))))*(xx+yy) - 1/sqrt(xx + yy + kk + 2xk) - (k/(1-k)
)/sqrt(xx + yy + (1-k)(1-k) - 2x(1-k))
# SE*l/GM = 0.5*((1/(1-k)))*(xx+yy) - 1/sqrt(xx + yy + kk + 2xk) - (k/(1-k))/sqr
t(xx + yy + 1 - 2k + kk - 2x + 2xk)
# SE*l/GM = 0.5*(1/(1-k))*(xx+yy) - 1/sqrt(xx + yy + kk + 2xk) - (k/(1-k))/sqrt(
xx + yy + kk + 2xk + 1 - 2k - 2x)
# put t = m/M
# k = m/(M+m); k = 1/(M/m+1); k/(1-k) = m/M = t
# 1/(1-k) = (M+m)/(M+m-m) = 1 + m/M = 1 + t; k = 1/(1+1/t) = t/(1+t)
# SE*l/GM = 0.5*(1+t)*(xx+yy) - 1/sqrt(xx + yy + tt/(1+t)(1+t) + 2xt/(1+t)) - t/
sqrt(xx + yy + tt/(1+t)(1+t) + 2xt/(1+t) + 1 - 2t/(1+t) - 2x)
# Run gnuplot and type "load 'thisfile'"
# === Pseudo-energy showing Lagrangian points in a 2-body system using centre-of
-mass coordinates ===
# There are 3 forces to consider on a mass P:
ratio=5.0
k=1.0/(ratio+1.0)
se(x,y) = 0.5*(1.0/(1.0-k))*(x*x+y*y) - (1.0/sqrt(x*x + y*y + k*k + 2.0*x*k)) -
((k/(1.0-k))/sqrt(x*x + y*y + k*k + 2.0*x*k + 1.0 - 2.0*k - 2.0*x))
set contour
set cntrparam levels auto 18
set view 70,15
set isosamples 150,150
set samples 300,300
set ticslevel 0
set title 'corotating potential energy in a 2-body system'
unset surface
lo=-3.0
hi=5.0
clamp(x,a,b) = (x<a)?(a):((x>b)?(b):(x))
#splot [-rax(k):rax(k)] [0:ray(k)] [-8:1] min(1,log(mag(x,y)))
lim=1.2
splot [-lim:lim] [-lim:lim] clamp(se(x,y),lo,hi)
pause 0 'This is for a mass ratio of 5.0'
pause 0 'Try "k=<value>", and "replot" for different mass ratios'

Вам также может понравиться