Electrical Engineering - State Space - Matlab

In summary, the problem involves analyzing a circuit with one capacitor and one inductor using state-space representation. The transfer function is given as G(s) = \frac{s}{2+\frac{1}{s}} and the question asks to plot the step response and frequency response using MATLAB commands. The individual is struggling with finding the state space representation for this circuit and is having trouble relating current to voltage. They are looking for help in solving the problem and applying what they have learned from a similar problem with different components.
  • #1
GreenPrint
1,196
0

Homework Statement



[itex]\dot{}[/itex]

I'm given the following circuit

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

Homework Equations





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];
B=[1/2;0];
C=[0 0];
D=0;
step(tf(ss(A,B,C,D)))

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:
Physics news on Phys.org
  • #2
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.
 

1. What is electrical engineering?

Electrical engineering is a branch of engineering that deals with the study and application of electricity, electronics and electromagnetism. It involves designing, developing, testing and maintaining electrical systems and devices.

2. What is state space analysis?

State space analysis is a mathematical method used to model and analyze the behavior of dynamic systems. It involves representing the system in terms of state variables, which describe the current state of the system, and input and output variables, which describe the inputs and outputs of the system.

3. What is Matlab?

Matlab is a high-level programming language and interactive environment used for scientific and engineering applications. It is widely used in electrical engineering for tasks such as data analysis, signal processing, and system simulation.

4. How is state space analysis used in electrical engineering?

State space analysis is used in electrical engineering to model and analyze the behavior of electrical systems. It allows engineers to predict the response of a system to different inputs and design controllers to achieve desired behavior.

5. Can you give an example of using Matlab for state space analysis in electrical engineering?

One example of using Matlab for state space analysis in electrical engineering is designing a controller for a motor. The state space model of the motor can be created in Matlab and then a controller can be designed to achieve desired speed or position of the motor. The performance of the controller can be simulated and analyzed using Matlab's tools.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
17
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
0
Views
517
  • Engineering and Comp Sci Homework Help
Replies
1
Views
327
  • Engineering and Comp Sci Homework Help
Replies
5
Views
784
Replies
2
Views
762
  • Quantum Physics
Replies
31
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
704
  • Engineering and Comp Sci Homework Help
Replies
9
Views
2K
Replies
2
Views
537
  • Advanced Physics Homework Help
Replies
1
Views
959
Back
Top