Responses of a transfer function on MATLAB

In summary, the conversation is about finding the steady state error of a given system using MATLAB. The system has a pole at the origin, making it unstable. The MATLAB code is used to plot the step and ramp responses, and the resulting graph shows that the system is unstable. To make the system stable, a unit feedback can be added, and the response to a ramp input will be a parabola.
  • #1
geft
148
0
I'm given the following system:

[tex]\frac { 3s+0.5 }{ { s }^{ 3 }+3{ s }^{ 2 }+8s } [/tex]

I'm supposed to find the steady state error of the system by plotting the step and ramp responses, and then find the value when s tends to infinity.

Here is the MATLAB code:

Code:
sys1 = 3 + tf(0.5.*[1], [1 0]);
sys2 = tf([1], [1 3 8]);
sys = sys1*sys2

subplot(1, 2, 1)
step(sys)

sys3 = tf([1], [1 0]);
subplot(1, 2, 2)
step(sys*sys3)
title('Ramp Response')

figure
rlocus(sys*sys3)

Here's the result: http://i.imgur.com/vXoXV.png

As can be seen, the step and ramp responses are unstable. All the roots are on the left of the imaginary axis, so the system must be stable. I'm not sure where I went wrong.
 
Physics news on Phys.org
  • #2
geft said:
I'm given the following system:

[tex]\frac { 3s+0.5 }{ { s }^{ 3 }+3{ s }^{ 2 }+8s } [/tex]

I'm supposed to find the steady state error of the system by plotting the step and ramp responses, and then find the value when s tends to infinity.

Here is the MATLAB code:

Code:
sys1 = 3 + tf(0.5.*[1], [1 0]);
sys2 = tf([1], [1 3 8]);
sys = sys1*sys2

subplot(1, 2, 1)
step(sys)

sys3 = tf([1], [1 0]);
subplot(1, 2, 2)
step(sys*sys3)
title('Ramp Response')

figure
rlocus(sys*sys3)

Here's the result: http://i.imgur.com/vXoXV.png

As can be seen, the step and ramp responses are unstable. All the roots are on the left of the imaginary axis, so the system must be stable. I'm not sure where I went wrong.

Your system has a pole at the origin. So, it is unstable. With a unit feedback it can be made stable, depending of the gain (your root locus graph).
 
  • #3
So it's only stable if it's a closed loop? Thanks, that solved the unit step part.

What about the ramp response? How do I make it stable?
 
Last edited:
  • #4
The response of a stable system to a ramp input is a ramp, so it tends to infinity.
If you have a pole at the origin, the response to a ramp will be a parabola, as your graph shows.
 
  • #5
Many thanks for the help.
 

What is a transfer function on MATLAB and how does it work?

The transfer function in MATLAB is a mathematical representation of the relationship between the input and output signals of a system. It is used to analyze the behavior of a system and predict its response to different inputs. In MATLAB, the transfer function is represented as a ratio of polynomials in the Laplace domain, which can be used to simulate and analyze the system's performance.

How do I create a transfer function in MATLAB?

To create a transfer function in MATLAB, you can use the tf function. This function takes in the coefficients of the numerator and denominator polynomials of the transfer function as inputs. For example, if the transfer function is H(s) = (s+2)/(s^2+5s+6), the MATLAB code would be H = tf([1 2], [1 5 6]). You can then use this transfer function to analyze the system's response to different inputs.

Can I plot the response of a transfer function in MATLAB?

Yes, you can plot the response of a transfer function in MATLAB using the step or impulse functions. These functions plot the step and impulse responses of the transfer function, respectively. You can also use the bode function to plot the frequency response of the transfer function.

How do I analyze the stability of a system using a transfer function in MATLAB?

To analyze the stability of a system using a transfer function in MATLAB, you can use the isstable function. This function takes in the transfer function as an input and returns a logical value indicating whether the system is stable or not. You can also use the pzmap function to plot the pole-zero map of the transfer function, which can help in determining the system's stability.

Can I use transfer functions in control systems design on MATLAB?

Yes, transfer functions are commonly used in control systems design on MATLAB. You can use the transfer function to design controllers, such as proportional-integral-derivative (PID) controllers, and analyze the closed-loop system's performance. You can also use the feedback function to implement feedback control using transfer functions.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
13K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
806
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
12
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
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
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
886
Back
Top