# Find state space representation with 2 inputs and 2 outputs

I have no problem finding the transfer function with systems of 1 input and 1 output and then I can easily obtain the space state representation, but this exercise requires me to "Find the space state representation of the circuit, assuming the outputs are the currents in R1 and R2". How do I start thinking about this problem? • Write two equations, one each for i1 and i2 that depend on v1 and v2? – Daniel Feb 11 '17 at 17:31

A possible solution: Choosing state variables as current in the inductor and the voltage in the capacitor:

$$x_1 = i_L = i_1$$ $$x_2 = v_C$$

Applying KVL and KCL to the left mesh and top node, respectively:

$$v_1 - R_1x_1 -L\dot{x_1}-x_2=0$$ $$-x_1 + C\dot{x_2} + \frac{x_2-v_2}{R_2} = 0$$

Rearranging:

$$\dot{x_1}= -\frac{R_1}{L}x_1 -\frac{1}{L}x_2 + \frac{1}{L}v_1$$ $$\dot{x_2}=\frac{1}{C}x_1-\frac{1}{CR_2}x_2 + \frac{1}{CR_2}v_2$$

In standard state space representation: $$\mathbf{\dot{x}=Ax+Bu}$$ $$\mathbf{y = Cx+Du}$$

And, since that $i_2=\frac{x_2-v_2}{R_2}$:

$$\begin{bmatrix}\dot{i_1}\\\dot{v_c}\end{bmatrix}=\begin{bmatrix}-R_1/L&-1/L\\1/C&-1/CR_2\end{bmatrix}\begin{bmatrix}i_1\\v_c\end{bmatrix}+\begin{bmatrix}1/L&0\\0&1/CR_2\end{bmatrix}\begin{bmatrix}v_1\\v_2\end{bmatrix}$$

$$\begin{bmatrix}i_1\\i_2\end{bmatrix}=\begin{bmatrix}1&0\\0&1/R_2\end{bmatrix}\begin{bmatrix}i_1\\v_c\end{bmatrix}+\begin{bmatrix}0&0\\0&-1/R_2\end{bmatrix}\begin{bmatrix}v_1\\v_2\end{bmatrix}$$