Skip to content

Commit

Permalink
LVD:
Browse files Browse the repository at this point in the history
1) Added an initial implementation of Graphical Analysis for LVD.
2) Cleaned up a few files with incorrect header comments here and there.
  • Loading branch information
Arrowstar committed Oct 18, 2018
1 parent 7739f04 commit 4139139
Show file tree
Hide file tree
Showing 18 changed files with 1,308 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,4 @@
depVarValue = ma_OutboundHyperVelVectTask(subLog(i,:), 'mag', celBodyData);
depVarUnit = 'km/s';
end
end

end
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,4 @@
taskList{end+1} = 'Hyperbolic Velocity Magnitude';

taskList = setdiff(taskList,excludeList);
end

end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function datapt = ma_TimeTask(stateLogEntry, subTask, celBodyData)
%ma_GAVectorElementsTask Summary of this function goes here
%ma_TimeTask Summary of this function goes here
% Detailed explanation goes here

switch subTask
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function substituteDefaultPropNamesWithCustomNamesInDepVarListbox(hDepVarListbox, maData)
function substituteDefaultPropNamesWithCustomNamesInDepVarListbox(hDepVarListbox, propNames)
vars = get(hDepVarListbox,'String');
propNames = maData.spacecraft.propellant.names;
% propNames = maData.spacecraft.propellant.names;
defaultNames = {'Liquid Fuel/Ox Mass','Monopropellant Mass','Xenon Mass'};

for(i=1:length(vars)) %#ok<*NO4LP>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
end
end

methods
methods
function initialState = get.initialState(obj)
initialState = obj.initStateModel.getInitialStateLogEntry();
end
Expand All @@ -52,7 +52,7 @@
end
end

methods(Static)
methods(Static)
function lvdData = getEmptyLvdData()
lvdData = LvdData();
lvdData.ksptotVer = getKSPTOTVersionNumStr();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
lvdData LvdData
end

properties(Access=private)
properties%(Access=private)
simDriver LaunchVehicleSimulationDriver
end

Expand Down Expand Up @@ -170,12 +170,15 @@ function moveEvtAtIndexUp(obj, ind)
% figure(123);
% subplot(3,1,1)
% plot(time,totalMass);
% grid on;
%
% subplot(3,1,2)
% plot(time,pitchActual);
% grid on;
%
% subplot(3,1,3)
% plot(time,angOfAttackActual);
% grid on;
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
bodyZ = obj.dcm(:,3);

[rollAngle, pitchAngle, yawAngle] = computeEulerAnglesFromInertialBodyAxes(ut, rVect, vVect, bodyInfo, bodyX, bodyY, bodyZ);
rollAngle = AngleZero2Pi(rollAngle);
yawAngle = AngleZero2Pi(yawAngle);
end

function [bankAng,angOfAttack,angOfSideslip] = getAeroAngles(obj, rVect, vVect)
Expand All @@ -25,6 +27,8 @@
bodyZ = obj.dcm(:,3);

[bankAng,angOfAttack,angOfSideslip] = computeAeroAnglesFromBodyAxes(rVect, vVect, bodyX, bodyY, bodyZ);
bankAng = AngleZero2Pi(bankAng);
angOfSideslip = AngleZero2Pi(angOfSideslip);
end

function newAttState = deepCopy(obj)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ function clearStateLog(obj)
subStateLog = obj.entries([obj.entries.event] == event);
stateLogEntry = subStateLog(end);
end

function subLog = getStateLogEntriesBetweenTimes(obj, t1, t2)
subLog = obj.entries([obj.entries.time] >= t1 & [obj.entries.time] <= t2);
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function datapt = lvd_SteeringAngleTask(stateLogEntry, subTask)
%lvd_SteeringAngleTask Summary of this function goes here
% Detailed explanation goes here

ut = stateLogEntry.time;
rVect = stateLogEntry.position;
vVect = stateLogEntry.velocity;
bodyInfo = stateLogEntry.centralBody;

[rollAngle, pitchAngle, yawAngle] = stateLogEntry.attitude.getEulerAngles(ut, rVect, vVect, bodyInfo);
[bankAng,angOfAttack,angOfSideslip] = stateLogEntry.attitude.getAeroAngles(rVect, vVect);

switch subTask
case 'roll'
datapt = rad2deg(rollAngle);
case 'pitch'
datapt = rad2deg(pitchAngle);
case 'yaw'
datapt = rad2deg(yawAngle);
case 'bank'
datapt = rad2deg(bankAng);
case 'angleOfAttack'
datapt = rad2deg(angOfAttack);
case 'sideslip'
datapt = rad2deg(angOfSideslip);

end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
function [depVarValue, depVarUnit, taskStr, refBodyInfo] = lvd_getDepVarValueUnit(i, subLog, taskStr, refBodyId, celBodyData, onlyReturnTaskStr)
%lvd_getDepVarValueUnit Summary of this function goes here
% Detailed explanation goes here

if(~isempty(refBodyId))
refBodyInfo = getBodyInfoByNumber(refBodyId, celBodyData);
else
refBodyInfo = [];
end

% if(~isempty(oscId))
% otherSC = getOtherSCInfoByID(maData, oscId);
% else
% otherSC = [];
% end
%
% if(~isempty(stnId))
% station = getStationInfoByID(maData, stnId);
% else
% station = [];
% end

if(onlyReturnTaskStr == true)
depVarValue = NaN;
depVarUnit = NaN;

return;
end

switch taskStr
case 'Yaw Angle'
depVarValue = lvd_SteeringAngleTask(subLog(i), 'yaw');
depVarUnit = 'deg';
case 'Pitch Angle'
depVarValue = lvd_SteeringAngleTask(subLog(i), 'pitch');
depVarUnit = 'deg';
case 'Roll Angle'
depVarValue = lvd_SteeringAngleTask(subLog(i), 'roll');
depVarUnit = 'deg';
case 'Bank Angle'
depVarValue = lvd_SteeringAngleTask(subLog(i), 'bank');
depVarUnit = 'deg';
case 'Angle of Attack'
depVarValue = lvd_SteeringAngleTask(subLog(i), 'angleOfAttack');
depVarUnit = 'deg';
case 'SideSlip Angle'
depVarValue = lvd_SteeringAngleTask(subLog(i), 'sideslip');
depVarUnit = 'deg';
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function [taskList] = lvd_getGraphAnalysisTaskList(excludeList)
%ma_getGraphAnalysisTaskList Summary of this function goes here
% Detailed explanation goes here
taskList = ma_getGraphAnalysisTaskList(excludeList);

taskList{end+1} = 'Yaw Angle';
taskList{end+1} = 'Pitch Angle';
taskList{end+1} = 'Roll Angle';
taskList{end+1} = 'Bank Angle';
taskList{end+1} = 'Angle of Attack';
taskList{end+1} = 'SideSlip Angle';

taskList = setdiff(taskList,excludeList);
end
2 changes: 1 addition & 1 deletion helper_methods/ksptot_ma/misc/getStationInfoByID.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function [stationInfo] = getStationInfoByID(maData, stationID)
%getOtherSCInfoByID Summary of this function goes here
%getStationInfoByID Summary of this function goes here
% Detailed explanation goes here

stationInfo = [];
Expand Down
Binary file not shown.
Loading

0 comments on commit 4139139

Please sign in to comment.