-
Notifications
You must be signed in to change notification settings - Fork 1
/
init_flexible_unsteady_indi.m
44 lines (30 loc) · 1.24 KB
/
init_flexible_unsteady_indi.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
clear all;
% add folders to path
is_tigl_installed = addPath();
%% Simulink model initialization
model = 'sim_flexible_unsteady_indi';
% flight point
fp_spec.Altitude = 6000; % m
fp_spec.EAS = 177; % m/s
[Ma,~] = altEas2MaTas( fp_spec.Altitude, fp_spec.EAS );
% aircraft parameters
if is_tigl_installed
[aircraft,structure] = aircraftSe2aCreate( 'flexible', true, 'unsteady', true, 'stall', false, 'Mach', Ma, 'pchfilename','na_Se2A-MR-Ref-v4-twist_GFEM_MTOAa_S103_DMIG.pch', 'AdjustJigTwist', true, 'ControlsMainFile', 'wingControls_params_mainTefRedCm' );
else
load('data/aircraft_structure.mat');
wingSetCustomActuatorPath(aircraft.wing_main);
end
% environment parameters
envir = envirLoadParams('envir_params_default');
% Temporary airplane pitch rate controller
pitch_rate_controller = loadParams( 'pitchRateController_params_se2a' );
% GLA INDI controller parameters
gla_indi = glaIndiCreate( aircraft, fp_spec, 'SensOmega', 500, ...
'BoostServos', 2.5, 'BoostUnstAeroMin', 3.4, 'BoostUnstAeroMax', 8 );
% Trim aircraft
tp_indi = trimFlexibleUnsteady(aircraft,structure,fp_spec,model);
% init controller steady state
tp_indi = tpInitController(tp_indi,gla_indi);
ic = tpGenerateIC(tp_indi);
% open Simulink model
open(model);