Rasp XP Rocket Altitude Simulation Program for Windows Rasp XP is a Windows program that simulates the flight of a rocket in one dimension (one degree-of-freedom). Outline1. Origin 2. Physics 3. Data Flow 4. Databases 5. DigiTrak 6. Software modules 1. Origin of wRASP The original RASP was a BASIC program written by Harry Stine in 1979 and published in his Handbook of Model Rocketry. DOS RASP was converted to the C programming language by Mark Storin in 1989. New features were added by Kent Hoult in 1990 and Mark Johnson in 1990-94. wRASP is an adaptation of that venerable RASP program for DOS that runs with a typical Windows graphical user interface (GUI). It was first made available to Compuserve’s Sport Rocketry forum in 1995. Rasp XP is a new incarnation of wRASP, which has not has an update since 1998. Rasp XP is rebuilt to run on any Windows system from Windows 95 up. Refinements have been made to file handling, data handling, and calculations. Further improvements will see the use of XML as the preferred data format, additionally output formats, multiple degrees of freedom in analyses, and user interface improvements. Wrasp 2.0 and Rasp XP 3.0 and up includes Larry Curcio's DigiTrak, and is based on his version 5.4. v2.0 also includes the NAR tracking algorithms, also originally available in BASIC.
2. Physics Simulation programs typically define the level of sophistication of the program in “degrees of freedom” (DOF). These define how the airframe behaves in 3 dimensional space. The maximum degrees of freedom is six, three for movement (x,y,z) and three for rotation (roll,pitch,yaw). A full simulation is usually referred to as a “Six-DOF”. The simulation engine in wRASP is “raspsubs.c”, derived directly from the main program in DOS RASP’s “rasp.c”. This engine has always been altitude only (specified as “x”), so they are both One-DOFs. The simulation engine solves the differential equations for velocity and position by resolving the force summation on the rocket. The method is basic numerical methods for integrating acceleration and velocity: a = åF/m (from F=ma) ⌠ v = │a dt = a Δt + v0 ⌡ ⌠ x = │v dt = v Δt + x0 ⌡ where: F = force in newtons m = mass in kilograms a = acceleration in meters/second2 v = velocity in meters/second x = distance in meters dt = differential time in seconds Δt = delta time in seconds = 0.001 second The time step () was originally 0.1 second but was later changed to one millisecond (0.001 second). There are provisions for changing it but they are currently not implemented. The simulation continually calculates these values and monitors for these events: When altitude (x) reaches the top of the launch rod Motor burn-out Apogee Motor delays Ground impact The force summation is the guts of these calculations: åF = (th - drag) where: th = thrust in Newtons drag = drag force in Newtons The thrust is determined by the motor(s)’s thrust-time curve and the time into the burn. The drag is based on: drag = c v2 (a form of ½ ρ v2) where: drag = drag force in Newtons (kg m/sec2) c = drag form factor v = velocity in meters/sec The drag form factor is defined as: c = ½ r π CD d2 / 4 where: c = drag form factor in kilograms/meter r = atmospheric constant in kilograms/meter3 CD = coefficient of drag d = maximum body tube diameter in meters The atmospheric constant is a function of the air density (ρ). The original RASP program used a constant value of: r = 1.205 kg/m3 Rasp XP also allows the use of an atmospheric model to calculate the air density (ρ) at a specific altitude above mean sea level: r = ρ 32.1725 / 2.204623 / 0.028317 where: ρ = air density in slugs/feet3 rest = the constants to convert to kilograms/meter3
Acceleration is then calculated: a = (thrust - drag)/m – G (upward motion) a = drag/m – G (downward motion) where: a = acceleration in meters/second2 th = thrust in Newtons drag = drag force in Newtons m = mass in kilograms G = acceleration of gravity in meters/second2 Mass varies with motor burn and staging. It is assumed that 100% of the propellant weight specified in the motor data file is consumed from the beginning to the end of the motor burn time. This can be done two ways: m = total motor mass – (burn time)/(total burn time)*(propellant mass) m = motor mass – (expended impulse)/(total impulse)*(propellant mass) Rasp XP uses the first method – linear reduction of mass during the burn. The second is probably more accurate – this may be added as an option in the future.
3. Data Flow
4. Databases
rasp.eng – motor data ; semi-colon in the first column followed by text is a comment and is not processed. Type diameter length delays propellant_wt total_wt mfg notes time1 thrust1 time2 thrust2 ... timeN thrustN Internally, prior to wRASP v1.61, each motor was stored in blocks of 64 values – a maximum of 32 time/thrust pairs were allowed. From v1.61 and later, motor data values were stored in a “pool” of 16384 double precision values. There is no maximum for an individual motor. rocket.dat – rocket kit database mfg name [; alias#1] [; alias#2]... weight length diameter max_alt catalog#, motor list (catalog date) price Useful if the data is complete. Many manufacturers do not include a typical rocket empty weight. vendor.dat – manufacturer data abbreviation full_name [; abbrev alias#1][...] The rocket database is only used to browse the kit list. The vendor list is used to identify the manufacturer of a motor or kit.
5. DigiTrak (by Larry Curcio) Special Features: optimal mass calculation CD backtracking (time or altitude based) DOS DigiTrak used a separate program, AIRSTART, to combine the thrust curves of multiple motors. Rasp XP does this automatically and outputs the result in airstrt1.out for stage 1, airstrt2.out for stage 2, and airstrt3.out for stage 3. See the “help” file for additional DigiTrak information and tips on backtracking. Larry’s original discussions from his DigiTrak version are included there. Newton’s method of slope (first derivative) is used to adjust the CD while backtracking. The CD is not allowed to go below 0.015.
6. Software Modules Group | File | function(s) | purpose(s) | General | readme track.bas | - - | Revision history Original tracking BASIC code | Windows | wrasp.def wrasp.rh wrasp.rc wrasp.res wrasp.mak | - - - - - | “.exe” definition file windows resource header windows resource description windows resources (compiled) make file for Borland C/C++ | Help | topics.rtf wrasp.rtf wrasp.hpj wrasp.hlp | - - - - | Help topics (outline) Help body Help project definition file Compiled help file | Main | wrasp.h prowrasp.h rasp.h stats.h wrasp.c raspsubs.c engine.c fltclass.c files.c atmos.c rocket.c vendor.c stage.c | - - - - upd_rkt sortfn init_efile del_efile ld_alpha WinMain Wnd_procM Wnd_proc AboutDlgProc InfoDlgProc calc prt_full prt_summary prt_plot init_engine load_engine fltclass motorclass ld_config sv_config get_ini set_ini powf logf sqrtf atmos rocketdat get_abbrev vendordat init_stage Stage1DlgProc ComplexDlgProc NStageDlgProc | Main header file Function prototypes RASP constants and structures More constants and structures Update rocket data General purpose sort function Initialize and load motor database Delete current motor data in memory Load alpha rocket when motor DB changed Main program Window procedure – motor data window Window procedure Help (About) dialog Help (System Info) dialog Physics routine Print full flight Print summary Output plot file Initialize engine data block Load engine data file Calculate flight class Calculate motor class Load Rasp XP configuration file Save Rasp XP configuration file Get wrasp.ini data values Save wrasp.ini data values Floating point pow() Floating point log() Floating point sqrt() Atmosphere model Load rocket DB file Get vendor abbreviation Load vendor DB file Initialize stage structure Stage data dialog (all stages) Complex Stage dialog General rocket data dialog | Dialogs | browse.c environ.c option.c | BrowseDlgProc EnvDlgProc OptionsDlgProc UpdateDlgProc CalcDlgProc DTDlgProc TrkDlgProc | Rocket database browse dialog Environment dialog Options dialog Graphics update options dialog Calculations dialog DigiTrak options dialog NAR Tracking dialog | DigiTrak | digitrak.h digitrak.c dt_orig.c as_orig.c dt_conv.txt dt_eng.txt | - dt_stage get_mach1 machmaker set_next_values prt_Dtsummary FM_coast_time FM_coast_alt boost coast trajectory optmass newton backtrack digitrak - - - - | DigiTrak header Builds stage motor data (from airstart) Find mach 1 from temperature Calculate mach effects on drag Next value set Print stage summary Backtracking function Backtracking function Boost phase Coast phase Combines boost and coast Optical mass calculations Newton’s method for backtracking Backtracking Top level control Original DigiTrak source Original Airstart source Conversion notes DigiTrak engine data notes | Graphics | wrasp1.c adj.c out_d.c out_i.c out_spc.c out_t.c | wrasp1 motor1 adj adjf out_d* out_I out_spc out_t* | Graphics and printer output Motor data output Screen parameter adjustment Screen parameter adjustment Decimal text output Integer text output Special text output String text output | Support | gp.c Conv.c | getline tluppd tlupf getfn remfn getext remext C_to_F F_to_C | Binary file line input Table look-up, double precision Table look-up, single precision Extract file name from string Remove file name from string Get file extension Remove file extension Covert Celsius to Fahrenheit Convert Fahrenheit to Celsius |
7. Resources The latest versions and source will appear here: http://www.aresinstitute.org General rocketry calculations: http://www.execpc.com/~culp/rockets/rckt_eqn.html http://www.execpc.com/~culp/space/space.html |