<jupyter_start><jupyter_text>Define required rotation matrices ($\Omega$ rotation about $\mathbf{\hat{e}}_3$, $I$ about $\mathbf{\hat{n}}$ and $\theta$ rotation about $\mathbf{\hat{h}}$)<jupyter_code>rot1 = rotMat(3,O)
rot2 = rotMat(1,I)
rot3 = rotMat(3,w)
pCi = rot3*rot2*rot1
pCi
iCp = pCi.transpose(); iCp<jupyter_output><empty_output><jupyter_text>Orbital Radius<jupyter_code>r_p = Matrix([r*cos(nu),r*sin(nu),0])
r_i = pCi.transpose()*r_p
r_i = simplify(r_i);
r_i
r2 = (r_i/r).subs([(I,I2),(w,w2),(O,O2),(nu,nu2)])
r2
r3 = (r_i/r).subs([(I,I3),(w,w3),(O,O3),(nu,nu3)])
r3
simplify(r2.dot(r3))
simplify(r_i.norm()) #sanity check<jupyter_output><empty_output><jupyter_text>Projected Separation<jupyter_code>svec = Matrix([r_i[0], r_i[1]])
svec
s = simplify(sqrt(svec.transpose().dot(svec)))
s
s = simplify(svec.norm())
s
s.subs(2*nu+2*w,2*th)<jupyter_output><empty_output><jupyter_text>Phase Angle<jupyter_code>beta = simplify(acos(r_i[2]/r)).subs(nu+w,th) #observer looking up along s_3 axis
beta
thval = np.linspace(0,2*np.pi, 100)
betaf = lambdify((I,th),beta)
betaf
import matplotlib.pyplot as plt
plt.figure()
plt.clf()
for j in range(0,100,10):
    plt.plot(thval*180/np.pi,betaf(j*np.pi/180.0,thval)*180/np.pi,label='I = %d$^\circ$'%j)
plt.plot([0,360],[63.3, 63.3],'k--')
plt.legend()
plt.xlabel('$\\theta$ (deg)')
plt.ylabel('$\\beta$ (deg)')
plt.xlim([0,360])
#plt.savefig('beta_plot1.png')<jupyter_output><empty_output><jupyter_text>Orbital Velocity<jupyter_code>v_p = sqrt(mu/(a*(1 - e**2)))*Matrix([-sin(nu),(e+cos(nu)),0])
simplify(v_p)
v_i = pCi.transpose()*v_p
v_i
simplify(v_i[2]) #this is RV
simplify(v_i)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22826086956521738, 'fraction_numerical': 0.043478260869565216, 'mean_word_length': 8.104395604395604, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '149928', 'license': 'MIT', 'n_tokens_mistral': 858, 'n_tokens_neox': 800, 'n_words': 103, 'path': 'Notebooks/Orbits in 3D.ipynb', 'repo_name': 'dsavransky/MAE6720', 'size': '1656'}