Matlab serie RLC step response plotter
About the project
I wrote this Matlab code to test a project I had to do for my Linear Systems module. We had to measure a human’s step response to a square wave, the wave would slide onto the screen and the user had to follow it with their mouse. After you average the input you had to work out what a 2nd order RLC circuit would have to look like to get a similar response. This Matlab code was part of my effort to investigate the effects of different component values on the output graph. After I receive my marks I may adjust the project little and release it as well.
Under damped case.
Over damped case.
Adjustable Settings
- Time range
- Resolution (how many points to use)
- Step size
- Value for Resistance
- Value for Capacitance
- Value for Inductance
Basic Equations
For a series RLC circuit we have two equations to help us determine how the circuit is going to react to the step. The first is the damping factor.

And the second is the resonance frequency.

For each different outcome of these equations a different reaction is expected.
Three Cases
Each case is identified by the resonance frequency and the damping factor. The equations were solved algebraically and coded into each case.
Over damped case
The damping factor is bigger than the resonance frequency.


Critically damped case
The damping factor is equal to the resonance frequency.

Under damped case
The damping factor is smaller than the resonance frequency.


The constants s1,2 and wd can be computed with these equations.

To get A1 and A2 we take the derivative of the (voltage) equation and solve simultaneously.
Summary
Matlab is a very powerful tool that can accomplish many things. Its unfortunately very expensive and can only really be used by universities and big companies. The plan is to convert this Matlab file to a Delphi program in the near future, so if you don’t have access to Matlab and think you can make use of a Delphi version, hang on, or alternatively e-mail me and tell me to hurry up!
References
Files
Series RLC response plotter m-file
Documentation
Series RLC response plotter documentation
Related:
1 Comment »
RSS feed for comments on this post. TrackBack URI



[…] Electronics: USB powered temperature display (Stage[2/5]) Matlab: Plot smoother Matlab: Series RLC response plotter PHP: flickr photo album PHP: last.fm chart draw […]