This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER and date in your comment with the same courtesy that I will give you. Aside from your courtesy, your wiki MONIKER and date as a signature and minimal good faith of any internet post are the rules of this TCL-WIKI. Its very hard to reply reasonably without some background of the correspondent on his WIKI bio page. Thanks,gold 12DEC2018
gold Here are some calculations on Ideal Rocket Performance in TCL. The Ideal Rocket Velocity formula treats no atmospheric drag, uses simple assumptions and formulas. As another accuracy issue, the assumption is that rocket cross section equals nozzle throat area and drag calculation area. Reported different velocity estimates in the program involve different assumptions and formulas. Major velocity loss terms from the ideal rocket performance are 1) drag loss, 2) gravity loss, 3) nozzle efficiency and 4) loss to inefficient trajectory path (subset of drag). In the code, subsequent formulas are changed and different assumptions are changed from the original formulas. The mass ratio (MR)in the program here is launch mass over final burnout mass like m0/mf in ideal velocity formula. Other papers invert or define mass ratio as mf/m0.
Alternate Gist. The Ideal Rocket Velocity formula assumes no atmospheric drag and makes simple assumptions and calculations. The formula's accuracy is affected by the assumption that the rocket's cross-sectional area is equal to the nozzle throat area. Different velocity estimates in the program result from different assumptions and formulas. The major velocity loss terms from ideal rocket performance include drag loss, gravity loss, nozzle efficiency, and loss due to inefficient trajectory paths. The mass ratio (MR) in this program is the launch mass divided by the final burnout mass, like m0/mf in the ideal velocity formula. Other papers define mass ratio as mf/m0.
In planning any software, it is advisable to gather a number of testcases to check the results of the program.
| table 1 | printed in | tcl format |
|---|---|---|
| quantity | value | comment, if any |
| testcase number: | 1 | |
| 16840.0 : | initial launch cmass1 kg | |
| 7840.0 : | final mass2, burnout mass2 kg | |
| 225.0 : | Isp, specific impulse, seconds | |
| 30000.0 : | constant thrust, kg*meter/sec*sec | |
| 1.0 : | optional, rocket diameter, meters: | |
| 0.3 : | optional, drag_coefficient, for metric units: | |
| 0.7853981633974483 : | rocket cross_section_area1, meter**2: | |
| 1.7814726840855106 : | initial acceleration, normalized to gravities: | |
| 0.6000000000000001 : | rocket_efficiency (ideal!, careful) , no units : | |
| 1080.7959482657197 : | velocity_if_constant_acceleration (diff. assumptions!, careful) , meters/sec : | |
| 1023.5875746663603 : | velocity_if__gravity_losses (diff. assumptions!, careful) , meters/sec : | |
| 67.50000000000001 : | rocket burn out time, Tf, seconds | |
| theoretical_exhaust_velocity $Isp1 $gravity : | theoretical_exhaust_velocity, meter/sec | |
| 133.33333333333331 : | preliminary mass flow rate, kg/second | |
| 672.3439628961451 : | preliminary average drag loss,abs & assumptions, meters/second | |
| 0.5344418052256532 : | combined propellant mass (O&F) to launch weight , no units | |
| 276948.9250042063 : | ballistic_range meters | |
| 233983.5836999047 : | ballistic_altitude meters | |
| 277.31671332224903 : | ballistic_duration seconds | |
| 2.1479591836734695 : | mass ratio, no units | |
| 1687.4827405588774 : | Ideal Rocket velocity, meters/second |
| table 2 | printed in | tcl format |
|---|---|---|
| quantity | value | comment, if any |
| testcase number: | 2 | |
| 13000.0 : | initial launch cmass1 kg | |
| 6500.0 : | final mass2, burnout mass2 kg | |
| 237.0 : | Isp, specific impulse, seconds | |
| 25000.0 : | constant thrust, kg*meter/sec*sec | |
| 1.0 : | optional, rocket diameter, meters: | |
| 0.3 : | optional, drag_coefficient, for metric units: | |
| 0.7853981633974483 : | rocket cross_section_area1, meter**2: | |
| 1.9230769230769231 : | initial acceleration, normalized to gravities: | |
| 0.52 : | rocket_efficiency (ideal!, careful) , no units : | |
| 1060.2278949910894 : | velocity_if_constant_acceleration (diff. assumptions!, careful) , meters/sec : | |
| 1005.4114415685291 : | velocity_if__gravity_losses (diff. assumptions!, careful) , meters/sec : | |
| 61.620000000000005 : | rocket burn out time, Tf, seconds | |
| theoretical_exhaust_velocity $Isp1 $gravity : | theoretical_exhaust_velocity, meter/sec | |
| 105.48523206751054 : | preliminary mass flow rate, kg/second | |
| 725.1287347541687 : | preliminary average drag loss,abs & assumptions, meters/second | |
| 0.5 : | combined propellant mass (O&F) to launch weight , no units | |
| 252584.46343323274 : | ballistic_range meters | |
| 213398.9793971134 : | ballistic_altitude meters | |
| 264.8375241891135 : | ballistic_duration seconds | |
| 2.0 : | mass ratio, no units | |
| 1611.546400386456 : | Ideal Rocket velocity, meters/second |
| table 3 | printed in | tcl format |
|---|---|---|
| quantity | value | comment, if any |
| testcase number: | 3 | |
| 15000.0 : | initial launch cmass1 kg | |
| 6500.0 : | final mass2, burnout mass2 kg | |
| 281.0 : | Isp, specific impulse, seconds | |
| 25000.0 : | constant thrust, kg*meter/sec*sec | |
| 1.0 : | optional, rocket diameter, meters: | |
| 0.3 : | optional, drag_coefficient, for metric units: | |
| 0.7853981633974483 : | rocket cross_section_area1, meter**2: | |
| 1.6666666666666667 : | initial acceleration, normalized to gravities: | |
| 0.6799999999999999 : | rocket_efficiency (ideal!, careful) , no units : | |
| 1440.756041244792 : | velocity_if_constant_acceleration (diff. assumptions!, careful) , meters/sec : | |
| 1365.6124090436635 : | velocity_if__gravity_losses (diff. assumptions!, careful) , meters/sec : | |
| 95.53999999999999 : | rocket burn out time, Tf, seconds | |
| theoretical_exhaust_velocity $Isp1 $gravity : | theoretical_exhaust_velocity, meter/sec | |
| 88.96797153024912 : | preliminary mass flow rate, kg/second | |
| 1993.7283599257628 : | preliminary average drag loss,abs & assumptions, meters/second | |
| 0.5666666666666667 : | combined propellant mass (O&F) to launch weight , no units | |
| 516823.04258630774 : | ballistic_range meters | |
| 436644.0766693572 : | ballistic_altitude meters | |
| 378.83241868285285 : | ballistic_duration seconds | |
| 2.3076923076923075 : | mass ratio, no units | |
| 2305.209665991667 : | Ideal Rocket velocity, meters/second |
+----------------------------------------------------------------------------------+
| TSIOLKOVSKY IDEAL ROCKET EQUATION (Ideal Rocket Velocity) |
| Assumes: no atmospheric drag, simple geometry, constant gravity |
| Assumption: rocket cross-section area = nozzle throat area |
| |
| V_ideal = g * Isp * ln(m0 / mf) |
| |
| Variables: |
| V_ideal = ideal rocket velocity (meters/second) |
| g = standard gravity = 9.8 m/s^2 |
| Isp = specific impulse (seconds) |
| m0 = initial (launch) mass kg |
| mf = final (burnout) mass kg |
| MR = mass ratio = m0 / mf (launch over burnout) |
| NOTE: some papers invert: MR = mf/m0 |
| |
| TCL proc: |
| proc ideal_rocket_velocity {gravity Isp1 mass1 mass2} { |
| return [expr {$gravity * $Isp1 * log($mass1/$mass2)}] } |
| |
| Related quantities: |
| Ve = g * Isp (theoretical exhaust velocity, m/s) |
| MR = mass1 / mass2 |
| Tf = burn time = ((MR-1)/(acc_0*MR)) * Isp (seconds) |
| acc_0 = thrust / mass1 (initial acceleration, m/s^2) |
| acc_normalized = acc_0 / g (in gravities, g-units) |
+----------------------------------------------------------------------------------++----------------------------------------------------------------------------------+ | FOUR MAJOR VELOCITY LOSS TERMS FROM IDEAL ROCKET PERFORMANCE | | Intention: estimate known velocity losses from ideal velocity | | | | +----+------------------------------+----------------------------------------+ | | | # | loss term | description | | | +----+------------------------------+----------------------------------------+ | | | 1 | drag loss | aerodynamic resistance through | | | | | | atmosphere; dominant at low altitude | | | | 2 | gravity loss | component of gravity opposing thrust | | | | | | during ascent; worst at low accel. | | | | 3 | nozzle efficiency | real nozzle delivers less than ideal | | | | | | due to divergence, friction, chemistry | | | | 4 | trajectory path loss | subset of drag; off-vertical flight | | | | | | path wastes thrust on steering | | | +----+------------------------------+----------------------------------------+ | | | | Gravity loss formula (with burn time): | | V_gravity_loss = g * Tf | | V_with_gravity = g*Isp*ln(m0/mf) - g*Tf | | | | Preliminary average drag loss (order of magnitude, many assumptions): | | prelim_avg_drag = 0.5 * Tf * (1/m0) * (0.5*Cd*A*V^2) | | where Cd = drag coefficient (~0.3), A = cross_section_area, V = V_ideal | | accuracy: +/- ~30 percent, absolute value | +----------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------+ | VELOCITY ESTIMATES: THREE ASSUMPTION SETS | | WARNING: Different cards change initial assumptions. | | Results involve different assumptions. Compare with care. | | | | +----------------------------------+------------------------------------------+ | | | velocity estimate | assumption / formula | | | +----------------------------------+------------------------------------------+ | | | V_ideal | no drag, variable acceleration, | | | | = g*Isp*ln(m0/mf) | ln(mass ratio) weight | | | +----------------------------------+------------------------------------------+ | | | V_gravity_losses | variable acceleration, | | | | = g*Isp*ln(m0/mf) - g*Tf | subtract gravity loss over burn time | | | +----------------------------------+------------------------------------------+ | | | V_constant_acceleration | CHANGED ASSUMPTION: | | | | = g*Isp*(R/(R+1))*ln(m0/mf) | constant acceleration rocket | | | | where R = acc_0/g | uses acc_ratio weight instead | | | +----------------------------------+------------------------------------------+ | | | | Typical relationship (from testcases): | | V_constant_accel ~= V_gravity_losses (within a few percent) | | V_ideal > V_constant_accel > V_gravity_losses | | V_ideal - V_gravity_losses ~= g * Tf (burn time gravity tax) | | | | All three use same Isp and mass ratio inputs. | | Differences arise ONLY from trajectory and acceleration assumptions. | +----------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------+
| ROCKET EFFICIENCY AND BURN TIME FORMULAS |
| |
| Rocket efficiency (normalized): |
| eta = (2*(MR-1)) / (acc_0 * MR) |
| where MR = mass ratio, acc_0 = thrust/mass1 (initial acc., m/s^2) |
| |
| TCL proc: |
| proc rocket_efficiency {mass_ratio acc_0} { |
| return [expr {(2.*($mass_ratio-1.))/($acc_0*$mass_ratio)}] } |
| |
| Burn time Tf (seconds): |
| Tf = ((MR-1) / (acc_0 * MR)) * Isp |
| = eta / 2 * Isp |
| |
| TCL proc: |
| proc time_b {mass_ratio Isp acc_0} { |
| return [expr {(($mass_ratio-1.)/($acc_0*$mass_ratio))*$Isp}] } |
| |
| Preliminary mass flow rate (kg/second): |
| flow_rate = (m0 - mf) / Tf |
| = propellant mass consumed / burn time |
| |
| Combined propellant fraction (O and F, oxidizer + fuel): |
| prop_fraction = (m0 - mf) / m0 = 1 - 1/MR |
+----------------------------------------------------------------------------------++----------------------------------------------------------------------------------+
| BALLISTIC RANGE, ALTITUDE, AND DURATION (45 degree launch angle assumed) |
| Order-of-magnitude estimates after burnout using ideal rocket velocity |
| |
| Ballistic range (horizontal, 45 deg launch, meters): |
| range = V^2 * sin(2*theta) / g |
| at theta = 45 deg: range = V^2 / g (maximum range) |
| |
| TCL proc: |
| proc ballistic_range {gravity v launch_angle} { |
| return [expr {$v*$v*sin($launch_angle)/$gravity}] } |
| set launch_angle [* -1. 45. [degtoradiansconst] 2.] <- note: -90 deg |
| |
| Ballistic altitude (max height, 45 deg, meters): |
| altitude = V^2 * sin^2(theta) / (2*g) |
| at theta = 45 deg: altitude = V^2 / (4*g) |
| |
| TCL proc: |
| proc ballistic_altitude {gravity v launch_angle} { |
| return [expr {($v*$v*sin($launch_angle)*sin($launch_angle))/(2.*$g)}] } |
| |
| Ballistic flight duration (total time of flight, seconds): |
| duration = 2*V*sin(theta) / g |
| at theta = 45 deg: duration = V*sqrt(2) / g |
| |
| TCL proc: |
| proc ballistic_duration {gravity v launch_angle} { |
| return [expr {(2.*$v*sin($launch_angle))/$gravity}] } |
+----------------------------------------------------------------------------------++----------------------------------------------------------------------------------+
| CIRCLE AREA AND DRAG CALCULATION PROCS |
| |
| Cross-section area (circular nozzle throat = rocket cross-section): |
| proc circlearea2 {diameter} { |
| return [expr {0.25*[pi]*($diameter**2)}] } |
| circlearea2 1.0 --> 0.7854 m^2 (1 meter diameter) |
| |
| Preliminary average drag loss (absolute value, +/- 30 percent, m/s): |
| set v $ideal_rocket_velocity1 |
| prelim_avg_drag = 0.5 * Tf * (1/m0) * (0.5 * Cd * A * v * v) |
| where Cd = drag_coefficient (~0.3 metric) |
| A = cross_section_area1 (m^2) |
| v = ideal_rocket_velocity1 (m/s) |
| |
| Notes on drag calculation: |
| drag_coefficient, atmospheric pressure, back pressure, and velocity |
| all vary over time and altitude |
| Calculation is "flakey" -- order-of-magnitude estimate only |
| Actual drag ~= 30% of estimated value for most ascent trajectories |
| |
| Vertical velocity (no drag, preliminary, assumed vertical launch): |
| vert_vel = g*Isp*ln(m0/(m0-dot_m*t)) - g*t |
| where dot_m = mass_fraction_rate * m0 = flow_rate |
| This is the instantaneous vertical velocity at end of burn |
+----------------------------------------------------------------------------------++----------------------------------------------------------------------------------+ | TESTCASE RESULTS SUMMARY (3 testcases) | | | | +-----+----------+----------+-------+---------+-------+------------------------+| | | TC | m0 (kg) | mf (kg) | Isp(s)| thrust | MR | V_ideal (m/s) || | +-----+----------+----------+-------+---------+-------+------------------------+| | | 1 | 16840.0 | 7840.0 | 225.0 | 30000.0 | 2.148 | 1687.48 || | | 2 | 13000.0 | 6500.0 | 237.0 | 25000.0 | 2.000 | 1611.55 || | | 3 | 15000.0 | 6500.0 | 281.0 | 25000.0 | 2.308 | 2305.21 || | +-----+----------+----------+-------+---------+-------+------------------------+| | | | +-----+----------+----------+---------+----------+----------+------------------+| | | TC | V_cst_acc| V_grav | Tf (s) | drag_loss| prop_frac| acc_0 (gravities)|| | +-----+----------+----------+---------+----------+----------+------------------+| | | 1 | 1080.80 | 1023.59 | 67.50 | 672.34 | 0.534 | 1.782 || | | 2 | 1060.23 | 1005.41 | 61.62 | 725.13 | 0.500 | 1.923 || | | 3 | 1440.76 | 1365.61 | 95.54 | 1993.73 | 0.567 | 1.667 || | +-----+----------+----------+---------+----------+----------+------------------+| | | | +-----+------------------+------------------+------------------+ | | | TC | range (m) | altitude (m) | duration (s) | | | +-----+------------------+------------------+------------------+ | | | 1 | 276,948.9 | 233,983.6 | 277.32 | | | | 2 | 252,584.5 | 213,399.0 | 264.84 | | | | 3 | 516,823.0 | 436,644.1 | 378.83 | | | +-----+------------------+------------------+------------------+ | +----------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------+ | MASS RATIO SENSITIVITY AND KEY OBSERVATIONS | | | | Mass ratio (MR) = launch mass / burnout mass = m0 / mf | | (Note: some papers invert definition: MR = mf/m0) | | | | Effect of MR on ideal velocity (fixed Isp = 250 s, g = 9.8): | | +------+----------+--------------------+ | | | MR | ln(MR) | V_ideal (m/s) | | | +------+----------+--------------------+ | | | 1.5 | 0.4055 | 994.3 m/s | | | | 2.0 | 0.6931 | 1698.2 m/s | | | | 2.5 | 0.9163 | 2244.9 m/s | | | | 3.0 | 1.0986 | 2691.6 m/s | | | | 4.0 | 1.3863 | 3396.4 m/s | | | | 5.0 | 1.6094 | 3943.1 m/s | | | +------+----------+--------------------+ | | | | Combined propellant fraction (O and F) = 1 - 1/MR: | | TC1: MR=2.148 --> prop_frac = 0.534 (53.4% of launch mass is propellant)| | TC2: MR=2.000 --> prop_frac = 0.500 (50.0% propellant) | | TC3: MR=2.308 --> prop_frac = 0.567 (56.7% propellant) | | | | Rocket efficiency eta ranges from 0.52 to 0.68 across testcases. | | Higher Isp (TC3: 281 s) yields highest ideal velocity despite similar MR. | +----------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------+
| SPECIFIC IMPULSE (Isp) CONTEXT AND TYPICAL VALUES |
| |
| Isp = thrust / (g * mass_flow_rate) (seconds) |
| = effective exhaust velocity / g |
| Higher Isp = more efficient propellant use |
| |
| Theoretical exhaust velocity: Ve = g * Isp (meters/second) |
| TCL proc: proc theoretical_exhaust_velocity {Isp1 gravity} { |
| return [* $Isp1 $gravity] } |
| |
| Testcase Isp values in context: |
| +---------+---------+---------------------+-------------------------------+ |
| | TC | Isp (s) | Ve = g*Isp (m/s) | propellant type (approx.) | |
| +---------+---------+---------------------+-------------------------------+ |
| | TC 1 | 225 | 2205 m/s | solid propellant range | |
| | TC 2 | 237 | 2323 m/s | solid/storable liquid range | |
| | TC 3 | 281 | 2754 m/s | upper solid / kerosene range | |
| +---------+---------+---------------------+-------------------------------+ |
| | typical | 250-280 | 2450-2744 m/s | solid boosters | |
| | typical | 300-360 | 2940-3528 m/s | kerosene/LOX (Merlin) | |
| | typical | 420-465 | 4116-4557 m/s | LH2/LOX (Shuttle main) | |
| +---------+---------+---------------------+-------------------------------+ |
| |
| Preliminary mass flow rate = (m0 - mf) / Tf (kg/second): |
| TC1: (16840 - 7840) / 67.5 = 133.3 kg/s |
| TC2: (13000 - 6500) / 61.6 = 105.5 kg/s |
| TC3: (15000 - 6500) / 95.5 = 89.0 kg/s |
+----------------------------------------------------------------------------------++----------------------------------------------------------------------------------+ | BALLISTIC TRAJECTORY GEOMETRY (post-burnout, 45 degree launch angle) | | | | * peak altitude | | * * | | * * V^2*sin^2(45)/(2g) | | * * | | launch --> * * <-- impact | | 45 deg 45 deg | | <--------- range = V^2/g ---------> | | | | Duration (45 deg): T = 2*V*sin(45)/g = V*sqrt(2)/g | | Range (45 deg): R = V^2*sin(90)/g = V^2/g (maximum range) | | Altitude (45 deg): H = V^2*sin^2(45)/(2g) = V^2/(4g) | | | | Relationship: H = R/4 (altitude = quarter of range at 45 deg) | | | | Testcase check (TC1, V = 1687.5 m/s, g = 9.8): | | R = 1687.5^2 / 9.8 = 290,668 m (calc gives 276,949 m: 5% diff) | | H = 1687.5^2 / (4*9.8) = 72,667 m (calc gives 233,984 m) | | Note: TCL code uses a launch_angle sign convention that differs from | | standard; final values reflect those code conventions exactly. | +----------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------+ | eTCL SLOT CALCULATOR: GUI LAYOUT | | Window title: "Ideal Rocket Performance Formula Calculator" | | Background: aquamarine4, border brown raised 30 | | | | .frame (left panel, 8 label+entry rows): | | +-----------------------------------------------------------+ | | | initial mass1, kg : [__________] | | | | final mass2, burnout mass, kg : [__________] | | | | Isp, specific impulse, seconds: [__________] | | | | constant thrust, kg*meter/sec*sec: [__________] | | | | optional, rocket diameter, meters: [__________] | | | | optional, drag_coefficient, metric: [__________] | | | | rocket mass ratio, no units: [__________] | | | | Ideal Rocket Velocity, meters per second: [__________] | | | +-----------------------------------------------------------+ | | | | .buttons (right panel): | | +--------------------+ | | | Solve | <-- runs calculate proc | | | clear | <-- clearx: wipes all 8 entries | | | report | <-- reportx: console show, wiki-format table | | | about | <-- tk_messageBox version info | | | exit | | | | Testcase3 | <-- clearx + fillup (15000,6500,225,25000,1,.3,2.3) | | | Testcase2 | <-- clearx + fillup (13000,6500,237,25000,1,.3,2.2) | | | Testcase1 | <-- clearx + fillup (16840,7840,225,30000,1,.3,2.2) | | +--------------------+ | | | | Slots 7 and 8 show: mass_ratio1 and ideal_rocket_velocity1 | | Extra outputs (overflow) go to reportx console table only | +----------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------+
| CALCULATE PROC: FORMULA FLOW (proc calculate {}) |
| |
| Inputs (global side1..side6): |
| side1 = m0 initial launch mass (kg) |
| side2 = mf final burnout mass (kg) |
| side3 = Isp specific impulse (seconds) |
| side4 = thrust constant thrust (kg*m/s^2) |
| side5 = diameter rocket diameter (meters, optional) |
| side6 = Cd drag coefficient (metric, optional) |
| |
| Computed quantities (sequence): |
| cross_section_area1 = circlearea2(diameter) |
| mass_ratio1 = m0 / mf |
| acc_01 = thrust / m0 (initial acc., m/s^2) |
| rocket_efficiency1 = 2*(MR-1)/(acc_0*MR) |
| time_b1 (Tf) = ((MR-1)/(acc_0*MR)) * Isp |
| prelim_flow_rate1 = (m0-mf) / Tf |
| prelim_vertical_vel1 = vertical_velocity_no_drag(g,Tf,Isp,flow,m0) |
| prelim_avg_drag_loss1= 0.5*Tf*(1/m0)*(0.5*Cd*A*V^2) |
| V_gravity_losses1 = g*Isp*ln(m0/mf) - g*Tf |
| acc_ratio = acc_01 * g / g = acc_01 (in g-units) |
| V_constant_accel1 = g*Isp*(R/(R+1))*ln(m0/mf) |
| ideal_rocket_velocity1 = g*Isp*ln(m0/mf) |
| ballistic_range1, altitude1, duration1 = f(V_ideal, g, 45 deg) |
| |
| Outputs written to slots: |
| side7 = mass_ratio1 |
| side8 = ideal_rocket_velocity1 |
| All other outputs --> reportx console table (overflow) |
+----------------------------------------------------------------------------------++----------------------------------------------------------------------------------+
| REPORTX CONSOLE OUTPUT: FULL VARIABLE LIST (proc reportx {}) |
| Console: palegreen bg, fixed 20 bold, orange border, 40x20 |
| Title: "Ideal Rocket Performance Report, cut and paste from console 2" |
| |
| Wiki-format table output (all quantities): |
| +----+------------------------------------------+----------------------------+ |
| | # | variable | units | |
| +----+------------------------------------------+----------------------------+ |
| | 1 | side1 (m0) | kg, initial launch mass | |
| | 2 | side2 (mf) | kg, burnout mass | |
| | 3 | side3 (Isp) | seconds | |
| | 4 | side4 (thrust) | kg*m/s^2 | |
| | 5 | side5 (diameter) | meters | |
| | 6 | side6 (Cd) | drag coeff (metric) | |
| | 7 | cross_section_area1 | m^2 | |
| | 8 | acc_01 (initial acceleration) | gravities | |
| | 9 | rocket_efficiency1 | no units (ideal, careful!) | |
| | 10 | velocity_if_constant_acceleration1 | m/s (diff. assumptions!) | |
| | 11 | velocity_if_gravity_losses1 | m/s (diff. assumptions!) | |
| | 12 | time_b1 (burn time Tf) | seconds | |
| | 13 | theoretical_exhaust_velocity | m/s (token, not computed) | |
| | 14 | prelim_flow_rate1 | kg/second | |
| | 15 | prelim_avg_drag_loss1 | m/s (+/-30%) | |
| | 16 | prelim_vertical_velocity1 | m/s (vert. launch assumed) | |
| | 17 | ballistic_range1 | meters | |
| | 18 | ballistic_altitude1 | meters | |
| | 19 | ballistic_duration1 | seconds | |
| | 20 | side7 = mass_ratio1 | no units | |
| | 21 | side8 = ideal_rocket_velocity1 | m/s | |
| +----+------------------------------------------+----------------------------+ |
+----------------------------------------------------------------------------------++----------------------------------------------------------------------------------+ | VELOCITY LOSS WATERFALL: TESTCASE 1 EXAMPLE | | Illustrates how ideal velocity is reduced by various loss terms | | | | V_ideal 1687.5 m/s (Tsiolkovsky, no losses) | | | subtract gravity loss | | v g * Tf = 9.8 * 67.5 = 661.5 m/s | | V_gravity_losses 1023.6 m/s (after gravity tax) | | | (alternate: constant accel. assumption) | | v acc_ratio weight | | V_constant_accel 1080.8 m/s (different assumption) | | | subtract preliminary drag loss (order of magnitude) | | v prelim_drag = 672.3 m/s | | V_after_drag (rough estimate) ~415.0 m/s (drag-adjusted, rough!) | | | | Note: drag loss of 672 m/s is extremely large for TC1 | | (V_ideal only 1688 m/s). This reflects the simplistic drag formula | | which assumes cross-section = nozzle throat area. | | Actual drag losses for real rockets: ~50-150 m/s for ascent trajectories. | | | | Rocket efficiency (TC1) = 0.60 meaning 60% of ideal is usable | | Rocket efficiency (TC2) = 0.52 meaning 52% of ideal is usable | | Rocket efficiency (TC3) = 0.68 meaning 68% of ideal is usable | +----------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------+
| OVERALL PROGRAM FLOW (Ideal Rocket Performance Calculator, gold 6Sep2018) |
| |
| package require Tk |
| namespace path {::tcl::mathop ::tcl::mathfunc} |
| set gravity 9.8 |
| | |
| v |
| Build .frame (8 label+entry pairs, grid layout) |
| Build .buttons (Solve, clear, report, about, exit, TC3, TC2, TC1) |
| grid .frame .buttons -sticky ns |
| | |
| v |
| User pushes Testcase(N): |
| clearx + fillup (m0, mf, Isp, thrust, diam, Cd, MR_approx, V_approx) |
| | |
| v |
| User edits entries 1-6 (m0, mf, Isp, thrust, diam, Cd) if needed |
| | |
| v |
| User pushes Solve: |
| calculate --> nested procs defined inline then evaluated: |
| circlearea2, ideal_rocket_velocity, mass_ratio, acc_0 |
| rocket_efficiency, theoretical_exhaust_velocity, time_b |
| vertical_velocity_no_drag, velocity_if_gravity_losses |
| velocity_constant_acceleration, ballistic_range/altitude/duration |
| side7 = mass_ratio1, side8 = ideal_rocket_velocity1 |
| | |
| v |
| User pushes report: |
| reportx --> console show (palegreen, orange border) |
| puts wiki-format table: 21 quantities + testcase number |
+----------------------------------------------------------------------------------+ # pretty print from autoindent and ased editor
# Ideal Rocket Performance calculator
# Ideal Rocket Velocity treats no atmospheric drag, uses simple
# assumptions & formulas, other accuracy issues.
# assumption, rocket cross section == nozzle throat area.
# Reported different velocity quantities
# involve different assumptions and formulas.
# Major velocity loss terms are 1) drag loss,
# 2) gravity loss, 3) nozzle efficiency
# and 4) loss to inefficient trajectory path (subset of drag).
# Intention is to estimate various known
# velocity losses from ideal velocity.
# Need to collect some rocket examples in metric units.
# written on Windows XP on TCL
# working under TCL version 8.6
# gold on TCL Club, 6Sep2018
package require Tk
namespace path {::tcl::mathop ::tcl::mathfunc}
frame .frame -relief flat -bg aquamarine4
pack .frame -side top -fill y -anchor center
set names {{} {initial mass1, kg :} }
lappend names {final mass2, burnout mass, kg :}
lappend names {Isp, specific impulse, seconds: }
lappend names {constant thrust, kg*meter/sec*sec:}
lappend names {optional, rocket diameter, meters:}
lappend names {optional, drag_coefficient, for metric units: }
lappend names {rocket mass ratio, no units: }
lappend names {Ideal Rocket Velocity, meters per second:}
foreach i {1 2 3 4 5 6 7 8} {
label .frame.label$i -text [lindex $names $i] -anchor e
entry .frame.entry$i -width 35 -textvariable side$i
grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1 }
proc about {} {
set msg "Calculator for Ideal Rocket Performance
from TCL "
tk_messageBox -title "About" -message $msg }
proc pi {} {expr acos(-1)}
proc degtoradiansconst {} {return [ expr {180./[pi]} ]}
proc radianstodegconst {} {return [ expr {[pi]/180.} ]}
proc calculate { } {
global answer2
global side1 side2 side3 side4 side5
global side6 side7 side8
global mass1 mass2 Isp1 thrust1 acc_ratio
global acc_01 mass_ratio1 time_b1 ideal_rocket_velocity1
global rocket_efficiency1 cross_section_area1
global velocity_if_constant_acceleration1 velocity_if_gravity_losses1
global prelim_flow_rate1 prelim_avg_drag_loss1
global ballistic_range1 ballistic_altitude1 ballistic_duration1
global theoretical_exhaust_velocity1 prelim_vertical_velocity1
global testcase_number
incr testcase_number
set side1 [* $side1 1. ]
set side2 [* $side2 1. ]
set side3 [* $side3 1. ]
set side4 [* $side4 1. ]
set side5 [* $side5 1. ]
set side6 [* $side6 1. ]
set side7 [* $side7 1. ]
set side8 [* $side8 1. ]
set gravity 9.8
set mass1 $side1
set mass2 $side2
set Isp1 $side3
set thrust1 $side4
set diameter1 $side5
set drag_coefficient1 side6
# inital assumption == variable acceleration over rocket burn
proc circlearea2 {diameter} {
return [ expr { 0.25*[pi]*($diameter**2) }]}
proc ideal_rocket_velocity { gravity Isp1 mass1 mass2} {
return [ expr { $gravity*$Isp1*log($mass1/$mass2)}]}
proc mass_ratio {mass1 mass2} {return [ expr { $mass1 / $mass2 }]}
proc acc_0 {thrust mass1} { return [ expr { ($thrust*1.) / $mass1 }]}
proc rocket_efficiency {mass_ratio acc_0} {
return [expr {(2.*($mass_ratio-1.))/($acc_0*$mass_ratio*1.)}]}
proc theoretical_exhaust_velocity { Isp1 gravity} {
return [* $Isp1 $gravity ] }
proc time_b {mass_ratio Isp acc_0} {
return [expr {(($mass_ratio-1.)/($acc_0*$mass_ratio*1.))*$Isp}]}
set ideal_rocket_velocity1 [ ideal_rocket_velocity $gravity $Isp1 $mass1 $mass2 ]
set cross_section_area1 [ circlearea2 $diameter1 ]
set mass_ratio1 [ mass_ratio $mass1 $mass2 ]
set acc_01 [ acc_0 $thrust1 $mass1 ]
set rocket_efficiency1 [ rocket_efficiency $mass_ratio1 $acc_01 ]
set theoretical_exhaust_velocity1 { theoretical_exhaust_velocity $Isp1 $gravity }
set time_b1 [ time_b $mass_ratio1 $Isp1 $acc_01 ]
set prelim_flow_rate1 [/ [- $mass1 $mass2] $time_b1 ]
# preliminary >> ideal<<< altitude of
# assumed vertical launch over burntime,
# no cross winds & no drag, order of magnitude calc.
# & many assumptions, altiude in abs meters
# assumed constant mass fraction rate expelled,
# val < flow_rate1 / $mass1 > = fraction/sec
proc vertical_velocity_no_drag { gravity time_b1 Isp1 prelim_flow_rate1 mass1 } {
set time $time_b1
set mass_fraction_rate [/ $prelim_flow_rate1 $mass1 ]
set quantity [ expr { $mass1 / ($mass1-$mass1*$mass_fraction_rate*$time)}]
puts " testing $mass1 $mass_fraction_rate $time "
set vert_velocity1 1
set vert_velocity1 [ expr { ($gravity*$Isp1*log($quantity)) - ($gravity*$time) }]
return $vert_velocity1}
set prelim_vertical_velocity1 1
set prelim_vertical_velocity1 [ vertical_velocity_no_drag $gravity $time_b1 $Isp1 $prelim_flow_rate1 $mass1 ]
# avg_drag_loss is flakey here,
# drag_c, combo rel. atmo. pressure,
# back_pressure, and velocity vary over time.
# average drag in order of magnitude,
# in absolute value, m/s velocity +- 30 percent
# preliminary average drag loss over burntime,
# absolute value & many assumptions, meters/second
set v $ideal_rocket_velocity1
set prelim_avg_drag_loss1 [* .5 $time_b1 [/ 1. $mass1 ] [* .5 .3 $cross_section_area1 $v $v ]]
proc velocity_if_gravity_losses { gravity time_b1 Isp1 mass1 mass2} {
return [ expr { (9.8*$Isp1*log($mass1/$mass2)) - $gravity*$time_b1 }]}
set velocity_if_gravity_losses1 [ velocity_if_gravity_losses $gravity $time_b1 $Isp1 $mass1 $mass2 ]
# >>>>> WARNING!!!! CHANGING ASSUMPTIONS HERE <<<<<<<
# following cards change initial assumption ( acc. variable)
# to constant acceleration rocket.
# c. acc. rocket. has different velocity profile.
# uses ratio of initial acceleration over gravity (9.8 m/s*s)
set acc_ratio [/ [* $acc_01 $gravity] $gravity ]
proc velocity_constant_acceleration {acc_ratio Isp1 mass1 mass2} {
return [ expr { 9.8*$Isp1*($acc_ratio/($acc_ratio+1.))*log($mass1/$mass2)}]}
set velocity_if_constant_acceleration1 [ velocity_constant_acceleration $acc_ratio $Isp1 $mass1 $mass2 ]
set v $ideal_rocket_velocity1
set launch_angle [* -1. 45. [degtoradiansconst ] 2.]
proc ballistic_range { gravity v launch_angle} {return [ expr { $v*$v*sin($launch_angle)/$gravity }]}
set ballistic_range1 [ ballistic_range $gravity $v $launch_angle ]
set launch_angle [* 45. [degtoradiansconst ] ]
proc ballistic_altitude { gravity v launch_angle} {return [ expr { ($v*$v*sin($launch_angle)*sin($launch_angle))/(2.*$gravity) }]}
set ballistic_altitude1 [ ballistic_range $gravity $v $launch_angle ]
proc ballistic_duration { gravity v launch_angle} {return [ expr { (2.*$v*sin($launch_angle))/$gravity }]}
set ballistic_duration1 [ ballistic_duration $gravity $v $launch_angle ]
# Running out of slots on screen, send other results to reportx proc
set side7 $mass_ratio1
set side8 $ideal_rocket_velocity1
}
proc fillup {aa bb cc dd ee ff gg hh} {
.frame.entry1 insert 0 "$aa"
.frame.entry2 insert 0 "$bb"
.frame.entry3 insert 0 "$cc"
.frame.entry4 insert 0 "$dd"
.frame.entry5 insert 0 "$ee"
.frame.entry6 insert 0 "$ff"
.frame.entry7 insert 0 "$gg"
.frame.entry8 insert 0 "$hh"
}
proc clearx {} {
foreach i {1 2 3 4 5 6 7 8 } {
.frame.entry$i delete 0 end } }
proc reportx {} {
global side1 side2 side3 side4 side5
global side6 side7 side8
global mass1 mass2 Isp1 thrust1 acc_ratio
global acc_01 mass_ratio1 time_b1 ideal_rocket_velocity1
global rocket_efficiency1 cross_section_area1
global velocity_if_constant_acceleration1 velocity_if_gravity_losses1
global prelim_flow_rate1 prelim_avg_drag_loss1
global theoretical_exhaust_velocity1 prelim_vertical_velocity1
global ballistic_range1 ballistic_altitude1 ballistic_duration1
global testcase_number
console eval {.console config -bg palegreen}
console eval {.console config -font {fixed 20 bold}}
console eval {wm geometry . 40x20}
console eval {wm title . "Ideal Rocket Performance Report, cut and paste from console 2"}
console eval {. configure -background orange -highlightcolor brown -relief raised -border 30}
console show;
puts "%|table $testcase_number|printed in| tcl format|% "
puts "&| quantity| value| comment, if any|& "
puts "&| testcase number:|$testcase_number | |&"
puts "&| $side1 :|initial launch cmass1 kg | |&"
puts "&| $side2 :|final mass2, burnout mass2 kg | |& "
puts "&| $side3 :|Isp, specific impulse, seconds| |& "
puts "&| $side4 :|constant thrust, kg*meter/sec*sec| |&"
puts "&| $side5 :|optional, rocket diameter, meters: | |&"
puts "&| $side6 :|optional, drag_coefficient, for metric units: | |&"
puts "&| $cross_section_area1 :|rocket cross_section_area1, meter**2: | |&"
puts "&| $acc_01 :|initial acceleration, normalized to gravities: | |&"
puts "&| $rocket_efficiency1 :|rocket_efficiency (ideal!, careful) , no units : | |&"
puts "&| $velocity_if_constant_acceleration1 :|velocity_if_constant_acceleration (diff. assumptions!, careful) , meters/sec : | |&"
puts "&| $velocity_if_gravity_losses1 :|velocity_if__gravity_losses (diff. assumptions!, careful) , meters/sec : | |&"
puts "&| $time_b1 :|rocket burn out time, Tf, seconds | |&"
puts "&| $theoretical_exhaust_velocity1 :|theoretical_exhaust_velocity, meter/sec | |&"
puts "&| $prelim_flow_rate1 :|preliminary mass flow rate, kg/second | |&"
puts "&| $prelim_avg_drag_loss1 :|preliminary average drag loss,abs & assumptions, meters/second | |&"
puts "&| $prelim_vertical_velocity1 :|preliminary vertical velocity,assumed vertical launch, meters/second | |&"
puts "&| $ballistic_range1 :|ballistic_range meters | |&"
puts "&| $ballistic_altitude1 :|ballistic_altitude meters | |&"
puts "&| $ballistic_duration1 :|ballistic_duration seconds | |&"
puts "&| $side7 :|mass ratio, no units | |&"
puts "&| $side8 :|Ideal Rocket velocity, meters/second| |&"
puts "testing $side1 $side2 $side3 $side4 $side5 $side6 $side7 $side8"
puts "testing $Isp1 [expr ($acc_ratio/($acc_ratio+1.))] $acc_ratio $acc_01 $mass1 $mass2 "
}
frame .buttons -bg aquamarine4
::ttk::button .calculator -text "Solve" -command { calculate }
::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 16840. 7840. 225. 30000.0 1.0 0.3 2.2 1680.0}
::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 13000. 6500. 237. 25000.0 1.0 0.3 2.2 1614.0}
::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 15000. 6500. 225. 25000.0 1.0 0.3 2.3 1850.0}
::ttk::button .clearallx -text clear -command {clearx }
::ttk::button .about -text about -command about
::ttk::button .cons -text report -command { reportx }
::ttk::button .exit -text exit -command {exit}
pack .calculator -in .buttons -side top -padx 10 -pady 5
pack .clearallx .cons .about .exit .test4 .test3 .test2 -side bottom -in .buttons
grid .frame .buttons -sticky ns -pady {0 10}
. configure -background aquamarine4 -highlightcolor brown -relief raised -border 30
wm title . "Ideal Rocket Performance Formula Calculator"
# This code is copyrighted same as TCL version 8.6
# 6sep2018 copyrighted under and same as TCL license.
# Editorial rights and disclaimers
# are reserved under TCL license.
# Gold on TCL club, 6Sep2018 For the push buttons, the recommended procedure is push testcase and fill frame, change first three entries etc, push solve, and then push report. Report allows copy and paste from console. For testcases in a computer session, the eTCL calculator increments a new testcase number internally, eg. TC(1), TC(2) , TC(3) , TC(N). The testcase number is internal to the calculator and will not be printed until the report button is pushed for the current result numbers. The current result numbers will be cleared either on the next clear button or on the next solve button.
Please place any comments here, Thanks, gold 12DEC2018
gold 9/27/2021. Switched some comment signs ;# to #. This a big file. Check earlier editions, if not compatible. Maybe obvious, but this page was written on Windows10 Tcl ports including ActiveTCL. I assume that the reader can cut and paste on screen, what the reader needs, and tootle on to his own project and own contribution pages to the TCL Wiki.
| Category Numerical Analysis | Category Toys | Category Calculator | Category Mathematics | Category Example | Toys and Games | Category Games | Category Application | Category GUI |