# 使用反馈线性化的估计器设计

 In[1]:= Xpars = {Subscript[n, 3] -> 1, Subscript[n, 1] -> 1, Subscript[n, 2] -> 0, Subscript[n, 0] -> 0};
 In[2]:= Xasys = AffineStateSpaceModel[(2 l/v) \[Psi]''[t] + Subscript[n, 3] \[Psi]'[t]^3 + Subscript[n, 2] \[Psi]'[t]^2 + Subscript[n, 1] \[Psi]'[t] + Subscript[n, 0] == (v/l) \[Delta][t], \[Psi][t], \[Delta][t], \[Psi][t], t] /. pars /. {l -> 45}
 Out[2]=

 In[3]:= X\[ScriptCapitalF] = FeedbackLinearize[asys]
 Out[3]=

 In[4]:= XEstimatorGains[\[ScriptCapitalF]["LinearSystem"], {-2 + I, -2 - I}]
 Out[4]=

 In[5]:= XEstimatorGains[\[ScriptCapitalF]["LinearSystem"], {-2 + I, -2 - I}]; \[ScriptL] = \[ScriptCapitalF][{"OriginalSystemEstimator", %}]
 Out[5]=

 In[6]:= Xinp = -UnitStep[t] + UnitStep[t - 1]; ics = {-2, 1};
 In[7]:= Xesr = OutputResponse[ SystemsModelDelete[\[ScriptL] /. v -> 5, None, -1], Join[{inp}, OutputResponse[{asys /. v -> 5, ics}, inp, {t, 0, 10}]], {t, 0, 10}];
 In[8]:= XPlot[esr, {t, 0, 10}, PlotStyle -> Dashed, PlotRange -> All, PlotLegends -> {"Yaw (\[Psi])", "Yaw rate (\[Psi]')"}]
 Out[8]=

 In[9]:= Xsr = StateResponse[{asys /. v -> 5, ics}, inp, {t, 0, 10}]
 Out[9]=

 In[10]:= XTable[Plot[{sr[[i]], esr[[i]]}, {t, 0, 5}, PlotStyle -> {Automatic, Dashed}, PlotLegends -> {"Actual", "Estimated"}, PlotRange -> All, PlotLabel -> Switch[i, 1, "Yaw Angle", _, "Yaw rate"]], {i, {1, 2}}]
 Out[10]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »