Question: % % Lab 2 _ Ex 1 . m % This script simulates an RLC simulink model. % Alex Gregg, 2 0 1 9 .
LabExm
This script simulates an RLC simulink model.
Alex Gregg,
A few important rules:
DO NOT MODIFY THIS SCRIPT OR THE ACCOMPANYING FUNCTIONS.
For this problem, You are ONLY being assessed on your simulink model.
You are being assessed on your ability to create a model which
is compatible with preexisting simulation code. If your model
cannot generate the correct output plots with this code, then you
need to modify your model, not the code!
DO NOT HARDCODE parameter values. This script generates some
parameters eg R L C Z etc You must use these parameters in your
gain blocks, integrator blocks, etc We will check whether you
have hardcoded values in the integrator blocks bad or correctly
used the outputs of the setupsimex function.
A sample output has been provided for you to check your results.
Housekeeping
Close all windows, clear the workspace, clear the command line
close all;
clearvars;
clc;
Setup the simulation
Call a function which defines the model and simulation parameters and
returns these to the workspace. These parameters will then be available
to simulink to use. This function takes no inputs.
RLCuZtfinal setupsimex;
Simulate the model rotmsdslx
Use the sim function to simulate the model rlcslx Store the
simulation outputs the to workspace" blocks in a structure called
"results".
results simrlcslx;
Plot the results
Call a function to plot the simulation results. This function takes the
results structure from the sim function as an input and uses it to plot
the results in a nice way. This function has no outputs it just produces
a plot
plotresultsexresults;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
