1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Electrical Engineering - State Space - Matlab

  1. Jan 26, 2014 #1
    1. The problem statement, all variables and given/known data


    I'm given the following circuit

    http://imagizer.imageshack.us/v2/800x600q90/43/bwka.png [Broken]

    2. Relevant equations

    3. The attempt at a solution

    I come up with the transfer function to be [itex]G(s) = \frac{s}{2+\frac{1}{s}}[/itex]. The question asks me to

    Plot step response using MATLAB step command and frequency response using bode command. Can you interpret the frequency response in terms of low pass, band pass or high pass filters for the two circuits?

    It's been a while since I have messed around with MATLAB and I seem to be struggling with finding the state space representation of this circuit. I solved a similar problem with a voltage source, two resistors, one capacitor, and one inductor using state representation without issue. The problem is that I'm not exactly sure how to apply this technique to this circuit because there is only one capacitor. I know that for state space representation with two variables

    [itex]\stackrel{.}{x} = Ax + Bu[/itex]
    [itex]y = Cx + Bv[/itex]

    For the circuit I set the current through the inductor [itex]i_{L}[/itex] to be [itex]x_{1}[/itex]. Because [itex]V_{L} = L \frac{d I_{L}}{dt} = L \stackrel{.}{x_{1}}[/itex]. Since [itex]L = 1 H[/itex] I can state that [itex]V_{L} = \dot{x_1}[/itex], which is also equal to [itex]v_{O}(t)[/itex].

    I use nodal analysis and assume that the current through the inductor is going towards ground (which I took to be the bottom of the circuit near the negative lead of the voltage source), the current through the capacitor with the output voltage [itex]v_{o}(t)[/itex] across to be going from the top node to ground, and finally the current from the voltage source across the [itex]1 Ω[/itex] resistor to be going into the node. This resulted in the following equation.

    [itex]\frac{v_{i}(t) - \dot{x_{1}}}{1 Ω} = x_{1} + \dot{x_{1}}[/itex]

    Solving for [itex]\dot{x_{1}}[/itex] I get

    [itex]2\dot{x_{1}} = v_{i}(t) + x_{1}[/itex]
    [itex]\dot{x_{1}} = \frac{1}{2}x_{1} + \frac{1}{2}v_{i}(t)[/itex]

    I seem to be having some trouble because I'm unsure how to solve for the output equation [itex]v_{o}(t)[/itex] in terms of the current through the inductor [itex]x_{1}[/itex]. I know that [itex]v_{o}(t) = \dot{x_{1}}[/itex] but that doesn't really help me because I need to get the equation in terms of [itex]x_{1}[/itex] and not [itex]\dot{x_{1}}[/itex]

    When I solved the similar problem I got an answer of the form

    [itex][\stackrel{\dot{x_{1}}}{\dot{x_{2}}}] = [\stackrel{-\frac{1}{2}}{1} \stackrel{-1}{0}][\stackrel{x_{1}}{x_{2}}] + [\stackrel{\frac{1}{2}}{0}]v_{i}(t)[/itex]
    [itex]v_{o}(t) = [0 1][\stackrel{x_{1}}{x_{2}}][/itex]

    Using MATLAB I then did the following to get the step response:

    A=[-1/2 0;0 0];
    C=[0 0];

    I'm not sure how I can apply what I learned from a similar problem to this problem because this problem only has one inductor and I'm not sure if these MATLAB functions will still work with only one variable.

    Thanks for any help.
    Last edited by a moderator: May 6, 2017
  2. jcsd
  3. Jan 27, 2014 #2


    User Avatar
    Gold Member

    The problem is you're trying to relate current to voltage, which can get difficult. It would be easier to set the voltage as your state variable.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted