({{, (RefLink[SystemsModelLinearity, paclet:ref/SystemsModelLinearity])[sys] 
gives the linearity of the systems model sys.}, {, (RefLink[SystemsModelLinearity, paclet:ref/SystemsModelLinearity])[{sys,{(Subscript[in, 1]),…},{(Subscript[out, 1]),…},{(Subscript[s, 1]),…}]
only considers the subsystem associated with inputs (Subscript[in, i]), outputs (Subscript[out, j]), and states (Subscript[s, k]).}})

OpenersNotesSection(Spacer1)Details

(RefLink[SystemsModelLinearity, paclet:ref/SystemsModelLinearity]) is typically used to determine whether a (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]) or (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]) satisfies additional linearity conditions, which would allow it to be exactly converted to a more specialized form and thus making a wider range of design and analysis techniques applicable.

Possible systems models sys include (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel]), (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]), (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]), and (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]).

A state space model with state x, input u, state equations x'=f(x,u) and output equations y=g(x,u) can be classified based on what variables in f and g occur linearly.

Possible values and the structural form required for both f(x,u) and g(x,u) are given below:

OpenersPrimaryExamplesSection(Spacer1)Examples  (15)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

A linear mass-spring-damper (MSD) model:

NonlinearStateSpaceModel[m x''[t]+c x'[t]+k x[t]==u[t],x[t],u[t],x[t],t];

SystemsModelLinearity[%]

A MSD model with the spring having cubic nonlinearity:

NonlinearStateSpaceModel[m x''[t]+c x'[t]+(Subscript[k, 1]) x[t]+(Subscript[k, 2])((x[t])^3)==u[t],x[t],u[t],x[t],t];

SystemsModelLinearity[%]

OpenersExampleSection1(Spacer1)Scope  (7)

A linear model:

SystemsModelLinearity[(StateSpaceModelFull[a, b, c, d, , , ])]

A (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]) that is linear:

SystemsModelLinearity[(NonlinearStateSpaceModelFull[b u+a x, d u+c x, x, \[Null], \[Null],  {u}Automatic, ])]

A bilinear model:

SystemsModelLinearity[(NonlinearStateSpaceModelFull[a x+u (Subscript[b, 0])+u x (Subscript[b, 1]), d u+c x, x, \[Null], \[Null], {u}Automatic, ])]

An input-linear model:

SystemsModelLinearity[(NonlinearStateSpaceModelFull[x (Subscript[a, 1])+(x^2) (Subscript[a, 2])+u (Subscript[b, 0])+u x (Subscript[b, 1]), d u+c x, x, \[Null], \[Null], {u}Automatic, ])]

A model that is not linear:

SystemsModelLinearity[(NonlinearStateSpaceModelFull[x (Subscript[a, 1])+(x^2) (Subscript[a, 2])+u (Subscript[b, 0])+u x (Subscript[b, 1])+(u^2) (Subscript[b, 2]), d u+c x, x, \[Null], \[Null],  {u}Automatic, ])]

Frequency domain models are linear models:

SystemsModelLinearity[(TransferFunctionModelFull[((b+s)/(a+s)), , , ])]

A model with linear state equations:

SystemsModelLinearity[{(NonlinearStateSpaceModelFull[b u+a x, u+x+(x^2), x, \[Null], \[Null], {u}Automatic, ]),All,None,All}]

OpenersExampleSection3(Spacer1)Applications  (2)

Verify the linearization obtained using (RefLink[StateTransformationLinearize, paclet:ref/StateTransformationLinearize]):

ℒ=StateTransformationLinearize[(AffineStateSpaceModelFull[4 (Subscript[x, 1]), 7 (Subscript[x, 1]^2)+(Subscript[x, 2]), 1, -1+2 (Subscript[x, 1]), (Subscript[x, 1])-(Subscript[x, 2]), 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], {{(Subscript[\[FormalU], 1]),0}}Automatic, ])]

sys=ℒ["TransformedSystem"]

Check if it is input-output linear:

SystemsModelLinearity[sys]==="Linear"

Check if it is state-output linear:

SystemsModelLinearity[{sys,None,All}]==="Linear"

Check if it is input-state linear:

SystemsModelLinearity[{sys,All,None}]==="Linear"

Compute the linearization after systems connections:

sys1=(TransferFunctionModelFull[(1/(4+s)), (2/(3+s)), , , ]);

sys2=(NonlinearStateSpaceModelFull[(Subscript[x, 2]), u-4 (Subscript[x, 1])-(Subscript[x, 2]^2), (Subscript[x, 1]), (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], {u}Automatic, ]);

Connect the two systems in a series:

sys=SystemsModelSeriesConnect[sys1,sys2]

The linearity of the original and connected systems:

SystemsModelLinearity/@{sys1,sys2,sys}

OpenersExampleSection4(Spacer1)Properties & Relations  (4)

A linear system obeys the principles of superposition and homogeneity:

lsys=(StateSpaceModelFull[-1, 1, 1, 0, , , ]);

SystemsModelLinearity[lsys]

Its response to the input signal sin(t):

r1=OutputResponse[lsys,Sin[t],{t,0,15}];
Plot[r1,{t,0,15}]

Its response to (UnitStepSeq[t]):

r2=OutputResponse[lsys,UnitStep[t],{t,0,15}];
Plot[r2,{t,0,15},PlotRange->All]

The response to 3 sin(t)+5 (UnitStepSeq[t]) is the same as 3 r1+5 r2:

OutputResponse[lsys,3 Sin[t]+5 UnitStep[t],{t,0,15}];

Plot[{%,3r1+5r2},{t,0,15}]

Typically (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]) is used to model linear state-space models:

lsys=(StateSpaceModelFull[a, b, c, d, , , ]);

SystemsModelLinearity[lsys]

The model can be exactly converted to any other systems model:

AffineStateSpaceModel[lsys]

NonlinearStateSpaceModel[lsys]

Typically (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]) is used for models that are bilinear or input-linear:

asys=(AffineStateSpaceModelFull[x+a[x], x+b[x], x+c[x], 0, x, \[Null], \[Null], AutomaticAutomatic, ]);

SystemsModelLinearity[asys]

It can be exactly converted to (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]):

NonlinearStateSpaceModel[asys]

Conversion to other systems models is approximate:

StateSpaceModel[asys]

Use (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]) for models that are not linear:

nsys=(NonlinearStateSpaceModelFull[u+x+f[x,u], u+x+g[x,u], x, \[Null], \[Null], {u}Automatic, ]);

SystemsModelLinearity[nsys]

Conversion to any other systems model is approximate:

AffineStateSpaceModel[nsys]

StateSpaceModel[nsys]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[StateSpaceModel, paclet:ref/StateSpaceModel])  ▪  (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel])  ▪  (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel])  ▪  (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Nonlinear Control Systems, paclet:guide/NonlinearControlSystems])}})}})