Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------INPUT PARAMETERS--------------------------------------
- GM = 3.5316e12 --body's standard gravitational parameter
- startalt= 100000 --burn's start altitude
- endalt = 2875000--butn's end altitude
- elliptictransferalt=8400000 --bi-elliptic transfer burn apoapsis
- -------------CODE FROM BELOW ON-------------------------------------
- hohmannSMA = (startalt+endalt)/2
- ellipticstartSMA = (startalt+elliptictransferalt)/2
- ellipticendSMA=(endalt+elliptictransferalt)/2
- startvel=math.sqrt(GM*((2/startalt)-(1/startalt)))
- hohmannvelpe=math.sqrt(GM*((2/startalt)-(1/hohmannSMA)))
- hohmannvelap=math.sqrt(GM*((2/endalt)-(1/hohmannSMA)))
- endvel=math.sqrt(GM*((2/endalt)-(1/endalt)))
- --print(startvel, hohmannvelpe, hohmannvelap, endvel)
- print("Hohmann transfer burns:",hohmannvelpe-startvel, endvel-hohmannvelap)
- hohmanntotaldv= (hohmannvelpe-startvel)+(endvel-hohmannvelap)
- print("Total delta-v for Hohmann transfer:",hohmanntotaldv)
- ellipticvelstartpe=math.sqrt(GM*((2/startalt)-(1/ellipticstartSMA)))
- ellipticvelstartap=math.sqrt(GM*((2/elliptictransferalt)-(1/ellipticstartSMA)))
- ellipticvelendap=math.sqrt(GM*((2/elliptictransferalt)-(1/ellipticendSMA)))
- ellipticvelendpe=math.sqrt(GM*((2/endalt)-(1/ellipticendSMA)))
- print("Bi-elliptic transfer burns:", ellipticvelstartpe-startvel, ellipticvelendap-ellipticvelstartap, ellipticvelendpe-endvel)
- bielliptictotaldv=(ellipticvelstartpe-startvel)+ (ellipticvelendap-ellipticvelstartap)+(ellipticvelendpe-endvel)
- print("Total delta-v for bi-elliptic transfer:",bielliptictotaldv)
- print("Bi-elliptic transfer requires "..bielliptictotaldv/hohmanntotaldv.."x delta-v compared to a Hohmann transfer with given input parameters.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement