SharedClass ID 11180 | 419403.sagewsOpen in CoCalc





































n






n
c
#KNOWNS:
KEi_He = 8.0*10**(-13)
m_He = 6.68*10**(-27)
v_He = sqrt(2*KEi_He/m_He)
r = 197.0/4.0 #ratio of masses
m_Au = r*m_He

#define the unknown variables:
vf_He_x, vf_He_y, vf_Au_x, vf_Au_y = var('vf_He_x vf_He_y vf_Au_x vf_Au_y')

#define equations
eq1 = v_He == vf_He_x + r*vf_Au_x #conservation of ____
eq2 = 0 == vf_He_y + r*vf_Au_y #conservation of ____5aa
eq3 = v_He**2 == vf_He_x**2 + vf_He_y**2 + r*(vf_Au_x**2 + vf_Au_y**2)
eq4 = vf_He_y == -sqrt(3)*vf_He_x

sols = solve([eq1,eq2,eq3,eq4],vf_He_x,vf_He_y,vf_Au_x,vf_Au_y,solution_dict=True)

# print sols

print "vf_He_x = ", vf_He_x.subs(sols[1]).n(30)
print 'vf_He_y = ', vf_He_y.subs(sols[1]).n(30)
print 'vf_Au_x = ', vf_Au_x.subs(sols[1]).n(30)
print 'vf_Au_y = ', vf_Au_y.subs(sols[1]).n(30)
print 'theta = ', 180*arctan(vf_Au_y.subs(sols[1]).n(30)/vf_Au_x.subs(sols[1]).n(30))/pi.n(30)

print " "

print "vf_He_x = ", vf_He_x.subs(sols[0]).n(30)
print 'vf_He_y = ', vf_He_y.subs(sols[0]).n(30)
print 'vf_Au_x = ', vf_Au_x.subs(sols[0]).n(30)
print 'vf_Au_y = ', vf_Au_y.subs(sols[0]).n(30)
print 'theta = ', 180*arctan(vf_Au_y.subs(sols[0]).n(30)/vf_Au_x.subs(sols[0]).n(30))/3.14159
vf_He_x = 7.6600623e6 vf_He_y = -1.3267617e7 vf_Au_x = 158708.68 vf_Au_y = 269393.24 theta = 59.496222 vf_He_x = -7.5060677e6 vf_He_y = 1.3000891e7 vf_Au_x = 466650.40 vf_Au_y = -263977.47 theta = -29.496247