To determine the step response, percentage overshoot, and steady-state error of the given unity feedback system in MATLAB, we first need to create the transfer function using the numerator and denominator coefficients.
main.m63 chars4 lines
This creates a transfer function object sys_tf
for our system.
To find the step response of the system using MATLAB, we can use the step
function and pass in the transfer function object.
main.m14 chars2 lines
This will generate the step response plot for the given system.
To find the percentage overshoot in MATLAB, we can use the stepinfo
function and pass in the transfer function object.
main.m71 chars3 lines
This will calculate and store the percentage overshoot of the system in the variable percent_overshoot
.
To find the steady-state error of the system in MATLAB, we can use the step
function and pass in a step function with a final value of 1.0. We can then use the stepinfo
function to extract the steady-state error from the RiseTime
and SettlingTime
fields of the output structure.
main.m206 chars9 lines
This code will simulate the system with the step input, and calculate the steady-state error by subtracting the final value of the output after the step has settled from the expected value of 1.0.
Overall code capturing all of the above steps:
main.m397 chars18 lines
gistlibby LogSnag