ControlDesign[StateFeedback]

 Ackermann
 calculate the state feedback gain for single-input systems using Ackermann's formula

 Calling Sequence Ackermann(sys, p, opts) Ackermann(Amat, Bmat, p, opts)

Parameters

 sys - System; system object p - list; list of desired closed-loop poles (real or complex). Complex poles including those containing symbolic parameters must be given in complex conjugate pairs. All symbolic parameters in the list are assumed to be real. Amat - Matrix; system matrix of a state-space system Bmat - Matrix or Vector; input matrix of a state-space system opts - (optional) equation(s) of the form option = value; specify options for the Ackermann command

Options

 • return_Kr =  true or false
 True means return the direct gain ${K}_{r}$. The returned value becomes a sequence (${K}_{c}$, ${K}_{r}$). The system must be specified with a system object sys. The default value is false.
 • parameters = {list, set}(name = complexcons)
 Specifies numeric values for the parameters of sys. These values override any parameters previously specified for sys. The numeric value on the right-hand side of each equation is substituted for the name on the left-hand side in the sys equations. The default is the value of sys given by DynamicSystems:-SystemOptions(parameters).

Description

 • The Ackermann command calculates the state feedback gain ${K}_{c}$ for single-input systems using Ackermann's formula to place the closed-loop poles in the desired locations.
 • The system sys is a continuous or discrete-time linear system object created using the DynamicSystems package. The system object must be in state-space (SS) form and must be controllable. If Amat and Bmat matrices are specified, the (Amat, Bmat) pair must be controllable.
 • The closed-loop system matrix is then $\mathrm{Ac}=A-B·{K}_{c}$ where ${K}_{c}$ is the calculated feedback gain.
 • When the syntax Ackermann(sys, p, return_Kr) is used, the feed-forward or direct gain ${K}_{r}$ is computed as follows:

$\left(C-\mathrm{D}·{K}_{c}\right)·\frac{1}{-A+B·{K}_{c}}·B+\mathrm{D}$ (continuous time)

$\left(C-\mathrm{D}·{K}_{c}\right)·\frac{1}{-A+I+B·{K}_{c}}·B+\mathrm{D}$ (discrete time)

 • If sys contains structural uncontrollable states, use ReduceSystem to remove them before computing the state feedback gain ${K}_{c}$.

Examples

 > $\mathrm{with}\left(\mathrm{ControlDesign}\right):$
 > $\mathrm{with}\left(\mathrm{DynamicSystems}\right):$

Numeric example

 • State-space system matrix Amat and input matrix Bmat (5 states and 1 input)
 > $\mathrm{Amat}≔\mathrm{Matrix}\left(\left[\left[1,-2,3,-5,12\right],\left[0,4,-1,2,-3\right],\left[2,5,7,-4,3\right],\left[-2,4,3,8,7\right],\left[3,4,1,-4,7\right]\right]\right):$
 > $\mathrm{Bmat}≔\mathrm{Matrix}\left(\left[\left[3\right],\left[9\right],\left[5\right],\left[4\right],\left[6\right]\right]\right):$
 • Desired poles
 > $\mathrm{p1}≔\left[-1+I,-0.1,-2.44,-1-I,-7.77\right]:$
 • Obtain the state feedback gain Kc:
 > $\mathrm{Kc}≔\mathrm{StateFeedback}:-\mathrm{Ackermann}\left(\mathrm{Amat},\mathrm{Bmat},\mathrm{p1}\right)$
 ${\mathrm{Kc}}{≔}\left[\begin{array}{ccccc}{-3.367696219}& {3.289423763}& {4.030559336}& {8.644197464}& {-5.820218623}\end{array}\right]$ (1)
 • Verify the closed-loop system matrix has the desired poles
 > $\mathrm{LinearAlgebra}:-\mathrm{Eigenvalues}\left(\mathrm{Amat}-\mathrm{Bmat}·\mathrm{Kc}\right)$
 $\left[\begin{array}{c}{-7.77000009752235}{+}{0.}{}{I}\\ {-2.43999927357362}{+}{0.}{}{I}\\ {-1.00000013420824}{+}{0.999999523527025}{}{I}\\ {-1.00000013420824}{-}{0.999999523527025}{}{I}\\ {-0.100000368487564}{+}{0.}{}{I}\end{array}\right]$ (2)

Symbolic example

 • System object sys with symbolic entries (3 states, 1 input, 3 outputs)
 > $\mathrm{sys}≔\mathrm{StateSpace}\left(\mathrm{Matrix}\left(\left[\left[1,y,3\right],\left[x,4,-1\right],\left[2,5,7\right]\right]\right),\mathrm{Matrix}\left(\left[\left[3\right],\left[9\right],\left[5\right]\right]\right),\mathrm{Matrix}\left(\left[\left[1,0,0\right],\left[0,1,0\right],\left[0,0,1\right]\right]\right),\mathrm{Matrix}\left(3,1\right)\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{3 output\left(s\right); 1 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right){,}{\mathrm{y2}}{}\left({t}\right){,}{\mathrm{y3}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right){,}{\mathrm{x3}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{ccc}{1}& {y}& {3}\\ {x}& {4}& {-1}\\ {2}& {5}& {7}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{3}\\ {9}\\ {5}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{0}\\ {0}\\ {0}\end{array}\right]\end{array}\right$ (3)
 • Desired poles
 > $\mathrm{p2}≔\left[-4,-5+3I,-5-3I\right]$
 ${\mathrm{p2}}{≔}\left[{-4}{,}{-5}{+}{3}{}{I}{,}{-5}{-}{3}{}{I}\right]$ (4)
 • Obtain the state feedback gain Kc and the feed-forward gain Kr:
 > $\mathrm{Kc},\mathrm{Kr}≔\mathrm{StateFeedback}:-\mathrm{Ackermann}\left(\mathrm{sys},\mathrm{p2},'\mathrm{return_Kr}'=\mathrm{true},'\mathrm{parameters}'=\left[x=0,y=2\right]\right)$
 ${\mathrm{Kc}}{,}{\mathrm{Kr}}{≔}\left[\begin{array}{ccc}{4.383962009}& {0.2488707000}& {2.121655535}\end{array}\right]{,}\left[\begin{array}{ccc}{3.08169350000358}& {0.648777578948122}& {-1.05426356579070}\end{array}\right]$ (5)
 • Verify the closed-loop system matrix has the desired poles
 > $\mathrm{sys}:-a≔\mathrm{eval}\left(\mathrm{sys}:-a,\left[x=0,y=2\right]\right):$
 > $\mathrm{eigen}≔\mathrm{LinearAlgebra}:-\mathrm{Eigenvalues}\left(\mathrm{sys}:-a-\mathrm{sys}:-b·\mathrm{Kc}\right)$
 ${\mathrm{eigen}}{≔}\left[\begin{array}{c}{-5.00000000205003}{+}{2.99999999901668}{}{I}\\ {-5.00000000205003}{-}{2.99999999901668}{}{I}\\ {-3.99999999789996}{+}{0.}{}{I}\end{array}\right]$ (6)

Use ReduceSystem

 > $\mathrm{sys1}≔\mathrm{StateSpace}\left(\mathrm{Matrix}\left(\left[\left[4,0,-3,5\right],\left[3,0,0,3\right],\left[1,0,-1,1\right],\left[0,0,0,0\right]\right]\right),\mathrm{Matrix}\left(\left[\left[1\right],\left[3\right],\left[2\right],\left[0\right]\right]\right),\mathrm{Matrix}\left(\left[\left[1,0,3,5\right],\left[-3,0,5,7\right]\right]\right),\mathrm{Matrix}\left(\left[\left[1\right],\left[0\right]\right]\right)\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys1}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 1 input\left(s\right); 4 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right){,}{\mathrm{y2}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right){,}{\mathrm{x3}}{}\left({t}\right){,}{\mathrm{x4}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cccc}{4}& {0}& {-3}& {5}\\ {3}& {0}& {0}& {3}\\ {1}& {0}& {-1}& {1}\\ {0}& {0}& {0}& {0}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{1}\\ {3}\\ {2}\\ {0}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cccc}{1}& {0}& {3}& {5}\\ {-3}& {0}& {5}& {7}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{1}\\ {0}\end{array}\right]\end{array}\right$ (7)
 • Desired poles
 > $\mathrm{p3}≔\left[-a+I\cdot 3,-a-I\cdot 3,-b+I\cdot 9,-b-I\cdot 9\right]$
 ${\mathrm{p3}}{≔}\left[{-}{a}{+}{3}{}{I}{,}{-}{a}{-}{3}{}{I}{,}{-}{b}{+}{9}{}{I}{,}{-}{b}{-}{9}{}{I}\right]$ (8)
 • Get the state-feedback gain
 > $\mathrm{Kc}≔\mathrm{StateFeedback}:-\mathrm{Ackermann}\left(\mathrm{sys1},\mathrm{p3}\right)$
 • Remove the uncontrollable states if possible. ReduceSystem will remove the structural uncontrollable states.
 > $\mathrm{rsys}≔\mathrm{ReduceSystem}\left(\mathrm{sys1},'\mathrm{reducedtype}'=\mathrm{controllable}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{rsys}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 1 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right){,}{\mathrm{y2}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right){,}{\mathrm{x3}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{ccc}{4}& {0}& {-3}\\ {3}& {0}& {0}\\ {1}& {0}& {-1}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{1}\\ {3}\\ {2}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{1}& {0}& {3}\\ {-3}& {0}& {5}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{1}\\ {0}\end{array}\right]\end{array}\right$ (9)
 • Verify the resulting subsystem is controllable
 > $\mathrm{Controllable}\left(\mathrm{rsys},'\mathrm{method}'=\mathrm{rank}\right)$
 ${\mathrm{true}}$ (10)
 • Desired poles for the controllable subsystem
 > $\mathrm{p4}≔\left[-a,-b+I\cdot 9,-b-I\cdot 9\right]:$
 > $\mathrm{Kc}≔\mathrm{StateFeedback}:-\mathrm{Ackermann}\left(\mathrm{rsys},\mathrm{p4}\right)$
 ${\mathrm{Kc}}{≔}\left[\begin{array}{ccc}{-}\frac{{1}}{{6}}{}{a}{}{{b}}^{{2}}{-}\frac{{4}}{{3}}{}{a}{}{b}{-}\frac{{2}}{{3}}{}{{b}}^{{2}}{-}\frac{{95}}{{6}}{}{a}{-}\frac{{14}}{{3}}{}{b}{-}\frac{{185}}{{3}}& {-}\frac{{1}}{{18}}{}{a}{}{{b}}^{{2}}{-}\frac{{9}}{{2}}{}{a}& \frac{{1}}{{6}}{}{a}{}{{b}}^{{2}}{+}\frac{{2}}{{3}}{}{a}{}{b}{+}\frac{{1}}{{3}}{}{{b}}^{{2}}{+}\frac{{91}}{{6}}{}{a}{+}\frac{{10}}{{3}}{}{b}{+}\frac{{97}}{{3}}\end{array}\right]$ (11)

References

 [1] T. Kailath, Linear Systems, Prentice-Hall, 1980.
 [2] C. T. Chen, Linear System Theory and Design, 3rd Ed., Oxford University Press, 1999.