Simulink

 

 

RLC Circuit

·       Type simulink in the MATLAB command window.

·       Go to File, New Model

·       Click on the Sources icon and drag a Pulse Generator onto the blank workspace figure

·       Go back to the Continuous block set and drag a Transfer Fcn block onto the workspace figure.  Click on the transfer function block and enter the RLC circuit parameters

Numerator: [1,0,1e6]

Denominator: [1,1000,1e6]

·       Drag the arrow head form the Pulse Generator to the Transfer Fcn Block.

·       Go to Sinks in the Simulink Library Browser drag a scope and a simout block to the figure.  Connect those in parallel to the output of the Transfer Fcn block.  To connect the second block (simout) to the output of the Transfer Fcn, click on the input arrow of the second block and drag it backwards to the line leading to the first block (Scope).

·       Click on the simout block and rename the output variable if desired and select Save format to be Structure with Time.

·       Select “Simulation start” or press the play button on the tool bar.

·       You can change the frequency of the input by clicking on the source.  You can view the output by clicking on the scope icon.  You may need to adjust the X and Y buttons to get a good display.

·       You can go to the workspace and look for your output variable (simout).  You can plot the output using this command:  plot(simout.time,simout.signals.values)

·       Go to Help -> demos and look at some other simulink examples.