Plotting Output Response Curve with Unit Steps: A Matlab Guide

In summary: ProgrammingIn summary, the individual is seeking assistance with plotting an output response curve for a second-order system with different damping ratios. They also want to know how to use a for loop to generate step responses and how to create an m-file to obtain the response. They are also interested in creating a 3D plot and using MATLAB to calculate rise time, peak time, settling time, and maximum overshoot. They are advised to seek help from their professor or utilize resources such as textbooks and tutorials for learning MATLAB. They are also provided with links to guides on plotting, using a for loop, creating an m-file, and producing 3D plots in MATLAB. Additionally, a Wikibook on using MATLAB for control systems is recommended
  • #1
lukus09
32
0
How do i plot an output response curve when input unit steps are (undamped natural frequency is normalised to 1):

damping ration = 0, 0.1, 0.4,0.6,0.8,0.9 1 and 2

1) how do i plot a 2d plot for all curves on same graph. Time scale 0 - 10, steps of 0.2 seconds.
2) How do i make use of a 'for loop' to generate step response for the damping ratios,
3) How do i produce an m file to obtain response.
4) how can i produce a 3d plot
5)how do i produce a Matlab program to get rise time, peak time, settling time and max overshoot of the 2nd order system [for equation 10/ 2s^2 + 4s +15]
 
Physics news on Phys.org
  • #2
From your PM, I'd recommend that you ask your prof for materials / a lecture / lab on MATLAB, especially if you [collectively you, meaning you and your classmates] have never used it before. If learning MATLAB by yourself *is* part of this course, then you should probably read the textbook (if provided) or go through some of the http://www.mathworks.com/academia/student_center/tutorials/launchpad.html" , and/or go through the following thread:
https://www.physicsforums.com/showthread.php?t=296209


1) Assuming you have data for each of the graphs you wish to plot:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/plot.html


3) An m-file allows you to automate a sequence of commands. Instead of typing out 20 commands each and every time you want to do something, you type out the 20 commands in the m-file, and just type the name of the m-file (assuming it's in the current directory) to execute these commands. You can start a new m-file by going File > New m file (or something similar). Getting started with m scripts:
http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f7-38085.html#f7-60588


2) The 'for' loop in MATLAB:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/for.html


4) Producing a (basic) 3d plot:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/plot3.html

Note that you can generate various 3D surface plots using, for instance, mesh and surf:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/mesh.html
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/surf.html


5) Take a look at the following Wikibook on using MATLAB for Control Systems:
http://en.wikibooks.org/wiki/Control_Systems/MATLAB
 
Last edited by a moderator:
  • #3


1) To plot all the curves on the same graph, you can use the "hold on" command before each plot command. This will allow all the curves to be plotted on the same graph. You can also add a legend to differentiate between the different curves.

2) To use a for loop to generate step response for the different damping ratios, you can define a vector containing the different damping ratios and then use a for loop to iterate through the vector and plot the corresponding response curve for each damping ratio.

3) To produce an m file to obtain the response, you can use the "save" command in Matlab to save your code as an m file. You can also use the "publish" command to automatically generate an m file with your code and results.

4) To produce a 3d plot, you can use the "plot3" command in Matlab. This command allows you to plot a 3d curve by specifying the x, y and z coordinates.

5) To produce a Matlab program to get the rise time, peak time, settling time, and maximum overshoot of the second-order system, you can define a function that takes in the system equation and calculates these parameters using the appropriate formulas. You can then call this function with different input values to get the results for different damping ratios.
 

What is the purpose of "Plotting Output Response Curve with Unit Steps: A Matlab Guide"?

The purpose of this guide is to provide a step-by-step tutorial on how to use Matlab to plot the output response curve when a unit step input is applied to a system. This is a common task in engineering and scientific research, and understanding how to plot this curve can help in analyzing and designing systems.

What is a unit step input?

A unit step input is a signal that has a constant value of 1 for all positive time values and 0 for all negative time values. It is often used in systems analysis to represent a sudden change or impulse in a system.

What is the significance of plotting the output response curve?

Plotting the output response curve allows us to visualize how a system responds to a unit step input. This can help in understanding the behavior and characteristics of the system, such as its stability, time delay, and steady-state value.

What are the steps involved in plotting the output response curve with Matlab?

The steps involved are:

  1. Define the system transfer function or differential equations.
  2. Create a time vector for the simulation.
  3. Use the "step" function in Matlab to simulate the system response.
  4. Plot the output response curve using the "plot" function.
  5. Add labels and legends to the plot for clarity.
  6. Adjust the plot settings, such as axes limits and gridlines, if needed.

Can the same method be used for other types of input signals?

Yes, the same method can be used for other types of input signals, such as impulse, ramp, and sinusoidal signals. However, the simulation and plotting steps may differ depending on the specific input signal and system being analyzed.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
7
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
825
  • Engineering and Comp Sci Homework Help
Replies
1
Views
954
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
881
  • Engineering and Comp Sci Homework Help
Replies
8
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
Back
Top