# Controllability

A car with two trailers is controllable. The approximately linearized model fails to reveal the controllability, while the affine model does. » The affine model.

 In:= Xassm = AffineStateSpaceModel[ {{0, 0, 0, 0, 0, 0}, {{ Cos[Subscript[\[Theta], 0]], 0 }, {Sin[Subscript[\[Theta], 0]], 0 }, {0, 1 }, {Tan[\[Phi]]/d, 0 }, {Sin[Subscript[\[Theta], 0] - Subscript[\[Theta], 1]]/ Subscript[d, 1], 0 }, {( Cos[Subscript[\[Theta], 0] - Subscript[\[Theta], 1]] Sin[ Subscript[\[Theta], 1] - Subscript[\[Theta], 2]])/Subscript[d, 2], 0 }}}, {x, y, \[Phi], Subscript[\[Theta], 0], Subscript[\[Theta], 1], Subscript[\[Theta], 2]}, Automatic, {Automatic, Automatic, Automatic, Automatic, Automatic, Automatic}, Automatic , SamplingPeriod -> None];

The linear model is not controllable.

 In:= Xssm = StateSpaceModel[assm]
 Out= In:= XControllableModelQ[ssm]
 Out= The affine model shows that the system is controllable.

 In:= XControllableModelQ[assm]
 Out= Simulate the affine system for a set of input signals.

 In:= XL = 1; W = 0.5; o = 0.65; d = 0.8; \!\(\*OverscriptBox[\(l\), \(_\)]\) = 0.2; \!\(\*OverscriptBox[\(w\), \(_\)]\) = 0.3;
 In:= X{Subscript[x, r], Subscript[y, r], Subscript[\[Phi], r], Subscript[\[Theta], r0], Subscript[\[Theta], r1], Subscript[\[Theta], r2]} = StateResponse[{assm /. {Subscript[d, 1] -> o + L, Subscript[d, 2] -> o + L}, {0, 0, 0, 0, 0, 0}}, {0.1, -Piecewise[{{0.1, 0 <= t <= 1}, {0.1, 3 <= t <= 4}}, 0]}, {t, 0, 350}];

Visualize its motion. Play AnimationStop Animation

## Mathematica

Questions? Comments? Contact a Wolfram expert »