Skip to content
Snippets Groups Projects
Commit bc414e02 authored by giuliaghirardini's avatar giuliaghirardini Committed by Marco Luigi Gaibotti
Browse files

[refactoring-missions][2021_Lynx_Roccaraso_September] Modified Rocket methods...

[refactoring-missions][2021_Lynx_Roccaraso_September] Modified Rocket methods for updating stages mass to be compatible with parafoil-less rockets and modified check geometry method to be compatible with Karman ogive
parent d1922167
Branches
No related tags found
1 merge request!5Refactoring missions
......@@ -156,10 +156,10 @@ classdef Rocket < Component
end
function updateStagesMass(obj)
stage1 = obj.cutoffMass - (obj.payload.mass + obj.parachutes(1,2).mass + obj.parachutes(2,2).mass);
stage1 = obj.cutoffMass - sum([obj.parachutes(:,1).mass]);
% Everything at cut off without payload, payload drogue and
% payload airfoil
stage2 = obj.payload.mass + obj.parachutes(1,2).mass + obj.parachutes(2,2).mass;
stage2 = sum([obj.parachutes(:,1).mass]);
% only payload: payload, payload drogue and payload airfoil
obj.stagesMass = [stage1 stage2];
end
......@@ -366,6 +366,33 @@ classdef Rocket < Component
obj.coefficients.geometry.xcg(end);
], 3);
if (obj.payload.noseCMod & obj.payload.nosePMod) == 0 % KARMAN ogive case, no modified p and c coefficients
geometryRocket = round([
obj.diameter;
obj.payload.noseLength;
obj.lengthCenter;
obj.rear.finsRootChord;
obj.rear.finsFreeChord;
obj.rear.finsHeight;
obj.rear.finsDeltaXFreeChord;
obj.rear.nPanel;
obj.rear.boatLength;
obj.rear.boatFinalDiameter;
], 3);
geometryTest = round([
obj.coefficients.geometry.diameter;
obj.coefficients.geometry.lNose;
obj.coefficients.geometry.lCenter;
obj.coefficients.geometry.chord1;
obj.coefficients.geometry.chord2;
obj.coefficients.geometry.height;
obj.coefficients.geometry.deltaXLE;
obj.coefficients.geometry.nPanel;
obj.coefficients.geometry.boatL;
obj.coefficients.geometry.boatD;
], 3);
else % MHAAK ogive case, modified p and c coefficients
geometryRocket = round([
obj.diameter;
obj.payload.noseLength;
......@@ -395,6 +422,7 @@ classdef Rocket < Component
obj.coefficients.geometry.boatL;
obj.coefficients.geometry.boatD;
], 3);
end
checks = [
xCgRocket == xCgTest;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment