Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Use of state space equations to model a dynamic system

  1. Jul 14, 2009 #1
    Hello,

    I enclose a jpeg of the circuit and two simulink jpeg files. The first mdl file - First Test circuit sucessfully models the circuit. The second one where I attempt to model the circuit from its state space equation does not. Can anyone help me to create a correct state space model.

    I can only upload jpegs so the mdl file diagrams have been saved as jpegs.

    I am aware that matlab has a block for state space equations.

    Kind regards,

    Cyclops
     

    Attached Files:

  2. jcsd
  3. Jul 14, 2009 #2
    The second one is already in a state space form. What do you mean by remodeling from State space again?
     
  4. Jul 15, 2009 #3
    Dear Trambolin,

    I am trying to obtain the circuit circuit by both methods. The two outcomes should be the same in matlab and they are not. The state variable for circuit current is x1 in my working out shown in PDF.
    I enclose a zip file with two simulink files and a pdf which shows my working out.

    Kind regards,

    Kieran A. Murray
     

    Attached Files:

  5. Jul 15, 2009 #4
    cyclops,

    I tried to understand what you try to ask but it doesn't makes sense to me. I would start from your integro-differential equation and define my states as [tex]\int{i(t)dt} = x_1(t), i(t) = x_2(t)[/tex]

    Then the rest is basically the same, I have to say that state space representation is nothing but a first order ODE version of the very same equations. I mean,

    [itex]
    \begin{align*}
    \dot x_1(t) & = x_2(t)\\
    \dot x_2(t) & = \frac{1}{L}\left( \frac{-1}{C}x_1(t) - Rx_2(t) + V_s\right)
    \end{align*}
    [/itex]

    If you convert them to matrix notation,

    [itex]
    \begin{pmatrix}\dot x_1\\\dot x_2\end{pmatrix} =
    \begin{bmatrix}0 &1\\-\frac{1}{LC} &-\frac{R}{L}\end{bmatrix}
    \begin{pmatrix}x_1\\x_2\end{pmatrix}+
    \begin{bmatrix}0 \\\frac{1}{L}\end{bmatrix}V_s
    [/itex]

    Then if you want to observe the current which is our second state you define your output matrix as

    [itex]y = \begin{bmatrix}0 &1\end{bmatrix}\begin{pmatrix}x_1\\x_2\end{pmatrix}[/itex]
     
  6. Jul 15, 2009 #5
    Dear trambolin,

    How do you implement the observation of the current in Matlab using integrators for the state space equation. The result should be the same as for the first circuit First circuit.mdl which observes the current by solving directly from the integro-differential equation. When I tried to implement this in my state space solver the solution was NOT the same. Running both simulations should give the same result as viewed in the Scope. It does not.
     
  7. Jul 16, 2009 #6
    Yes but I wish I could understand what you did in the second case. I don't understand what you mean as a state space method. What I did is also state space method. Why don't you like it?

    Can you type it at least to reduce the handwriting confusion? Also the initial conditions of the integrators was not the same...
     
  8. Jul 16, 2009 #7
    Dear trambolin,

    Using your equations, the state variable x2 is the inductor current in the circuit. I am trying to use integrators to solve the first order differential equation represented by the bottom line of your state space equation. This does not seem to work as it gives a different result to the second order differential equation that is obtained for the inductor current if we start from an integro-differential equation. The equations are correct. My implementation in matlab using integrators to solve the equation for the inductor current using the state space method must be wrong as it gives a different answer to the integrator solution based on the integro-differential equations which I got from a book. I will send workings later on a pdf.

    Kind regards,

    Kieran A. Murray
     
  9. Jul 19, 2009 #8
    Dear Trambolin,

    I have shown all my workings for the equations on a document herein inclosed. Your state space equations create two first order equations from a second order equation. Using the state variables as inductor current and capacitor voltage should also be correct because as far as I understand the basis of this technique is to describe the energy of a system and you will need capacitor voltage and inductor current to do this. I have shown the outputs from matlab and they are different for the same thing - circuit current.

    Kind regards,

    Cyclops
     

    Attached Files:

  10. Jul 20, 2009 #9
    Dear Trambolin,

    After a couple of hours work this weekend and another go at it this morning I have come up with some sort of matlab state space model which will give the same output as the matlab integro-differential model. Thanks for your help as it always helps to have someone to work off and you confirmed that I was not completely on the wrong track. Having said that, there was a basic error in my equations as in the integro-differential part I divided across by the differentiator operation and for the step function I came out with 1 which of course is wrong. I include the two diagrams of the matlab files and I will update my workings later if anyone is interested. I intend to give this state-space thing a bit of a bash and so I might have more queries in future. Thanks for your help

    The output from both models is the capacitor voltage. The zip file contains both models.

    Kind regards,

    Cyclops
     

    Attached Files:

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Use of state space equations to model a dynamic system
  1. Systems of equations (Replies: 2)

Loading...