function [state_eq, obser_eq, Nx, Ny, Nu, NparSys, Nparam, NparID, dt, Ndata, Nzi, izhf, ... t, Z, Uinp, param, parFlag, x0, iArtifStab, StabMat] = mDefCase07(test_case) % Definition of model, flight data, initial values etc. % test_case = 7 -- Unstable aircraft, short period, Equation Decoupling method % variables: states - w, q % outputs - az, w, q % inputs - de, w, q % % Equation decoupling method for unstable aircraft - Short period model % % Inputs % test_case test case number % % Outputs % state_eq function to code right hand sides of state equations % obser_eq function to code right hand sides of observation equations % Nx number of states % Ny number of observation variables % Nu number of input (control) variables % NparSys number of system parameters % Nparam total number of system and bias parameters % NparID total number of parameters to be estimated (free parameters) % dt sampling time % Ndata total number of data points for Nzi time segments % Nzi number of time segments (maneuvers) to be analyzed simultaneously % izhf cumulative index at which the maneuvers end when concatenated % t time vector % Z observation variables: Data array of measured outputs (Ndata,Ny) % Uinp input variables: Data array of measured input (Ndata,Nu) % param initial starting values for unknown parameters (aerodynamic derivatives) % parFlag flags for free and fixed parameters % x0 initial conditions on state variables % iArtifStab integer flag to invoke artificial stabilization % = 0: No artificial stabilization % > 0: Artificial stabilization (needs definition of StabMat) % StabMat artificial stabilization matrix; (Nx,Ny); nonzero only for iArtifStab>0 % % Constants d2r = pi/180; r2d = 180/pi; %---------------------------------------------------------------------------------------- % Model definition state_eq = 'xdot_TC07_uAC_EqDecoup'; % function for state equations obser_eq = 'obs_TC08_uAC'; % function for observation equations Nx = 2; % Number of states Ny = 3; % Number of observation variables Nu = 3; % Number of input (control) variables NparSys = 6; % number of system parameters Nparam = NparSys; % Total number of system and bias parameters dt = 0.05; % sampling time iArtifStab = 0; % No artificial stabilization disp(['Test Case = ', num2str(test_case)]); disp('Unstable aircraft, short period, Equation Decoupling') %---------------------------------------------------------------------------------------- % Load flight data for Nzi time segments to be analyzed and concatenate load -ascii ..\flt_data\unStabAC_sim.asc; Nzi = 1; data = unStabAC_sim; % Number of data points Ndata = size(data,1); izhf = Ndata; % Generate new time axis t = [0:dt:Ndata*dt-dt]'; % Observation variables az, w, q Z = [data(:,6) data(:,3) data(:,4)]; % Input variables de, w, q Uinp = [data(:,5) data(:,3) data(:,4)]; % Initial starting values for unknown parameters (aerodynamic derivatives) param = [-1.22871D+00; -1.47680; -4.20491D+00; ... 1.16197D-01; -2.70670D+00; -1.87718D+01 ]; % Flag for free and fixed parameters parFlag = [1; 0; 1; ... 1; 1; 1]; % Total number of free parameters NparID = size(find(parFlag~=0),1); % Initial conditions w0, q0 x0 = [0.0; 0.0]; % Artificial stabilization matrix StabMat = zeros(Nx,Ny);