# State space model of third order circuit

I'm trying to derive a state space model for this circuit: -

simulate this circuit – Schematic created using CircuitLab

The circuit contains four energy storing elements, but is only of third order because $$\L_3\$$ is not sitting in a peripheral branch. Therefore, I understand that I need 3 state variables. I define these as

$$x_1 = i_1 \\ x_2 = i_2 \\ x_3 = V_o \\$$

However, when I try to find the associated differential equations for these state variables $$\L_3\$$ is causing me trouble. Writing mesh equations and using that $$\i_3 = i_2 - C_1\dot{x_3}\$$ yields

$$\begin{cases} -V_\text{in} + \dot{x_1}L_1+x_1R_1+\color{red}{L_3(\dot{x_1}-\dot{x_2})} = 0 \\ \\ \dot{x_2}L_2+x_2R_2+x_3+ \color{red}{L_3(\dot{x_2}-\dot{x_1})} = 0 \\ \\ -x_3+i_3R_3 = -x_3+R_3(x_2-C_1\dot{x_3})=0\end{cases}$$

The red terms in the equations are what is causing me trouble, because to find the associated differential equations it requires that only one of the state variables are differentiated. Both as can be seen, two of the state variables are differentiated.

How can I tackle this problem?

Rewriting your system of equations in matrix form yields $$T\cdot \dot{x} = A\cdot x + B\cdot V_{in}$$ where $$\x\$$ is the state vector and $$\T, A, B\$$ are matrices of appropiate dimensions. Assuming that $$\T\$$ is invertable allows us to solve for $$\\dot{x}\$$ in terms of $$\x\$$ and $$\V_{in}\$$ by multiplying both sides by the inverse of $$\T\$$ resulting in $$\dot{x} = T^{-1}\cdot A\cdot x + T^{-1}\cdot B\cdot V_{in} .$$ So in order to get the desired form of the state space equation requires you to solve your system of equations for the state derivatives (i.e. solving a system of linear equations for a linear circuit).