Example of a General Nonlinear System

Physical systems where the control inputs appear nonlinearly are rather uncommon. They are, however, indispensable in the high-fidelity modeling of aircraft dynamics, where the control surfaces such as the elevator, aileron, and rudder affect the aerodynamic forces and moments of the aircraft in a nonlinear manner. The six-degree-of-freedom model in body coordinates, where are the inertia terms.

 In:= Xsys = NonlinearStateSpaceModel[ {{p + r Cos[\[Phi]] Tan[\[Theta]] + q Sin[\[Phi]] Tan[\[Theta]], q Cos[\[Phi]] - r Sin[\[Phi]], Sec[\[Theta]] (r Cos[\[Phi]] + q Sin[\[Phi]]), u Cos[\[Theta]] Cos[\[Psi]] + Cos[\[Phi]] (w Cos[\[Psi]] Sin[\[Theta]] - v Sin[\[Psi]]) + Sin[\[Phi]] (v Cos[\[Psi]] Sin[\[Theta]] + w Sin[\[Psi]]), -w Cos[\[Psi]] Sin[\[Phi]] + (u Cos[\[Theta]] + v Sin[\[Theta]] Sin[\[Phi]]) Sin[\[Psi]] + Cos[\[Phi]] (v Cos[\[Psi]] + w Sin[\[Theta]] Sin[\[Psi]]), -u Sin[\[Theta]] + Cos[\[Theta]] (w Cos[\[Phi]] + v Sin[\[Phi]]), -(( Subscript[\[ScriptCapitalJ], \[ScriptZ]] (p q Subscript[\ \[ScriptCapitalJ], \[ScriptX]\[ScriptZ]] + q r Subscript[\[ScriptCapitalJ], \[ScriptY]] - q r Subscript[\[ScriptCapitalJ], \[ScriptZ]] + Subscript[\[ScriptCapitalM], \[ScriptX]]) + Subscript[\[ScriptCapitalJ], \[ScriptX]\[ScriptZ]] (p q \ Subscript[\[ScriptCapitalJ], \[ScriptX]] - q r Subscript[\[ScriptCapitalJ], \[ScriptX]\[ScriptZ]] - p q Subscript[\[ScriptCapitalJ], \[ScriptY]] + Subscript[\[ScriptCapitalM], \[ScriptZ]]))/(\!\( \*SubsuperscriptBox[\(\[ScriptCapitalJ]\), \(\[ScriptX]\[ScriptZ]\), \ \(2\)] - \( \*SubscriptBox[\(\[ScriptCapitalJ]\), \(\[ScriptX]\)]\ \*SubscriptBox[\(\[ScriptCapitalJ]\), \(\[ScriptZ]\)]\)\))), (-p r \ Subscript[\[ScriptCapitalJ], \[ScriptX]] + (-p^2 + r^2) Subscript[\[ScriptCapitalJ], \[ScriptX]\[ScriptZ]] + p r Subscript[\[ScriptCapitalJ], \[ScriptZ]] + Subscript[\[ScriptCapitalM], \[ScriptY]])/ Subscript[\[ScriptCapitalJ], \[ScriptY]], (p q \!\(\*SubsuperscriptBox[\(\[ScriptCapitalJ]\), \(\[ScriptX]\), \(2\)]\ \) + Subscript[\[ScriptCapitalJ], \[ScriptX]\[ScriptZ]] (p q \ Subscript[\[ScriptCapitalJ], \[ScriptX]\[ScriptZ]] + q r Subscript[\[ScriptCapitalJ], \[ScriptY]] - q r Subscript[\[ScriptCapitalJ], \[ScriptZ]] + Subscript[\[ScriptCapitalM], \[ScriptX]]) + Subscript[\[ScriptCapitalJ], \[ScriptX]] (-q r Subscript[\ \[ScriptCapitalJ], \[ScriptX]\[ScriptZ]] - p q Subscript[\[ScriptCapitalJ], \[ScriptY]] + Subscript[\[ScriptCapitalM], \[ScriptZ]]))/(- \!\(\*SubsuperscriptBox[\(\[ScriptCapitalJ]\), \(\[ScriptX]\[ScriptZ]\ \), \(2\)]\) + Subscript[\[ScriptCapitalJ], \[ScriptX]] Subscript[\[ScriptCapitalJ], \[ScriptZ]]), r v - q w + (\[ScriptCapitalT] + \[ScriptCapitalX] - g m Sin[\[Theta]])/m, -r u + p w + \[ScriptCapitalY]/m + g Cos[\[Theta]] Sin[\[Phi]], q u - p v + \[ScriptCapitalZ]/m + g Cos[\[Theta]] Cos[\[Phi]]}, {\[Phi], \[Theta], \[Psi], x, y, z, p, q, r, u, v, w}}, {\[Phi], \[Theta], \[Psi], x, y, z, p, q, r, u, v, w}, {Subscript[\[ScriptCapitalM], \[ScriptX]], Subscript[\[ScriptCapitalM], \[ScriptY]], Subscript[\[ScriptCapitalM], \[ScriptZ]], \[ScriptCapitalX], \ \[ScriptCapitalY], \[ScriptCapitalZ]}, {Automatic, Automatic, Automatic, Automatic, Automatic, Automatic, Automatic, Automatic, Automatic, Automatic, Automatic, Automatic}, Automatic , SamplingPeriod -> None];

The longitudinal dynamics are the dynamics for states , , , and :

 In:= XSystemsModelExtract[sys, All, {10, 12, 8, 2}, {10, 12, 8, 2}]
 Out= The lateral dynamics are the dynamics for the states , , , and :

 In:= XSystemsModelExtract[sys, All, {11, 7, 9, 1}, {11, 7, 9, 1}]
 Out= Questions? Comments? Contact a Wolfram expert »