function iError = mDefCHK_oem(test_case, Nx, Ny, Nu, NparSys, Nparam, NparID, Nzi, ... param, parFlag, x0, iArtifStab, StabMat) % Check model defined in mDefCase** % % Chapter 4: Output Error Method % "Flight Vehicle System Identification - A Time Domain Methodology" % Author: Ravindra V. Jategaonkar % Published by AIAA, Reston, VA 20191, USA % % Inputs: % test_case test case number % Nx number of state variables % Ny number of output variables % Nu number of input variables % NparSys number of system parameters % Nparam total number of parameters appearing in the postulated model % NparID number of unknown parameters being estimated % Nzi number of time segments being analyzed simultaneously % param parameter vector (Nparam) % parFlag flags for free and fixed parameters (=1, free parameter, 0: fixed) % x0 Initial conditions % iArtifStab flag for artificial stabilization % StabMat artificial stabilization matrix % % Outputs: % iError Error flag %---------------------------------------------------------------------------------------- iError = 0; if Nparam < NparSys, disp('Wrong specification of Nparam or NparSys: Nparam less than NparSys?') iError = 1; end if size(param,1) ~= Nparam, disp('The number of parameter values (i.e size of param) and Nparam do not match.') iError = 1; end if size(param,1) ~= size(parFlag,1), disp('The number of parameter values (param) and parameter flags (parFlag) do not match.') iError = 1; end if isempty(x0) == 0, % only if x0 is not empty (to cover LS test cases) if size(x0,1) ~= Nx disp('The number intial conditons x0 is not Nx.') iError = 1; end if size(x0,2) ~= Nzi disp(['Number of time segments being analyzed simultaneously Nzi =' num2str(Nzi)]) disp('The number intial conditons x0 are not specified for Nzi time segments.') iError = 1; end end if iArtifStab ~= 0, if size(StabMat,1) ~= Nx | size(StabMat,2) ~= Ny, disp('The artificial stabilization matrix StabMat is not (Nx,Ny).') iError = 1; end end if iError ~= 0, disp('Error termination') end return % end of function