# How to identify the state variables of a circuit?.

1. Oct 6, 2012

### mt1200

Hi, it's me again, as you may know I've always have had a very hard time with circuit analysis.

How can you possibly know which states variables are you suppoused to use in second or third order circuits?.

Let's say you have to do the following exercise:

If you want to obtain a state space model for Vg(t) and V2, what would you do?.

I would try to apply some KVL and KCL, but then what?. What variable are you supposed to solve for?. if you derive some variables you may not end up with the circuit solution for V2

2. Oct 6, 2012

### rootX

There is no unique way of picking state variables. You can write the differential equation and pick the state variables here or
Williams, R. L., and Lawrence, D. A., Linear State-Space Control Systems, John Wiley & Sons, 2007.

3. Oct 6, 2012

### mt1200

But the system may become impossible to solve if I pick some random state variables I want.

4. Nov 2, 2012

### Hechima

In addition to choosing a state variable for each element that stores energy (the two capacitors and the one inductor), you should also consider that your state space model may
look something like this:

State: X1, X2, X3

$\frac{d}{dt}X_{1}=aX_{1}+bX_{2}+cX_{3}$
$\frac{d}{dt}X_{2}=eX_{1}+fX_{2}+gX_{3}$
$\frac{d}{dt}X_{3}=hX_{1}+iX_{2}+jX_{3}$

You will need a first order differential equation for each state variable, so I would recommend assigning state variables based on how inductors and capacitors relate current and voltage:

$i_{c} = C\frac{dV}{dt}$
$v_{L} = L\frac{di}{dt}$

I would recommend that you use these relations to solve for a first derivative for each capacitor and inductor. In each equation, the voltage or current variable being differentiated will be a suitable state variable.

Once you choose your state variables, you should be able to eliminate all other variables using KVL and KCL etc.