Matlab: System response query.

In summary, the conversation discusses a problem in Matlab involving finding the system response of a function with a unit step input and zero initial condition. The function, G(s), is defined as 1/(s+5) and the correct denominator is den = [1 5]. The conversation also clarifies that MATLAB does not build transfer functions based on their roots, but rather on the coefficients of the Laplace polynomial.
  • #1
technowar
4
0

Homework Statement


Hi. I need help on this Matlab problem.

I need to find the system response of the function, where the input is a unit step and a zero initial condition.

G(s) = 1/(s+5)

Homework Equations



G(s)=C(s)/R(s)

The Attempt at a Solution



num=[1];
den=[-5];
t=0:0.1:80;
step(num,den,t)

[PLAIN]http://cl.ly/3G0U3g473B1Y0L1r2d2o/1.jpg
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Your denominator is incorrect, it should be den = [1 5] basically the transfer function should look like G(s) identically
 
  • #3
Shouldn't it be [1 -5]? But other than that, do you think it's correct?
 
  • #4
No MATLAB does not build transfer functions according to their roots. The arrays you provide are coefficient to the laplace polynomial.
 
  • #5

Hi there,

To find the system response, we first need to define the transfer function of the system, which is given as:

G(s) = 1/(s+5)

Next, we need to solve for the output, C(s), given an input, R(s), which is a unit step. This can be done by using the Laplace transform:

C(s) = G(s) * R(s) = 1/(s+5) * 1/s = 1/(s(s+5))

To find the time-domain response, we need to use the inverse Laplace transform. In Matlab, this can be done using the "ilaplace" function. We also need to specify the time range for which we want to plot the response. In this case, we will use the same t range as specified in the given code (0 to 80 seconds with a step size of 0.1 seconds). The code for this would be:

num = [1]; % numerator of the transfer function
den = [1, 5]; % denominator of the transfer function
t = 0:0.1:80; % time range
C = ilaplace(num./den, t); % inverse Laplace transform
plot(t, C); % plot the response
xlabel('Time (seconds)'); % label for x-axis
ylabel('System Response'); % label for y-axis
title('System Response to a Unit Step Input'); % title for the plot

Running this code will give you the following plot:

http://cl.ly/3G0U3g473B1Y0L1r2d2o/1.jpg

As you can see, the system response starts from 0 and gradually approaches a steady state value of 1, which is expected for a unit step input with a zero initial condition.

Hope this helps! Let me know if you have any further questions.
 

Related to Matlab: System response query.

1. What is Matlab's System Response Query?

Matlab's System Response Query is a built-in function that allows users to analyze and visualize the response of a system to different inputs. It is commonly used in control systems, signal processing, and other engineering applications.

2. How do I use the System Response Query in Matlab?

To use the System Response Query in Matlab, you need to first define the system you want to analyze using the tf or ss function. Then, use the step, impulse, or lsim function with the system as an input to generate the response plot or data. You can also specify additional parameters such as the input signal and time range.

3. What types of systems can be analyzed with the System Response Query?

The System Response Query can be used to analyze linear time-invariant (LTI) systems. This includes systems with constant coefficients, such as transfer functions and state-space models. Nonlinear systems or systems with time-varying coefficients cannot be analyzed using this function.

4. How can the System Response Query help in system design and analysis?

The System Response Query can provide valuable insights into the behavior of a system, such as its stability, transient response, and frequency response. This can help in designing and optimizing control systems, filters, and other systems. It can also be used to compare the response of different systems and evaluate their performance.

5. Are there any alternatives to the System Response Query in Matlab?

Yes, there are other functions in Matlab that can be used for system analysis, such as bode, nyquist, and margin for frequency domain analysis, and pzmap and pole for pole-zero analysis. However, the System Response Query is specifically designed for time domain analysis and is the most commonly used function for this purpose.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
12
Views
2K
Replies
13
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
12K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
918
  • Engineering and Comp Sci Homework Help
Replies
1
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Back
Top