State Space Equations

Discussion in 'Homework Help' started by tquiva, Apr 17, 2011.

  1. tquiva

    Thread Starter Member

    Oct 19, 2010
    176
    1
    Hi could someone please help me with the following problem. I don't know exactly how to go about finding the state space equations of a given circuit. Could someone please assist me along with the steps I should first proceed with. Should I first find the output, out(t), of this circuit?
     
  2. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    Somewhat curious circuit. Is this exactly shown as in the original problem?

    The parallel R/L branch in series with the input connects to the positive input of the op-amp. If the op-amp is ideal then there is no current flow into the +ve terminal. I would expect to see an additional branch off the +ve terminal which permits input current to flow to ground (say).
     
  3. tquiva

    Thread Starter Member

    Oct 19, 2010
    176
    1
    Yes, this is the exact problem. If the + terminal of the op-amp has no current flow, then that means the voltage is zero. So does this mean I would also set the - terminal to a zero voltage also?

    I solved for out(t) by adding current sources where applicable for the initial condition elements. For the inductor, I added a current above it pointing to the right and called it Io*u(t)=Io/s. The second current I added was below the capacitor pointing to the left, and called it C*Vo*dirac(t)=CVo.

    Afterwards, I have these matrices:
    mat=[ (1/R+sC) -(sC); (-1/R-1/sL)]
    vec=[CVo; in(-1/R-1/sL)-Io/s]

    All I need to do now is to input those matrices into Matlab to obtain out(t).

    Is my approach correct? And if it is, how can I find the state space equations after this?
     
  4. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    Personally I wouldn't bother with a solution since it's a poorly formulated problem.

    If it's an assignment I'd challenge the prof / tutor to explain the anomaly &/or recast the problem.
     
  5. tquiva

    Thread Starter Member

    Oct 19, 2010
    176
    1
    Are you positively sure?

    Maybe I'll stop by my prof's for office hours. But what exactly is wrong with the problem?
     
  6. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    Assuming the amplifier is ideal, this is my interpretation.

    The parallel R/L branch doesn't have any current so it doesn't matter if it is in the circuit or not. The same voltage in(t) appears either side of the branch. The R/L branch impedance can therefore be excluded from the analysis.

    The circuit then reduces to a first order (-20dB/decade) type with a cut-off of 1/(2πRC).

    DC gain=∞
    High pass gain=1

    EDIT: Maybe the prof is testing your understanding of the physical reality ....
     
  7. steveb

    Senior Member

    Jul 3, 2008
    2,433
    469
    I think this circuit is ok, at least for analysis purposes. I can't be sure because I'm not familiar with this circuit and haven't worked out the equations yet. The coil current is able to flow through the resistor. And, the coil current can change if voltage is applied to the input.

    If a step input is applied, then there is a voltage difference across the coil. This then implies that current can change in the coil because v=L di/ dt. Eventually the opamp terminal voltage will equal the input voltage and then the inductor current will dissipate in the resistor with time constant L/R. So it's meaningful to talk about a step response which includes effects of the coil, hence making a second order system.

    I'm still trying to resolve how the power/energy is conserved, so I'm not sure there isn't a paradox here. Still I would run the equations and try to figure out from there. I'll look at this more later.

    EDIT: I think the way to resolve the paradox here is to allow the coil to be an inductive transducer. This then allows external energy in.
     
    Last edited: Apr 18, 2011
  8. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    Steve,

    If you simulate this as a time domain problem with an ideal op-amp, the issue still exists, regardless of the drive waveform.

    Not sure how one then reconciles the anomaly.

    I don't know what you mean by the term "inductive transducer" - is that a transformer?
     
  9. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    I would accept the situation where the inductor is, for instance, the secondary of a current transformer and the circuit stimulus is the primary side current.

    One could then dispense with the input(?) in(t) to the left and perhaps tie that point to ground.

    This would remove the anomaly from my perspective, and one could come up with a relationship between the induced current Io and the output voltage out(t).
     
  10. steveb

    Senior Member

    Jul 3, 2008
    2,433
    469
    Yes, I agree there is an issue here. It's not clear how to get energy into the input.

    Two thoughts come to mind. First, any stored energy in the inductor due to initial conditions, can still affect the output, I think. Second, the inductor could be a model for a transducer. A transducer could be a transformer, as you say, or maybe a microphone or magnetic field (i.e. changing flux) sensor etc.
     
    Last edited: Apr 18, 2011
  11. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    Thanks Steve - agreed on the initial stored energy thought as well.

    I guess the annotations shown on the OP's schematic [viz. Io and Vo] anticipated that consideration of stored energy in both the inductor and the capacitor.
     
  12. steveb

    Senior Member

    Jul 3, 2008
    2,433
    469
    Aside from the questionable aspects of the circuit, it seems we never did fully address some parts of your question.

    There is a bit of an art to finding state space equations in general, particularly for nonlinear systems. Still, you can work in the linear regime for this opamp and some general rules can be discovered with experience. In this case, the problem helps identify the state variables for you, but even if it didn't, it's quite common that capacitor voltages and inductor currents will be state variables.

    Rather than focus on the output variables, try to discover the state variables and generate the state rate equations first. Then it's usually easy to find the output equations you are interested in.

    So here, we might start with the capacitor equation as follows:

    i_C=-C{{dV_C}\over{dt}}

    Using the simple ideal opamp properties, the current is easily found in terms of the opamp input terminal voltages (which are assumed to be equal). This leads to the following.

    {{v_+}\over{R}}=-C{{dV_c}\over{dt}}

    Now the v+ terminal voltage can be expressed in terms of the input voltage and the inductor current (which is a state variable), as follows.

    {{v_{in}+i_L R}\over{R}}=-C{{dV_c}\over{dt}}

    The above equation now becomes the basis for one of the state equations. Now, why do I stop here, and claim that this equation is what you want? Simply because we now have an equation for the rate of change for a state variable, and this equation is only in terms of circuit parameters (R and C), state variables (inductor current) and input variables (input voltage). This is the basic standard form of state space equations. You express the state variable derivatives as functions of input variables, state variables and parameters.

    Next, we need the rate equation for the inductor current. Well, we know the inductor equation as follows.

    L{{di_L}\over{dt}}=v_L

    As we have been discussing, no current can flow into the opamp input terminal, so the inductor current must flow through the resistor, which then allows the resistor to generate the inductor voltage. Hence we get the following.

    L{{di_L}\over{dt}}={{-i_L}{R}}

    Well, now we have an equation only in terms of inputs, states and parameters, so we are done. The issue t_n_k has mentioned can now be seen here. The state equation of the input inductor section does not have a source. Hence, it's not clear how to drive the inductor, and once the energy dissipates from the inductor, the inductor no longer has any relevance to the circuit response. So, this seems odd.

    Still, you can generate two state space equations, put them in standard form and generate a matrix equation from this. Then the "ss" command in Matlab allows you to express these equations in state space form.

    See if you can generate the A, B, C and D matrices for this system. I think the only relevant output equation would be for Vout, but you are free to identify other output variables of interest, including state variables if you wish. Remember, the power of the state space representation is that any interesting output variable can be expressed as a function of the state variables and input variables.
     
Loading...