A.3.5 Simulator User Guidepg. #

A.3.5: Simulator Config File User Guide

In order to effectively analyze a launch vehicle a full six degree of freedom simulation should be run to prove the vehicle’s capabilities. To use the simulator configuring 4 files correctly is necessary. Each Section will explain the user defined variables in each file and how they are defined.

Index:

Config_Main_2_02.m / Page #
Config_Stage_11.m / Page #
Config_Stage_12.m / Page #
Config_Stage_13.m / Page #
Simulate_Launch.m / Page #
Monte_Carlo.m / Page #

A.3.5.1:Config_Main_2_02.m

This file is the file that needs to be run to run a single case of the simulation. This file is setup to produce several plots useful to the user in visualizing the results of the simulation, including final orbit. The values the user needs to define in this code are as follows:

Variable Name / Units / Description
mp11 / kg / Propellant mass in the first stage
mi11 / kg / Inert mass of the first stage
mp22 / kg / Propellant mass in the second stage
mi22 / kg / Inert mass in the second stage
mp33 / kg / Propellant mass in the third stage
Mpay / kg / Mass of the payload
Mfair / kg / Mass of the Nose cone (we need to know this because it is eventually rejected)
sig_permi / % / Standard deviation of the inert mass for all stages, this number is a percentage of the total inert mass.
sig_permp1 / % / Standard deviation of the propellant mass for the first stage, this number is a percentage of the total inert mass.
sig_permp2 / % / Standard deviation of the propellant mass for the second and third stage, in our rocket both use a solid propellant so we defined one variable.
aa1 / -- / ‘a’ coefficient for the nominal steering law for the first stage, this number should be provided by the trajectory code.
aa2 / -- / ‘a’ coefficient for the nominal steering law for the first stage, this number should be provided by the trajectory code.
aa3 / -- / ‘a’ coefficient for the nominal steering law for the third stage, this number should be provided by the trajectory code.
bb1 / -- / ‘b’ coefficient for the nominal steering law for the first stage, this number should be provided by the trajectory code.
bb2 / -- / ‘b’ coefficient for the nominal steering law for the second stage, this number should be provided by the trajectory code.
bb3 / -- / ‘b’ coefficient for the nominal steering law for the third stage, this number should be provided by the trajectory code.
tspline1 / Sec / There are three sections of the steering law spline, the first section is valid until this time
tspline2 / Sec / There are three sections of the steering law spline, the first section is valid while
tspline1 < t < tspline2
tspline3 / Sec / There are three sections of the steering law spline, the first section is valid while
tspline2 < t < tspline3
alpha(i) / Radians / The steering law spline, there are three sections of this in a for loop. The equation for the spline should be copied in using extremely high significant digits (we used 24 significant digits).

A.3.5.2: Config_Stage_11.m:

This file is called by the main code to configure the first stage of the launch vehicle. The user inputted values are also manipulated in this file so that they are correct for the simulink script. The values the user needs to define in this code are as follows:

Variable Name / Units / Description
Sig_wind / % / This is the standard deviation for the wind. This is a percentage of the windspeed.
Sigmdot / % / This is the standard deviation of the mass flow rate for the first stage. This value is a percentage of the total mass flow rate
Wind_dr / radians / Direction of the wind clockwise from north
Wind_Flag / -- / Set to 1 to use wind model. Set to 0 to turn off wind
Grav_flag / -- / Set to 1 to use gravity model. Set to 0 to turn off gravity. (Since the earth has gravity this should ALWAYS be set to 1)
P1 / -- / Control Matrix
MU_E / deg / Latitude of launch position
L_E / deg / Longitude of launch position
H_E / m / Height of launch position
Tdrift / sec / If you want the rocket to drop for a certain amount of time before launch this is the amount of time the rocket will wait before the engine starts.
U / m/s / Velocity in body X direction at launch in ECI
V / m/s / Velocity in body Y direction at launch in ECI. We set this to -411 in our case because that is our earth help velocity
W / m/s / Velocity in body Z direction at launch in ECI
Xi / radians / Initial Steer Angle
Psi / radians / Initial Pointing Angle
Eta / radians / Initial Roll Angle
Xidot_0 / rad/s / Initial Steer Angle Rate
Psidot_0 / rad/s / Initial Pointing Angle Rate
Etadot_0 / rad/s / Initial Roll Angle Rate
Len1 / m / Length of first stage
Len2 / m / Length of second stage
Len3 / m / Length of third stage
D1 / m / Diameter of first stage
D2 / m / Diameter of second stage
D3 / m / Diameter of third stage
Cg_Full / m / Vector from tip of nose cone to Cg at full weight. This is in body fixed coordinates of form [X Y Z]
Cg_Empty / m / Vector from tip of nose cone to Cg at burnout weight. This is in body fixed coordinates of form [X Y Z]
Thrust / N / Thrust of engine at OPTIMAL expansion
Ae / m2 / Exit Area of Nozzle
Pe / Pa / Exit Pressure of Nozzle
Dmdt / kg/s / Mass flow rate of engine. This value should be POSITIVE
Max_Thrust_Vector_Angle / rad / Maximum thrust vector deflection angle. This value should be POSITIVE
I_full / kg*m2 / Inertia matrix of the vehicle at launch.
I_empty / kg*m2 / Inertia matrix of the vehicle at first stage.

A.3.5.2: Config_Stage_12.m:

This file is called by the main code to configure the second stage of the launch vehicle. The user inputted values are also manipulated in this file so that they are correct for the simulink script. The values the user needs to define in this code are as follows:

Variable Name / Units / Description
Sig_wind / % / This is the standard deviation for the wind. This is a percentage of the windspeed.
Sigmdot / % / This is the standard deviation of the mass flow rate for the first stage. This value is a percentage of the total mass flow rate
Wind_dr / radians / Direction of the wind clockwise from north
Wind_Flag / -- / Set to 1 to use wind model. Set to 0 to turn off wind
Grav_flag / -- / Set to 1 to use gravity model. Set to 0 to turn off gravity. (Since the earth has gravity this should ALWAYS be set to 1)
P1 / -- / Control Matrix
Tdrift / sec / If you want the rocket to drop for a certain amount of time before launch this is the amount of time the rocket will wait before the engine starts.
Cg_Full / m / Vector from tip of nose cone to Cg after first stage separation. This is in body fixed coordinates of form [X Y Z]
Cg_Empty / m / Vector from tip of nose cone to Cg at burnout weight of second stage. This is in body fixed coordinates of form [X Y Z]
Thrust / N / Thrust of engine at OPTIMAL expansion
Ae / m2 / Exit Area of Nozzle
Pe / Pa / Exit Pressure of Nozzle
Dmdt / kg/s / Mass flow rate of engine. This value should be POSITIVE
Max_Thrust_Vector_Angle / rad / Maximum thrust vector deflection angle. This value should be POSITIVE
I_full / kg*m2 / Inertia matrix of the vehicle after first stage seperation.
I_empty / kg*m2 / Inertia matrix of the vehicle at second stage burn out.

A.3.5.2: Config_Stage_13.m:

This file is called by the main code to configure the third stage of the launch vehicle. The user inputted values are also manipulated in this file so that they are correct for the simulink script. The values the user needs to define in this code are as follows:

Variable Name / Units / Description
Sig_wind / % / This is the standard deviation for the wind. This is a percentage of the windspeed.
Sigmdot / % / This is the standard deviation of the mass flow rate for the first stage. This value is a percentage of the total mass flow rate
Wind_dr / radians / Direction of the wind clockwise from north
Wind_Flag / -- / Set to 1 to use wind model. Set to 0 to turn off wind
Grav_flag / -- / Set to 1 to use gravity model. Set to 0 to turn off gravity. (Since the earth has gravity this should ALWAYS be set to 1)
P1 / -- / Control Matrix
Tdrift / sec / If you want the rocket to drop for a certain amount of time before launch this is the amount of time the rocket will wait before the engine starts.
Cg_Full / m / Vector from tip of nose cone to Cg after second stage separation. This is in body fixed coordinates of form [X Y Z]
Cg_Empty / m / Vector from tip of nose cone to Cg at burnout weight of third stage. This is in body fixed coordinates of form [X Y Z]
Thrust / N / Thrust of engine at OPTIMAL expansion
Ae / m2 / Exit Area of Nozzle
Pe / Pa / Exit Pressure of Nozzle
Dmdt / kg/s / Mass flow rate of engine. This value should be POSITIVE
Max_Thrust_Vector_Angle / rad / Maximum thrust vector deflection angle. This value should be POSITIVE
I_full / kg*m2 / Inertia matrix of the vehicle after third stage seperation.
I_empty / kg*m2 / Inertia matrix of the vehicle at third stage burn out.

A.3.5.4: Simulate_Launch.m

This is a copy of Config_Main_2_02.m setup for use in a Monte Carlo simulation. No plots are output by this program. Please reference Section A.3.5.2 for the user defined values.

A.3.5.5: Monte_Carlo.m

This code runs a input number of simulations and outputs the varied inputs and the achieved periapsis and eccentricity for each case.

Variable Name / Units / Description
R_desired / km / Altitude of desired Periapsis
Num_sims / -- / Number of total simulations

The output file results.txt is also generated by this code. The results are formatted as follows with one case on each line:

Periapsis Eccentricity Isp1 Isp2 Isp3 mi1 mi2 mi3 mp1 mp2 mp3

Note: We output Isp instead of mass flow rate because they are directly related and Isp is a better thrust efficiency parameter than mass flow.

Author: Michael Walker