({{, (RefLink[StateTransformationLinearize, paclet:ref/StateTransformationLinearize])[asys] 
linearizes the (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]) asys by state transformation.}, {, (RefLink[StateTransformationLinearize, paclet:ref/StateTransformationLinearize])[asys,{z,lform}]
specifies the new states z and form of linearization lform. }, {, (RefLink[StateTransformationLinearize, paclet:ref/StateTransformationLinearize])[asys,…,"prop"]
computes the property "prop".}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[StateTransformationLinearize, paclet:ref/StateTransformationLinearize]) attempts to transform an affine system to a linear one so that linear control techniques can be used on the linearized dynamics.

Using a state transformation x->p[z], the original affine system with dynamics x'==a(x)+b(x).u and output y==c(x)+d.u gets transformed to an input-output, input-state, or state-output linear system.

The following forms of exact linearization lform can be used:

The (RefLink[Automatic, paclet:ref/Automatic]) setting will attempt "InputOutput", "InputState", or "StateOutput".

(RefLink[StateTransformationLinearize, paclet:ref/StateTransformationLinearize]) returns a (RefLink[LinearizingTransformationData, paclet:ref/LinearizingTransformationData]) object that can be used to extract detailed properties for further analysis and design.

Properties related to the state transformation include:

Properties related to controller and estimator design include:

OpenersPrimaryExamplesSection(Spacer1)Examples  (17)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Linearize an affine system using state transformation:

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

The transformed system is completely linear:

ℒ["TransformedSystem"]

Compute feedback gains for the system, using the linearized system:

κ=StateFeedbackGains[%,{-4+2 I,-4-2I}]

The closed-loop system:

ℒ[{"ClosedLoopSystem",κ}]//Simplify

The closed-loop system is stable:

OutputResponse[{%,{2,1}},UnitStep[t],{t,0,10}];
Plot[%,{t,0,3},PlotRange->All]

OpenersExampleSection1(Spacer1)Scope  (12)

OpenersExampleSubsection0(Spacer1)Basic Uses  (5)

Linearize an affine system:

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

The transformed system shows that the state-to-output dynamics have been linearized:

ℒ["TransformedSystem"]

Explicitly obtain the type of linearization:

ℒ["Linearization"]

Specify the new state variables to use:

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

ℒ["TransformedSystem"]

Specify the type of linearization to use:

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

The input dynamics are linear, but the output is nonlinear:

ℒ["TransformedSystem"]

ℒ["Linearization"]

Specify the property upfront:

StateTransformationLinearize[(AffineStateSpaceModelFull[(Subscript[x, 2])-2 (Subscript[x, 2]) (Subscript[x, 3])+(Subscript[x, 3]^2), (Subscript[x, 3]), 0, 4 (Subscript[x, 2]) (Subscript[x, 3]), -2 (Subscript[x, 3]), 1, (Subscript[x, 1]), 0, (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]), \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ]),{{(Subscript[z, 1]),(Subscript[z, 2]),(Subscript[z, 3])},"InputState"},"TransformedSystem"]

Multiple properties can be specified:

asys=(AffineStateSpaceModelFull[(Subscript[x, 2])-2 (Subscript[x, 2]) (Subscript[x, 3])+(Subscript[x, 3]^2), (Subscript[x, 3]), 0, 4 (Subscript[x, 2]) (Subscript[x, 3]), -2 (Subscript[x, 3]), 1, (Subscript[x, 1]), 0, (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]), \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ]);

ℒ=StateTransformationLinearize[asys,{{(Subscript[z, 1]),(Subscript[z, 2]),(Subscript[z, 3])},"InputState"}];

Specify several properties:

ℒ[{"StateTransformation","InverseStateTransformation"}]

OpenersExampleSubsection1(Spacer1)Input-Output Linearize  (3)

Get transformation-related properties:

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

Forward and inverse state transformations:

{ℒ["StateTransformation"],ℒ["InverseStateTransformation"]}

The transformed linear system:

ℒ["TransformedSystem"]

Design controllers using exact and approximate linearization, and compare:

asys=(AffineStateSpaceModelFull[(((Subscript[x, 1]) (1-4 (Subscript[x, 2]))-(Subscript[x, 2]) (3+14 (Subscript[x, 2])+16 (Subscript[x, 2]^2)))/(2+4 (Subscript[x, 2]))), ((3 ((Subscript[x, 1])+(Subscript[x, 2])+2 (Subscript[x, 2]^2)))/(2+4 (Subscript[x, 2]))), 1, -(1/(2+4 (Subscript[x, 2]))), 0, -(1/(2+4 (Subscript[x, 2]))), (Subscript[x, 1])-(Subscript[x, 2]), 0, 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], {{(Subscript[\[FormalU], 1]),0},{(Subscript[\[FormalU], 2]),0}}Automatic, ]);

ℒ=StateTransformationLinearize[asys];

The transformed system:

tsys=ℒ["TransformedSystem"]

Design a controller and observer for the linearized system:

egains=EstimatorGains[tsys,{-8,-10}];
rgains=StateFeedbackGains[tsys,{-2,-3}];

EstimatorRegulator[tsys,{egains,rgains}]

The closed-loop system:

csys1=ℒ[{"ClosedLoopSystem",%}]

The simulation of the closed-loop system:

res1=OutputResponse[{csys1,{0.2,0.1,0,0}},{0,0},{t,0,3}];

Plot[res1,{t,0,3},PlotRange->All]

A controller based on approximate linearization, using same specifications:

lsys=StateSpaceModel[asys];

egains=EstimatorGains[lsys,{-8,-10}];
rgains=StateFeedbackGains[lsys,{-2,-3}];

EstimatorRegulator[lsys,{egains,rgains}]

Simulate the system:

csys2=SystemsModelFeedbackConnect[asys,%];

res2=OutputResponse[{csys2,{0.2,0.1,0,0}},{0,0},{t,0,3}];

Plot[res2,{t,0,3},PlotRange->All]

Compare the responses:

Plot[{res1,res2},{t,0,3},PlotLegends->{"exact linearization","approximate linearization"}]

Design estimators using exact and approximate linearization, and compare:

ℒ=StateTransformationLinearize[asys=(AffineStateSpaceModelFull[-(((1+(Subscript[x, 1])) (3 (Subscript[x, 1])-2 (Subscript[x, 2])))/(1+(Subscript[x, 1])+(Subscript[x, 2]))), (((-1+2 (Subscript[x, 1])-3 (Subscript[x, 2])) (Subscript[x, 2]))/(1+(Subscript[x, 1])+(Subscript[x, 2]))), -((Subscript[x, 1])/(1+(Subscript[x, 1])+(Subscript[x, 2]))), ((1+(Subscript[x, 2]))/(1+(Subscript[x, 1])+(Subscript[x, 2]))), (Subscript[x, 1]) (-1+(Subscript[x, 2]))+2 (Subscript[x, 2]), 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], {(Subscript[\[FormalU], 1])}Automatic, ])]

The transformed system:

tsys=ℒ["TransformedSystem"]

The estimator for the original system:

EstimatorGains[tsys,{-6+4I,-6-4I}];

estim=ℒ[{"OriginalSystemEstimator",StateOutputEstimator[tsys,%]}]

The trajectories of the estimated states:

or=OutputResponse[{asys,{-2,-1}},0,{t,0,5}];

res1=OutputResponse[SystemsModelDelete[estim,None,3],Join[{0},or],{t,0,5}];

Plot[res1,{t,0,5},PlotRange->All]

An estimator based on approximate linearization, using the same specification:

lsys=StateSpaceModel[asys];

aestim=StateOutputEstimator[asys,EstimatorGains[lsys,{-6+4I,-6-4I}]]

The trajectories of the estimated states, based on approximate linearization:

res2=OutputResponse[SystemsModelDelete[aestim,None,3],Join[{0},or],{t,0,5}];

Plot[Evaluate[%],{t,0,5},PlotRange->All]

Compute the actual state trajectories:

res=StateResponse[{asys,{-2,-1}},0,{t,0,10}];

Compare the actual and estimated trajectories of the first state:

Plot[Evaluate[First/@{res,res1,res2}],{t,0,4},PlotRange->All,PlotLegends->{"Actual","Exact linearization","Approximate linearization"}]

Compare the actual and estimated trajectories of the second state:

Plot[Evaluate[Last/@{res,res1,res2}],{t,0,4},PlotRange->All,PlotLegends->{"Actual","Exact linearization","Approximate linearization"}]

OpenersExampleSubsection2(Spacer1)State-Output Linearize  (2)

Get transformation-related properties:

ℒ=StateTransformationLinearize[(AffineStateSpaceModelFull[(((-1+(Subscript[x, 1])) ((Subscript[x, 1]) (-2+(Subscript[x, 2]))+(Subscript[x, 2])))/(-1+(Subscript[x, 1])-2 (Subscript[x, 2]))), -(((Subscript[x, 2]) (-3-5 (Subscript[x, 2])+(Subscript[x, 1]) (1+(Subscript[x, 2]))))/(-1+(Subscript[x, 1])-2 (Subscript[x, 2]))), ((2+(Subscript[x, 1]))/(1-(Subscript[x, 1])+2 (Subscript[x, 2]))), (1/(-1+(Subscript[x, 1])-2 (Subscript[x, 2]))), (Subscript[x, 1]) (1+2 (Subscript[x, 2])), 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], {{(Subscript[\[FormalU], 1]),0}}Automatic, ])]

Forward and inverse state transformations:

ℒ["StateTransformation"]

ℒ["InverseStateTransformation"]

The transformed system with linear dynamics from state to output:

ℒ["TransformedSystem"]

Design an estimator using exact linearization:

asys=(AffineStateSpaceModelFull[(((Subscript[x, 1]) (2-8 (Subscript[x, 2]))-6 (Subscript[x, 2]^2))/(-1+2 (Subscript[x, 2]))), ((2 ((Subscript[x, 1])-(-2+(Subscript[x, 2])) (Subscript[x, 2])))/(-1+2 (Subscript[x, 2]))), -(((Subscript[x, 1])+(((1+(Subscript[x, 2])))^2))/(-1+2 (Subscript[x, 2]))), ((2+(Subscript[x, 1])+(Subscript[x, 2]^2))/(-1+2 (Subscript[x, 2]))), 2 (Subscript[x, 1])+(Subscript[x, 2])+(Subscript[x, 2]^2), 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], AutomaticAutomatic, ]);

ℒ=StateTransformationLinearize[asys]

The transformed system:

tsys=ℒ["TransformedSystem"]

The estimator for the original system:

EstimatorGains[StateSpaceModel@tsys,{-6,-7}];

estim=ℒ[{"OriginalSystemEstimator",StateOutputEstimator[StateSpaceModel@tsys,%]}]

The trajectories of the estimated states:

or=OutputResponse[{asys,{0.1,0.2}},0,{t,0,10}];

res1=OutputResponse[SystemsModelDelete[estim,None,3],Join[{0},or],{t,0,2}];

Plot[res1,{t,0,2},PlotRange->All]

The actual state trajectories:

res=StateResponse[{asys,{0.1,0.2}},0,{t,0,2}];

Compare the estimated and actual state trajectories:

Plot[Evaluate@Join[res,res1],{t,0,2},PlotRange->All,PlotLegends->{"State 1","State 2", "Estimated State 1", "Estimated State 2"}]

OpenersExampleSubsection3(Spacer1)Input-State Linearize  (2)

Get transformation-related properties:

ℒ=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, ])]

Forward and inverse state transformations:

{ℒ["StateTransformation"],ℒ["InverseStateTransformation"]}

The transformed system with linear dynamics from input to state:

ℒ["TransformedSystem"]//Simplify

Design controllers using exact and approximate linearization, and compare:

ℒ=StateTransformationLinearize[asys=(AffineStateSpaceModelFull[(Subscript[x, 1])-5 (Subscript[x, 2]^2)+(Subscript[x, 2]) (Subscript[x, 3])+2 (Subscript[x, 3]^2), -(Subscript[x, 2])-2 (Subscript[x, 3]), 5 (Subscript[x, 2])+(Subscript[x, 3]), 1, (1/3) ((Subscript[x, 2])+(Subscript[x, 3])), 0, -(1/3), 0, -(1/3), (Subscript[x, 1]), 0, 0, (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]), \[Null], \[Null], {{(Subscript[\[FormalU], 1]),0},{(Subscript[\[FormalU], 2]),0}}Automatic, ])]

The transformed system:

tsys=ℒ["TransformedSystem"]

A controller based on exact linearization:

κ1=LQRegulatorGains[StateSpaceModel[N@tsys],{IdentityMatrix[3],5 IdentityMatrix[2]}];

ℒ[{"OriginalSystemController",κ1}]//Expand

The closed-loop system:

csys1=ℒ[{"ClosedLoopSystem",κ1}]//Simplify

The design based on approximate linearization:

lsys=StateSpaceModel[asys];

k2=LQRegulatorGains[lsys,{IdentityMatrix[3],5 IdentityMatrix[2]}]//N

The closed-loop system with feedback, based on approximate linearization:

csys2=SystemsModelStateFeedbackConnect[asys,k2]//Simplify//Chop

Compare the two designs:

OutputResponse[AffineStateSpaceModel[#,{(Subscript[x, 1])->-6,(Subscript[x, 2])->4,(Subscript[x, 3])->-1}],{0,0},{t,0,10}]&/@{csys1,csys2};

Plot[Evaluate[%],{t,0,10},PlotLegends->{"Exact linearization","Approximate linearization"},PlotRange->All]

OpenersExampleSection3(Spacer1)Properties & Relations  (4)

The transformed system is related to the input system by (RefLink[StateSpaceTransform, paclet:ref/StateSpaceTransform]):

asys=(AffineStateSpaceModelFull[3 (1+(Subscript[x, 1])) (Subscript[x, 2]), (((2-3 (Subscript[x, 2])) (Subscript[x, 2])+(Subscript[x, 1]) (1+2 (Subscript[x, 2])-3 (Subscript[x, 2]^2)))/(1+(Subscript[x, 1]))), -1, ((Subscript[x, 2])/(1+(Subscript[x, 1]))), -2 ((Subscript[x, 2])+(Subscript[x, 1]) (1+(Subscript[x, 2]))), 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], {{(Subscript[\[FormalU], 1]),0}}Automatic, ]);

ℒ=StateTransformationLinearize[asys,{(Subscript[z, 1]),(Subscript[z, 2])}];

{AffineStateSpaceModel@ℒ["TransformedSystem"],
StateSpaceTransform[asys,ℒ[{"StateTransformation","InverseStateTransformation"}]]}

The input-output linearized system is controllable and observable:

asys=(AffineStateSpaceModelFull[3 (1+(Subscript[x, 1])) (Subscript[x, 2]), (((2-3 (Subscript[x, 2])) (Subscript[x, 2])+(Subscript[x, 1]) (1+2 (Subscript[x, 2])-3 (Subscript[x, 2]^2)))/(1+(Subscript[x, 1]))), -1, ((Subscript[x, 2])/(1+(Subscript[x, 1]))), -2 ((Subscript[x, 2])+(Subscript[x, 1]) (1+(Subscript[x, 2]))), 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], {{(Subscript[\[FormalU], 1]),0}}Automatic, ]);

ℒ=StateTransformationLinearize[asys,{{(Subscript[z, 1]),(Subscript[z, 2])},"InputOutput"}];

{ControllableModelQ[ℒ["TransformedSystem"]],ObservableModelQ[ℒ["TransformedSystem"]]}

The state-output linearized system is observable:

asys=(AffineStateSpaceModelFull[((4 (Subscript[x, 1])-6 (Subscript[x, 1]^2)+6 (Subscript[x, 2]))/(1+6 (Subscript[x, 1]))), ((30 (Subscript[x, 1]^2)-2 (Subscript[x, 2])+24 (Subscript[x, 1]) (Subscript[x, 2]))/(1+6 (Subscript[x, 1]))), 0, 1+(Subscript[x, 1]), (Subscript[x, 1])-3 (Subscript[x, 1]^2)+2 (Subscript[x, 2]), 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], {{(Subscript[\[FormalU], 1]),0}}Automatic, ]);

ℒ=StateTransformationLinearize[asys,{{(Subscript[z, 1]),(Subscript[z, 2])},"StateOutput"}];

ObservableModelQ[ℒ["TransformedSystem"]]

The input-state linearized system is controllable:

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

ℒ=StateTransformationLinearize[asys,{{(Subscript[z, 1]),(Subscript[z, 2])},"InputState"}];

ControllableModelQ[ℒ["TransformedSystem"]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[FeedbackLinearize, paclet:ref/FeedbackLinearize])  ▪  (RefLink[StateSpaceTransform, paclet:ref/StateSpaceTransform])  ▪  (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel])}})}})

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