Control Design Toolbox - MapleSim Help

 Control Design Toolbox

New Features of the MapleSim Control Design Toolbox 6.4

 • New command for PID controller automatic tuning
 • Updates to existing PID tuning commands to choose the format of the returned controller parameters
 • Updates to existing control design commands to support the DynamicSystems parameters option, which is new in Maple 18
 • New commands for the automatic computation of design parameters, such as poles and weighting matrices, for state feedback control design
 • New commands for system manipulation (for example, determining the closed-loop equations of common feedback system configurations) and simplification (for example, eliminating the structurally non-minimal states of a system)
 >

PID automatic tuning

The PIDAuto command performs automatic tuning of a PID controller based on a single tuning parameter, Tc, which has the same order of magnitude as the desired time constant of the closed-loop. The time constant is proportional to the settling time of the system (first order approximation) and, therefore, provides a simple way to specify the desired closed-loop system response. This command can obtain the PID controller parameters for a wide range of plants, including unstable systems. The best-suited tuning method is automatically selected according to both the order and stability of the input system.  For instance, for stable higher order systems (order greater than 2), Skogestad internal model control (SIMC) tuning rules are applied.

 >

Design a PID controller for a system of order 7 with desired time constant Tc = 0.77.

 > $\mathrm{sys1}≔\mathrm{TransferFunction}\left(\frac{\left(1-0.3\cdot s\right)\cdot \left(1+0.08\cdot s\right)}{\left(s+1\right)\cdot \left(2\cdot s+1\right)\cdot \left(0.4\cdot s+1\right)\cdot \left(0.2\cdot s+1\right)\cdot {\left(0.05\cdot s+1\right)}^{3}}\right):$

 >
 PIDAuto: Using Skogestad IMC tuning rules
 ${\mathrm{pid1}}{:=}{{\mathrm{Record}}}_{{\mathrm{packed}}}{}\left({\mathrm{Kp}}{=}{2.077922078}{,}{\mathrm{Ki}}{=}{0.6493506494}{,}{\mathrm{Kd}}{=}{1.558441558}{,}{\mathrm{Tf}}{=}{0.01558441558}\right)$ (1.1)

Return a DynamicSystems  system object directly.

 >
 PIDAuto: Using Skogestad IMC tuning rules
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{1.590824759}{}{{s}}^{{2}}{+}{2.088041828}{}{s}{+}{0.6493506494}}{{0.01558441558}{}{{s}}^{{2}}{+}{s}}\end{array}\right$ (1.2)

Design a PID controller for an integrating process with desired time constant Tc = 1.0.

 >
 >
 PIDAuto: Using PIDUnstable
 ${\mathrm{pid2}}{:=}{{\mathrm{Record}}}_{{\mathrm{packed}}}{}\left({\mathrm{Kp}}{=}{2.}{,}{\mathrm{Ki}}{=}{1.}{,}{\mathrm{Kd}}{=}{0.}{,}{\mathrm{Tf}}{=}{0}\right)$ (1.3)

Return a DynamicSystems  system object directly.

 >
 PIDAuto: Using PIDUnstable
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{2.}{}{s}{+}{1}}{{s}}\end{array}\right$ (1.4)

PID tuning commands returned format

Existing PID tuning commands accept new options such as factored and returntype which are useful for specifying the way in which the controller parameters are returned. Use the option factored to return either the controller gains (proportional, integral, and derivative gain Kp, Ki, and Kd) or their factored version (proportional gain, integral time, and derivative time K, Ti, Td). Use the option returntype to return a record, a list or a system containing the controller parameters in either form or a DynamicSystems  system object . The updated commands are CohenCoon, DominantPole, GainPhaseMargin, ZNFreq, and ZNTimeModified.

 >
 >
 ${\mathrm{fotd3}}{:=}\left[{1.}{,}{1.414213562}{,}{1.}\right]$ (2.1)

By default, the CohenCoon command returns a list containing the PID controller gains Kp, Ki, and Kd.

 >
 ${\mathrm{pid_list}}{:=}\left[{2.152188309}{,}{1.079532192}{,}{0.7019962725}\right]$ (2.2)

Using the new options factored and returntype, the CohenCoon command can return a record containing the factored version of the PID controller gains.

 >
 ${\mathrm{pid_rcrd}}{:=}{{\mathrm{Record}}}_{{\mathrm{packed}}}{}\left({K}{=}{2.152188309}{,}{\mathrm{Ti}}{=}{1.993630504}{,}{\mathrm{Td}}{=}{0.3261779044}\right)$ (2.3)

By default, the DominantPole command returns a sequence of lists containing the controller gains ( Kp and Ki in this case) and the closed-loop poles.

 >
 ${\mathrm{pi_list}}{:=}\left[\frac{{47}}{{8}}{,}\frac{{91}}{{8}}\right]{,}\left[{-}\frac{{7}}{{8}}{,}{-}{3}{-}{2}{}{I}{,}{-}{3}{+}{2}{}{I}\right]$ (2.4)

Using the option returntype, the DominantPole command can return a DynamicSystems  system object directly.

 >
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{47}{}{s}{+}{91}}{{8}{}{s}}\end{array}\right$ (2.5)
 Support of parameters option Existing ControlDesign commands that accept DynamicSystems system objects as input now accept the parameters option. You can use this option to define numeric values for symbolic parameters existing in the system object. This option is the same as the DynamicSystems parameters option.  For examples of its use see the sections below.

State Feedback design parameters

Two new commands ComputePoles and ComputeQR help with the calculation of the pole locations for Ackermann's formula and the Q and R weighting matrices for LQR design.

ComputePoles

The Ackermann command calculates the state feedback gain required in order to place the closed-loop poles in the desired locations. The ComputePoles automatically computes these pole locations such that the closed-loop system response has a desired time constant, Tc.

 > $\mathrm{sys4}≔\mathrm{StateSpace}\left(\mathrm{Matrix}\left(\left[\left[1,f,3\right],\left[g,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{sys4}\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}& {f}& {3}\\ {g}& {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$ (4.1.1)
 >
 >
 >
 ${p}{:=}\left[{-}{1.124260354}{+}{3.158898890}{}{I}{,}{-}{1.124260354}{-}{3.158898890}{}{I}{,}{-}{10.}\right]$ (4.1.2)
 >
 ${\mathrm{Kc}}{:=}\left[\begin{array}{ccc}{3.522839239}& {0.6091131254}& {1.639596973}\end{array}\right]$ (4.1.3)

ComputeQR

The LQR command calculates the linear quadratic state feedback regulator (LQR) gain given the weighting matrices Q and R. The ComputeQR command automatically computes these weighting matrices Q and R to obtain a closed-loop system with desired time constant, Tc.

 >
 ${\mathrm{QRmat}}{:=}{\mathrm{Record}}{}\left({Q}{=}\left[\begin{array}{ccc}{1.}& {0.}& {0.}\\ {0.}& {1.}& {0.}\\ {0.}& {0.}& {1.}\end{array}\right]{,}{R}{=}\left[\begin{array}{c}{2.83828026835937}\end{array}\right]\right)$ (4.2.1)
 >
 ${\mathrm{Kc}}{:=}\left[\begin{array}{ccc}{1.72323935395080}& {0.712987014076495}& {3.18235779686362}\end{array}\right]$ (4.2.2)

System manipulation and simplification

The new commands for system manipulation and simplification are ControllerObserver, PIDClosedLoop, StateFeedbackClosedLoop, and ReduceSystem.

ControllerObserver

The ControllerObserver command calculates the equations of the subsystem comprised of a state feedback controller and an observer. This command is useful, for example, to construct an LQG controller comprised of an LQR state feedback controller and a Kalman observer. Use the closedloop option to obtain the closed-loop equations of the system with state feedback and observer.

 > $\mathrm{sys5}≔\mathrm{StateSpace}\left(\mathrm{Matrix}\left(\left[\left[0,1\right],\left[0,0\right]\right]\right),\mathrm{Matrix}\left(\left[\left[\mathrm{α}\right],\left[1\right]\right]\right),\mathrm{Matrix}\left(\left[\left[1,0\right]\right]\right),\mathrm{Matrix}\left(1,1\right)\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys5}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right); 2 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cc}{0}& {1}\\ {0}& {0}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{\mathrm{\alpha }}\\ {1}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cc}{1}& {0}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{0}\end{array}\right]\end{array}\right$ (5.1.1)

Define the numeric value for parameter $\mathrm{\alpha }$

 >

Design the LQR controller

 >
 ${W}{:=}{\mathrm{Record}}{}\left({Q}{=}\left[\begin{array}{cc}{1.}& {0.}\\ {0.}& {0.}\end{array}\right]{,}{R}{=}\left[\begin{array}{c}{1.27083333333333}\end{array}\right]\right)$ (5.1.2)
 >
 ${\mathrm{Kc5}}{,}{\mathrm{Kr5}}{:=}\left[\begin{array}{cc}{0.887065525145487}& {0.444353124522434}\end{array}\right]{,}\left[\begin{array}{c}{0.887065525145487}\end{array}\right]$ (5.1.3)

Design the Kalman observer

 > $\mathrm{G1}≔\mathrm{LinearAlgebra}:-\mathrm{IdentityMatrix}\left(\mathrm{sys5}:-\mathrm{statecount}\right):$
 >
 > $\mathrm{H1}≔\mathrm{Matrix}\left(\left[\left[1,0\right]\right]\right):$
 > $\mathrm{R1}≔\mathrm{Matrix}\left(\left[\left[2\right]\right]\right):$
 >
 ${\mathrm{Kobs}}{:=}\left[\begin{array}{c}{1.36803398874989}\\ {0.500000000000000}\end{array}\right]$ (5.1.4)

Obtain the LQG controller.

 >
 > $\mathrm{PrintSystem}\left(\mathrm{LQG}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 2 input\left(s\right); 2 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{y1_ref}}{}\left({t}\right){,}{\mathrm{y1_meas}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1_est}}{}\left({t}\right){,}{\mathrm{x2_est}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cc}{-}{3.1421650390408695}& {0.1112937509551315}\\ {-}{1.3870655251454873}& {-}{0.44435312452243425}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{cc}{1.7741310502909748}& {1.368033988749895}\\ {0.8870655251454874}& {0.5}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cc}{-}{0.8870655251454874}& {-}{0.44435312452243425}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{cc}{0.887065525145487421}& {0}\end{array}\right]\end{array}\right$ (5.1.5)

Obtain the LQG control system closed-loop equations.

 >
 > $\mathrm{PrintSystem}\left(\mathrm{clLQG}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right); 4 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{y1_ref}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right){,}{\mathrm{x1_est}}{}\left({t}\right){,}{\mathrm{x2_est}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cccc}{0}& {1}& {-1.77413105029097484}& {-0.888706249044868501}\\ {0}& {0}& {-0.887065525145487421}& {-0.444353124522434251}\\ {1.36803398874989490}& {0.}& {-3.14216503904086952}& {0.111293750955131499}\\ {0.500000000000000000}& {0.}& {-1.38706552514548731}& {-0.444353124522434251}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{1.77413105029097484}\\ {0.887065525145487421}\\ {1.77413105029097484}\\ {0.887065525145487421}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cccc}{1.0}& {0.0}& {0.0}& {0.0}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{0.0}\end{array}\right]\end{array}\right$ (5.1.6)

PIDClosedLoop

The PIDClosedLoop command calculates the closed-loop system equations of a feedback system with the controller Gc located in the forward path before the plant Gp and inside the feedback loop. The feedback system has unity negative feedback. This is a basic feedback structure commonly used for P/PI/PID control, hence the name of the command.

 >
 >
 >
 > $\mathrm{PrintSystem}\left(\mathrm{cl}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{y1_ref}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{{\mathrm{\omega }}}^{{2}}{}{A}{}{\mathrm{kp}}{}{s}{+}{{\mathrm{\omega }}}^{{2}}{}{A}{}{\mathrm{ki}}}{{{s}}^{{3}}{+}{2}{}{\mathrm{\omega }}{}{\mathrm{\theta }}{}{{s}}^{{2}}{+}\left({{\mathrm{\omega }}}^{{2}}{}{A}{}{\mathrm{kp}}{+}{{\mathrm{\omega }}}^{{2}}\right){}{s}{+}{{\mathrm{\omega }}}^{{2}}{}{A}{}{\mathrm{ki}}}\end{array}\right$ (5.2.1)
 >
 > $\mathrm{PrintSystem}\left(\mathrm{clnum}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{y1_ref}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{0.7200000000}{}{s}{+}{0.1440000000}}{{{s}}^{{3}}{+}{4.800000000}{}{{s}}^{{2}}{+}{2.160000000}{}{s}{+}{0.1440000000}}\end{array}\right$ (5.2.2)

Use the PIDClosedLoop command to access the controller output node through the augment_output option.

 >
 > $\mathrm{PrintSystem}\left(\mathrm{claug}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{y1_ref}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right){,}{\mathrm{u1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{{\mathrm{\omega }}}^{{2}}{}{A}{}{\mathrm{kp}}{}{s}{+}{{\mathrm{\omega }}}^{{2}}{}{A}{}{\mathrm{ki}}}{{{s}}^{{3}}{+}{2}{}{\mathrm{\omega }}{}{\mathrm{\theta }}{}{{s}}^{{2}}{+}\left({{\mathrm{\omega }}}^{{2}}{}{A}{}{\mathrm{kp}}{+}{{\mathrm{\omega }}}^{{2}}\right){}{s}{+}{{\mathrm{\omega }}}^{{2}}{}{A}{}{\mathrm{ki}}}\\ {{\mathrm{tf}}}_{{2}{,}{1}}{=}\frac{{\mathrm{kp}}{}{{s}}^{{3}}{+}\left({2}{}{\mathrm{kp}}{}{\mathrm{\omega }}{}{\mathrm{\theta }}{+}{\mathrm{ki}}\right){}{{s}}^{{2}}{+}\left({2}{}{\mathrm{ki}}{}{\mathrm{\omega }}{}{\mathrm{\theta }}{+}{\mathrm{kp}}{}{{\mathrm{\omega }}}^{{2}}\right){}{s}{+}{{\mathrm{\omega }}}^{{2}}{}{\mathrm{ki}}}{{{s}}^{{3}}{+}{2}{}{\mathrm{\omega }}{}{\mathrm{\theta }}{}{{s}}^{{2}}{+}\left({{\mathrm{\omega }}}^{{2}}{}{A}{}{\mathrm{kp}}{+}{{\mathrm{\omega }}}^{{2}}\right){}{s}{+}{{\mathrm{\omega }}}^{{2}}{}{A}{}{\mathrm{ki}}}\end{array}\right$ (5.2.3)

StateFeedbackClosedLoop

The StateFeedbackClosedLoop command calculates the closed-loop system equations of a plant with state feedback. This command requires the state feedback gain matrix Kc, but can also accept the feed-forward matrix Kr to support a state feedback structure with control law  ${u}_{c}=-{K}_{c}.x+{K}_{r}.r.$

 >
 ${\mathrm{Kc}}{,}{\mathrm{Kr}}{:=}\left[\begin{array}{ccc}{3.522839239}& {0.6091131254}& {1.639596973}\end{array}\right]{,}\left[\begin{array}{ccc}{2.54751899020608}& {0.536319787411807}& {-}{0.871519654544186}\end{array}\right]$ (5.3.1)
 >
 > $\mathrm{PrintSystem}\left(\mathrm{clsf}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{3 output\left(s\right); 3 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{y1_ref}}{}\left({t}\right){,}{\mathrm{y2_ref}}{}\left({t}\right){,}{\mathrm{y3_ref}}{}\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}{-}{9.568517717}& {0.17266062380000013}& {-}{1.918790919}\\ {-}{31.705553151}& {-}{1.4820181286}& {-}{15.756372757}\\ {-}{15.614196195000002}& {1.9544343730000002}& {-}{1.1979848650000005}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{ccc}{7.642556970618246}& {1.6089593622354208}& {-}{2.614558963632558}\\ {22.92767091185474}& {4.826878086706262}& {-}{7.843676890897674}\\ {12.737594951030411}& {2.681598937059035}& {-}{4.35759827272093}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{1.0}& {0.0}& {0.0}\\ {0.0}& {1.0}& {0.0}\\ {0.0}& {0.0}& {1.0}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{ccc}{0.0}& {0.0}& {0.0}\\ {0.0}& {0.0}& {0.0}\\ {0.0}& {0.0}& {0.0}\end{array}\right]\end{array}\right$ (5.3.2)

ReduceSystem

The ReduceSystem command simplifies a state-space system by detecting and removing its structural unobservable and uncontrollable states. These struturally non-minimal states may occur, for example, as a result of extracting a subsystem from a subset of its inputs and/or outputs. The reduced state-space system is structurally minimal, that is, contains a subset of the original system states but preserves its state structure and variable names. The input/output response of the reduced system is equivalent to the transfer function of the original system.

 >
 > $\mathrm{PrintSystem}\left(\mathrm{sys6}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 3 input\left(s\right); 4 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right){,}{\mathrm{u2}}{}\left({t}\right){,}{\mathrm{u3}}{}\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}{\mathrm{\delta }}& {0}& {-}{\mathrm{\phi }}& {\mathrm{\sigma }}\\ {3}& {0}& {0}& {3}\\ {1}& {0}& {-1}& {1}\\ {0}& {0}& {0}& {0}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{ccc}{5}& {z}& {-1}\\ {1}& {3}& {-}{x}\\ {0}& {2}& {y}\\ {0}& {0}& {z}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cccc}{1}& {0}& {3}& {5}\\ {-3}& {0}& {\mathrm{\sigma }}& {7}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {1}\end{array}\right]\end{array}\right$ (5.4.1)

Get a subsystem with inputs u1(t) and u2(t). This subsystem is uncontrollable and unobservable.

 >
 ${\mathrm{false}}{,}{\mathrm{false}}$ (5.4.2)

Get a structurally minimal system removing the non-minimal (structural uncontrollable and unobservable) states.

 >
 ${\mathrm{true}}{,}{\mathrm{true}}$ (5.4.3)
 > $\mathrm{PrintSystem}\left(\mathrm{redsys}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 2 input\left(s\right); 2 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right){,}{\mathrm{u2}}{}\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{x3}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cc}{\mathrm{\delta }}& {-}{\mathrm{\phi }}\\ {1}& {-1}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{cc}{5}& {z}\\ {0}& {2}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cc}{1}& {3}\\ {-3}& {\mathrm{\sigma }}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{cc}{1}& {0}\\ {0}& {1}\end{array}\right]\end{array}\right$ (5.4.4)

Verify the input/output response is not affected by the removed states.

 >
 ${\mathrm{true}}$ (5.4.5)