diff --git a/classes/Rocket.m b/classes/Rocket.m index 2ad97d111e05e2b99995e077f8b1da92d67fee94..89686627e4854b9252758ab1e6bc6d66ebce7048 100644 --- a/classes/Rocket.m +++ b/classes/Rocket.m @@ -125,7 +125,6 @@ classdef Rocket < Component if ~isempty(obj.xCg) return; end - % Motor mass is 5th element of "bays" obj.xCg = (obj.xCgNoMotor*obj.massNoMotor + ... obj.motor.mass.*(obj.motor.xCg+obj.lengthCenterNoMot))./ ... obj.mass; @@ -188,10 +187,15 @@ classdef Rocket < Component return; end varNames = {'total', 'geometry', 'state', 'finsCN'}; - dataCoeffs = load(fullfile(obj.mission.dataPath, 'aeroCoefficients.mat'), ... - varNames{:}); - dataCoeffsHighAOA = load(fullfile(obj.mission.dataPath, 'aeroCoefficientsHighAOA.mat'), ... - varNames{:}); + aeroPath = fullfile(obj.mission.dataPath, 'aeroCoefficients.mat'); + aeroHighAOAPath = fullfile(obj.mission.dataPath, 'aeroCoefficientsHighAOA.mat'); + + if ~(exist(aeroPath, 'file') && exist(aeroHighAOAPath,'file')) + return; + end + + dataCoeffs = load(aeroPath, varNames{:}); + dataCoeffsHighAOA = load(aeroHighAOAPath, varNames{:}); if isfield(dataCoeffs, "finsCN") && isfield(dataCoeffsHighAOA, "finsCN") obj.coefficients.finsCN = dataCoeffs.finsCN; diff --git a/classes/components/Environment.m b/classes/components/Environment.m index 25e3d7725b16ad9f53ef7b71371bed27c3f7df63..2f76a645d31be32a9d3406e460be65b094de38de 100644 --- a/classes/components/Environment.m +++ b/classes/components/Environment.m @@ -47,6 +47,10 @@ classdef Environment < Component end obj@Component(mission, varIn); obj.motor = motor; + + %% Update angles + obj.omega = deg2rad(obj.omega); + obj.phi = deg2rad(obj.phi); end end diff --git a/classes/components/WindCustom.m b/classes/components/WindCustom.m index 69aa45f10e7af97121af1b3aa642b69121850963..af8f0f86ca96467b782264dbdb3cc0b370bbb9d3 100644 --- a/classes/components/WindCustom.m +++ b/classes/components/WindCustom.m @@ -48,8 +48,8 @@ classdef WindCustom < Component vw = round( - obj.magnitude * sin(obj.azimuth), 6); ww = 0; else - mag = interpLinear(obj.altitudes, obj.magnitude, z); - az = interpLinear(obj.altitudes, obj.azimuth, z); + mag = interpLinear(obj.altitudes, obj.magnitude, z, true); + az = interpLinear(obj.altitudes, obj.azimuth, z, true); uw = round( - mag * cos(az), 6); vw = round( - mag * sin(az), 6); diff --git a/functions/miscellaneous/createDissileInput.m b/functions/miscellaneous/createDissileInput.m index a5216fe5756780ebeee2441072f43eca3cce1102..ebc28189cad88cd7279976c195bbe407df174873 100644 --- a/functions/miscellaneous/createDissileInput.m +++ b/functions/miscellaneous/createDissileInput.m @@ -98,6 +98,13 @@ if ~isempty(rocket.pitot.initialConeLength) input.axibod.PITOTCDB = rocket.pitot.finalConeDiameter; % [m] Pitot final conic section diameter input.axibod.PITOTL = rocket.pitot.length; % [m] Pitot tube length input.axibod.PITOTD = rocket.PITOTD; % [m] Pitot tube diameter +else + input.axibod.PITOTCLI = 0; % [m] Pitot initial conic section length + input.axibod.PITOTCLB = 0; % [m] Pitot final conic section length + input.axibod.PITOTCDI = 0; % [m] Pitot initial conic section diameter + input.axibod.PITOTCDB = 0; % [m] Pitot final conic section diameter + input.axibod.PITOTL = 0; % [m] Pitot tube length + input.axibod.PITOTD = 0; % [m] Pitot tube diameter end %%% centerbody diff --git a/functions/odeFunctions/ballistic.m b/functions/odeFunctions/ballistic.m index b435a4ae4515f00f73b795d34e8dd5ca1bcb70b4..3baa2f2e25737032d33d04041bb9b719ffcbe667 100644 --- a/functions/odeFunctions/ballistic.m +++ b/functions/odeFunctions/ballistic.m @@ -78,7 +78,7 @@ g = environment.g0/(1 + (-z*1e-3/6371))^2; % [N/kg] module of grav tb = rocket.motor.cutoffTime; % [s] Burning Time local = [environment.z0, environment.temperature, ... % vector containing inputs for atmosphereData environment.pressure, environment.rho]; -omega = environment.omega*pi/180; +omega = environment.omega; %% QUATERION ATTITUDE Q = [q0 q1 q2 q3]; @@ -213,8 +213,8 @@ end %% RAMP / FREE FLIGHT if -z < environment.effectiveRampLength*sin(omega) % No torque on the launchpad Fg = m*g*sin(omega); % [N] force due to the gravity - X = 0.5*rho*V_norm^2*S*CA; - F = -Fg +T -X; + fX = 0.5*rho*V_norm^2*S*CA; + F = -Fg +T -fX; du = F/m; dv = 0; @@ -225,8 +225,8 @@ if -z < environment.effectiveRampLength*sin(omega) % No torque on the launc alpha_value = NaN; beta_value = NaN; - Y = 0; - Z = 0; + fY = 0; + fZ = 0; XCPlon = NaN; XCPlat = NaN; @@ -241,11 +241,11 @@ else qdyn = 0.5*rho*V_norm^2; % [Pa] dynamics pressure qdynL_V = 0.5*rho*V_norm*S*C; - X = qdyn*S*CA; % [N] x-body component of the aerodynamics force - Y = qdyn*S*CY; % [N] y-body component of the aerodynamics force - Z = qdyn*S*CN; % [N] z-body component of the aerodynamics force + fX = qdyn*S*CA; % [N] x-body component of the aerodynamics force + fY = qdyn*S*CY; % [N] y-body component of the aerodynamics force + fZ = qdyn*S*CN; % [N] z-body component of the aerodynamics force Fg = dcm*[0; 0; m*g]; % [N] force due to the gravity in body frame - F = Fg + [-X+T, Y, -Z]'; % [N] total forces vector + F = Fg + [-fX+T, fY, -fZ]'; % [N] total forces vector %----------------------------------------------------- %F = Fg + [-X+T*cos(chi), Y+T*sin(chi), -Z]'; % [N] total forces vector @@ -312,7 +312,7 @@ if nargout == 2 parout.velocities = Vels; - parout.forces.AeroDyn_Forces = [X, Y, Z]; + parout.forces.AeroDyn_Forces = [fX, fY, fZ]; parout.forces.T = T; parout.air.rho = rho; diff --git a/missions/2024_Lyra_Portugal_October/config/rocketConfig.m b/missions/2024_Lyra_Portugal_October/config/rocketConfig.m index c039bc4498206954235c70837bb4c6fe5e965e39..f2274b5125e8431a2c4a279b3fa011a22f48426b 100644 --- a/missions/2024_Lyra_Portugal_October/config/rocketConfig.m +++ b/missions/2024_Lyra_Portugal_October/config/rocketConfig.m @@ -14,7 +14,7 @@ rocket.lengthCenterNoMot = 1.778; % [m] OVERRIDE C %% PLD - Includes Payload + Nose payload = Payload(); -payload.length = 0.32; % [m] Total bay length +payload.length = 0.6; % [m] Total bay length payload.mass = 3.38512; % [kg] Total bay mass payload.inertia = []; % [kg*m^2] Total bay inertia (Body reference) payload.xCg = []; % [m] Cg relative to bay upper side @@ -49,12 +49,16 @@ airbrakes.mass = []; % [kg] Total bay mass airbrakes.inertia = []; % [kg*m^2] Total bay inertia (Body reference) airbrakes.xCg = []; % [m] Cg relative to bay upper side +airbrakes.multipleAB = false; % If true, multiple and smooth airbrakes opening will be simulated +airbrakes.opening = [0 1 0.5]; % aerobrakes, 1-2-3 for 0%, 50% or 100% opened +airbrakes.deltaTime = [5 5 5]; % aerobrakes, configurations usage time airbrakes.multipleAB = false; % If true, multiple and smooth airbrakes opening will be simulated airbrakes.opening = [1]; % aerobrakes, 1-2-3 for 0%, 50% or 100% opened airbrakes.deltaTime = []; % aerobrakes, configurations usage time airbrakes.n = 3; % [-] number of brakes airbrakes.height = linspace(0, 0.0363, 3); % [m] Block airbrakes opening coordinate ( First entry must be 0! ) +airbrakes.angles = [0, 45, 68]; airbrakes.width = 0.1002754821; % [m] brakes width (normal) airbrakes.thickness = 0.008; % [m] brakes thickness airbrakes.xDistance = 1.517; % [m] axial position from nosecone base @@ -66,6 +70,9 @@ airbrakes.servoOmega = 150*pi/180; % [rad/s] Servo-motor %% MOTOR motor = Motor(); +motor.name = 'HRE_ARM_30_inj-T03T03'; % [-] Motor name +motor.cutoffTime = []; % [s] OVERRIDE Cutoff time +motor.ignitionTransient = 0.4; % [s] Ignition transient motor.name = 'HRE_ARM_30_inj-T03T03'; % [-] Motor name motor.cutoffTime = inf; % [s] Cutoff time motor.ignitionTransient = 0.3; % [s] Ignition transient diff --git a/missions/2024_Lyra_Portugal_October/data/CAinterpCoeffs.mat b/missions/2024_Lyra_Portugal_October/data/CAinterpCoeffs.mat index 53025369433d57235669913f378f4766f188a3f3..97df5529469a835b645efcb9d29726f6cccd2aa4 100644 --- a/missions/2024_Lyra_Portugal_October/data/CAinterpCoeffs.mat +++ b/missions/2024_Lyra_Portugal_October/data/CAinterpCoeffs.mat @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d5d212e8d6501ea7d1e4572c84de2a59887f7a87e965dcbcf189fd37142fffdd +oid sha256:33c07484db34ceb100aaeb9ea817d40471a25657e4b63395ae3d40244f44691f size 457 diff --git a/missions/2024_Lyra_Portugal_October/data/rocketStress.mat b/missions/2024_Lyra_Portugal_October/data/rocketStress.mat index 7f20d2d5812dd5cb1a7182b281f7ebf0e977e824..2c826253354623861e551e2597484070519964f0 100644 --- a/missions/2024_Lyra_Portugal_October/data/rocketStress.mat +++ b/missions/2024_Lyra_Portugal_October/data/rocketStress.mat @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2af604b52fb12df3ffc96825ccb04e4ec3fa9bce8a0f70c3aa2cb2ae4100177 -size 1138617 +oid sha256:284b485d8f2c3fc1ac51dabdff1966fddf8961bf6cfcbc6fac6e0d0cc57da511 +size 636771 diff --git a/missions/2024_Lyra_Portugal_October/data/rocketStressMain.mat b/missions/2024_Lyra_Portugal_October/data/rocketStressMain.mat index 9e62ba72dacf5b0721ff4c0307de6b318bf731e8..b33c119b1d500c5a17d5e215f15ca89bd9429698 100644 --- a/missions/2024_Lyra_Portugal_October/data/rocketStressMain.mat +++ b/missions/2024_Lyra_Portugal_October/data/rocketStressMain.mat @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:50626a92cd9ddc4603b035c1b472966ef0608558fcf1e9073555f9cc2a19b0c8 -size 420614 +oid sha256:1ba65a59b508f8e02c202b1145f3af61e6455b64a80de60039625bc024c9e359 +size 214027 diff --git a/missions/2024_Lyra_Roccaraso_September/config/environmentConfig.m b/missions/2024_Lyra_Roccaraso_September/config/environmentConfig.m index e90dd15d4f168f495ff0bc37cec20201c18feab0..8f05f5af3518b7104e37e667fc9c80778e6877d1 100644 --- a/missions/2024_Lyra_Roccaraso_September/config/environmentConfig.m +++ b/missions/2024_Lyra_Roccaraso_September/config/environmentConfig.m @@ -9,9 +9,9 @@ environment.lon0 = 14.0546408; % [deg] Launchpad longitude environment.z0 = 1414; % [m] Launchpad Altitude environment.omega = 85; % [deg] Launchpad Elevation environment.phi = 0; % [deg] Launchpad Azimuth -environment.pin1Length = 000; % [m] Distance from the upper pin to the upper tank cap -environment.pin2Length = 000; % [m] Distance from the lower pin to the lower tank cap -environment.rampLength = 000; % [m] Total launchpad length +environment.pin1Length = 0.5603; % [m] Distance from the upper pin to the upper tank cap +environment.pin2Length = 0.2055; % [m] Distance from the lower pin to the lower tank cap +environment.rampLength = 10; % [m] Total launchpad length environment.temperature = []; % [deg] Ground temperature correction environment.pressure = []; % [Pa] Ground pressure correction diff --git a/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m b/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m index c61962360c179c81c285195a1b70d200709d719c..c0e80a3cc39b1e7c95c28a75a4a33aa469ddb83c 100644 --- a/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m +++ b/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m @@ -6,11 +6,14 @@ rocket = Rocket(); rocket.diameter = 0.15; % [m] Rocket diameter rocket.length = []; % [m] OVERRIDE total length rocket.mass = []; % [kg] OVERRIDE total mass -rocket.massNoMotor = []; % [kg] OVERRIDE mass without motor +rocket.massNoMotor = [15.6348]; % [kg] OVERRIDE mass without motor rocket.inertia = []; % [kg*m^2] OVERRIDE total inertia - Axibody reference -rocket.inertiaNoMotor = []; % [kg*m^2] OVERRIDE inertia without motor +rocket.inertiaNoMotor = [ + 0.06535397; + 12.07664659; + 12.07701314]; % [kg*m^2] OVERRIDE inertia without motor rocket.xCg = []; % [m] OVERRIDE total xCg -rocket.xCgNoMotor = []; % [m] OVERRIDE xCg without motor +rocket.xCgNoMotor = [1.28]; % [m] OVERRIDE xCg without motor %% PLD - Includes Payload + Nose payload = Payload(); @@ -102,7 +105,7 @@ airbrakes.servoOmega = 150*pi/180; % [rad/s] Servo-motor %% MOTOR motor = Motor(); -motor.name = 'HRE_FURIA-Rv2-T04T03'; % [-] Motor name +motor.name = 'HRE_ARM_Rocc_U06-T03T03'; % [-] Motor name motor.cutoffTime = []; % [s] OVERRIDE Cutoff time motor.ignitionTransient = 0.4; % [s] Ignition transient motor.cutoffTransient = 0.3; % [s] Cut-off transient diff --git a/missions/2024_Lyra_Roccaraso_September/config/windConfig.m b/missions/2024_Lyra_Roccaraso_September/config/windConfig.m index 332c74eea10b207f02afd7a9d0d019b509c8ceb1..5392f93f8ed19534df9dcfabec177d43b7344bfb 100644 --- a/missions/2024_Lyra_Roccaraso_September/config/windConfig.m +++ b/missions/2024_Lyra_Roccaraso_September/config/windConfig.m @@ -16,7 +16,7 @@ windCustom.magnitudeDistribution = ["g", "u", "u"]; % [-] Distribution type: windCustom.magnitudeParameters = [7 2 10; % [m/s] Distribution parameters: "u" - [min; max], "g" - [mu; sigma] 0.5 9 20]; windCustom.azimuthDistribution = ["u", "u", "u"]; % [-] Distribution type: "u" - uniform, "g" - gaussian -windCustom.azimuthParameters = 0*pi/180 * ones(2,3); % [deg] Distribution parameters: "u" - [min; max], "g" - [mu; sigma] +windCustom.azimuthParameters = 90*pi/180 * ones(2,3); % [deg] Distribution parameters: "u" - [min; max], "g" - [mu; sigma] %% MATLAB WIND MODEL