[ create a new paste ] login | about

Link: http://codepad.org/QKTsjIGe    [ raw code | output | fork ]

Ruby, pasted on Jun 24:
include Math

m_start = 10000.0
v_start = 371e3
v_exh = 18e3
m_prop = 540.0

m_end = m_start - m_prop

delta_v = v_exh*log(m_start/m_end)
v_end = v_start + delta_v

# Note simplification here: the propellant ends up with a range of velocities spread across ~1 km/s.
# Take the midpoint of the range, which is not exactly correct, but close.
v_prop_end = v_start - v_exh + 0.5*delta_v

ke_start = 0.5*m_start*v_start**2/1e9
ke_end = 0.5*m_end*v_end**2/1e9
ke_prop_end = 0.5*m_prop*v_prop_end**2/1e9

puts
puts "v_start: #{v_start}"
puts "v_end: #{v_end}"
puts "ke_start: #{ke_start}"
puts "ke_end: #{ke_end}"
puts "ke_prop_end: #{ke_prop_end}"
puts "difference: #{ke_end + ke_prop_end - ke_start}"

e_engine = 0.5*m_prop*v_exh**2/1e9
puts "e_engine: #{e_engine}"


Output:
1
2
3
4
5
6
7
8

v_start: 371000.0
v_end: 371999.228778745
ke_start: 688205.0
ke_end: 654553.605982669
ke_prop_end: 33739.7338908274
difference: 88.3398734966759
e_engine: 87.48


Create a new paste based on this one


Comments: