Skip to content

Commit

Permalink
LVD: Added total thrust as an LVD graphical analysis task.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arrowstar committed Jan 6, 2019
1 parent 0d6ca41 commit d2fd9e9
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ function clearDuplicateEngineStates(obj)

engineStates(engineStates == engine) = LaunchVehicleEngineState.empty(1,0);
engineStates(end+1) = thisEngineStateToSave; %#ok<AGROW>
elseif(isempty(thisEngineStates))
newEngineState = LaunchVehicleEngineState(stgState);
newEngineState.engine = engine;
engineStates(end+1) = newEngineState; %#ok<AGROW>
end

% notThisEngineStates = engineStates([engineStates.engine] ~= engine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,29 @@

datapt = computeTWRatio(throttle, stateLogEntry.time, stateLogEntry.position, stateLogEntry.velocity, tankMasses, stateLogEntry.getTotalVehicleDryMass(), ...
stateLogEntry.stageStates, stateLogEntry.lvState, tankStates, stateLogEntry.centralBody);
case 'totalthrust'
ut = stateLogEntry.time;
rVect = stateLogEntry.position;
vVect = stateLogEntry.velocity;

bodyInfo = stateLogEntry.centralBody;
tankStates = stateLogEntry.getAllActiveTankStates();
stageStates = stateLogEntry.stageStates;
lvState = stateLogEntry.lvState;

dryMass = stateLogEntry.getTotalVehicleDryMass();
tankStatesMasses = [tankStates.tankMass]';

throttleModel = stateLogEntry.throttleModel;
steeringModel = stateLogEntry.steeringModel;

altitude = norm(rVect) - bodyInfo.radius;
pressure = getPressureAtAltitude(bodyInfo, altitude);

throttle = throttleModel.getThrottleAtTime(ut, rVect, vVect, tankStatesMasses, dryMass, stageStates, lvState, tankStates, bodyInfo);

[~, totalThrust, ~] = LaunchVehicleStateLogEntry.getTankMassFlowRatesDueToEngines(tankStates, tankStatesMasses, stageStates, throttle, lvState, pressure, ut, rVect, vVect, bodyInfo, steeringModel);

datapt = totalThrust;
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
case 'Thrust to Weight Ratio'
depVarValue = lvd_ThrottleTask(subLog(i), 't2w');
depVarUnit = ' ';
case 'Total Thrust'
depVarValue = lvd_ThrottleTask(subLog(i), 'totalthrust');
depVarUnit = 'kN';
otherwise %is a programmatically generated string that we'll handle here
tankMassPattern = 'Tank (\d+?) Mass - ".*"';
stageDryMassPattern = 'Stage (\d+?) Dry Mass - ".*"';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
taskList{end+1} = 'SideSlip Angle';
taskList{end+1} = 'Throttle';
taskList{end+1} = 'Thrust to Weight Ratio';
taskList{end+1} = 'Total Thrust';

[tanksGAStr, ~] = lvdData.launchVehicle.getTanksGraphAnalysisTaskStrs();
taskList = horzcat(taskList, tanksGAStr);
Expand Down
10 changes: 7 additions & 3 deletions kspTOT_MissionArchitect/LaunchVehicleDesigner/ma_LvdMainGUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

% Edit the above text to modify the response to help ma_LvdMainGUI

% Last Modified by GUIDE v2.5 05-Jan-2019 14:08:54
% Last Modified by GUIDE v2.5 05-Jan-2019 14:08:54

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
Expand Down Expand Up @@ -699,7 +699,11 @@ function openMissionPlanMenu_Callback(hObject, eventdata, handles)
startParallelPool(write_to_output_func);
end

runScript(handles, lvdData, 1);
try
runScript(handles, lvdData, 1);
catch

end
lvd_processData(handles);

% if(~strcmpi(maData.settings.gravParamType,options_gravParamType))
Expand Down Expand Up @@ -1494,4 +1498,4 @@ function runScriptMenu_Callback(hObject, eventdata, handles)
lvdData = getappdata(handles.ma_LvdMainGUI,'lvdData');

runScript(handles, lvdData, 1);
lvd_processData(handles);
lvd_processData(handles);
Binary file modified lvdExample_DirectInjectToDuna.mat
Binary file not shown.

0 comments on commit d2fd9e9

Please sign in to comment.