Based on the original Rocket Workbench on SourceForge in CVS at: https://sourceforge.net/projects/rocketworkbench
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
413 B

  1. function rho = density(y)
  2. P0 = 1.013e5; # standard stmospheric pressure
  3. Ma = 0.0289644; # atmosphere molar mass
  4. Rg = 8.3145; # perfect gas constant
  5. T = 273.15; # standard temperature
  6. G = 6.67259e-11; # gravitational constant
  7. Mt = 5.98e24; # earth mass
  8. Rt = 6370000; # earth radius
  9. rho = (P0*Ma/(Rg*T))*exp( ((Ma*G*Mt)/(Rg*T))*((1/(Rt+y))-(1/Rt)) );
  10. endfunction