Log Incomplete Response
Experimental testing: Is a system really first-order?
Suppose we run an experiment to acquire a step response of a system, and the result looks like Fig. 1. We suspect the system may be first-order, we estimate the time constant from the 63.2% mark, and we use this time constant to mathematically model the system and predict its behavior.
Fig. 1: Experimental step response (from System Dynamics by Doebelin).
In the following discussion, we develop a method for determining how close such a system is to being truly first-order, and if it is, determining a best estimate of its time constant using all the experimental data, not just the one data point at the 63.2% mark.
Step response
Suppose we apply a step input u to a system and we measure the output ym and time t so that we have a set of n+1 points for ym as follows:
Time t / t(0) / t(1) / … / t(n)Output ym / ym(0) / ym(1) / … / ym(n)
The model of a first-order system is
(1)
where is the time constant and G is the static gain. The solution to this ODE (with a step input of magnitude A) is given by
,(2)
where yss = GA. If the system is first order, then the experimental data ought to satisfy
(3)
Here’s how we check. We manipulate (3) to obtain
(4)
Taking the loge of both sides yields
.(5)
and we designate the left-hand side Z, called the logarithm of the incomplete-response,
.(6)
We compute Z(t) from the experimental data. The ideal Z is a linear function of t with a slope of.
Procedure: Given experimental step response data ym, estimate the time constant (est) from the 63.2% point. From the experimental data, extract the first 4est values of t and ym. Use (6) to compute Z(t). Plot Z(t), and perform a linear curve fit. Fig. 2 shows a representative plot. The closer a linear curve fits the data, the closer the system is to being first order with a time constant equal to the negative inverse of the slope of the fitted curve. Conversely, if the plot of Z is clearly not a straight line, then the system is not first order and(1) is not a good model.
Fig. 2: Curve-fit to a plot of Z(t) (from System Dynamics by Doebelin).
IC response
A similar approach can be used when we have experimental data from an initial-condition response (or an impulse response). Suppose we give a system an initial condition y0 and measure the output ym and time t so that we have a set of n+1 points for ym as follows:
Time t / t(0) / t(1) / … / t(n)Output ym / ym(0) / ym(1) / … / ym(n)
The model of a first-order system is
(7)
where is the time constant. The response is given by
(8)
If the experimental system is first order, then the experimental data ought to satisfy
(9)
Following a procedure like the one for the step response, we get an expression for Z given by
.(10)
Again, compute Z(t) from the experimental data and compare it to the ideal
Z(t) = (t/).
Again, the ideal Z is a linear function of t with a slope of .
Procedure: Given experimental IC-response ym, estimate the time constant (est) from the 63.2% point. Extract the first 4est values of t and ym from the experimental data. Use (10) to compute the logincomplete-responseZ(t), plot Z(t), and perform a linear curve fit. Figure 2 shows a representative plot. The closer a linear curve fits the data, the closer the system is to being first order with a time constant equal to the negative inverse of the slope of the fitted curve. Conversely, if the plot of Z is clearly not a straight line, then the system is not first order and (7) is not a good model.
Name______Return to CM ______
Name______
Lesson 19 Exercise
Problem 1For the step-response data given below, compute and plot the log incomplete responseZ(t). Plot a linear curve-fit and determine the time constant.
Time (s) / ym(in)0.0 / 0.00
0.5 / 0.97
1.0 / 1.79
1.5 / 2.35
2.0 / 2.83
2.5 / 3.15
3.0 / 3.37
3.5 / 3.53
4.0 / 3.73
4.5 / 3.82
5.0 / 3.91
5.5 / 3.98
6.0 / 4.03
6.5 / 4.06
7.0 / 4.06
7.5 / 4.09
8.0 / 4.13
8.5 / 4.14
9.0 / 4.13
Procedure
- Create a Matlab m-file for this exercise. Assign the data in the table to a time vector t and a displacement vector y.
- Plot y(t) as individual data points. Do not “connect the dots.” Use subplot(211).
- Estimate y0 and yss. Assign them to variables in your m-file.
- Compute and plot Z(t) as individual data points. The Matlab function for the natural logarithm is log. Use subplot(212).
- Perform a linear least-squares curve fit for Z(t). Matlab functions for doing this are described below. Plot the linear curve fit as a line on the same graph as Z.
- Determine the time constant from the slope of Z.
- Attach your plots, properly labeled, to this worksheet and turn it in at the end of the period.
Question Is the system first-order? Discuss how you might quantify your answer.
Polynomial curve-fitting in Matlab
Name______Return to CM ______
Name______
Given vectors t and x(t) and an integer value for n, the command
p = polyfit(t,x,n)
computes the coefficients of a polynomial p(t) of order n that fits the data x(t) such that
.
The command
xfit = polyval(p,t)
evaluates the polynomial p at the values of t,
producingxfit, the fitted curve. To plot both on the same graph, use, e.g.,
plot(t,x,’o’,t,xfit,’-’)
A linear least-squares curve fit is first-order, that is, n = 1. Thus, for a linear curve-fit, the polyfit command produces the vector p = [p1 p2] such that
.
It follows thatp1 is the slope of the curve and p2 is the intercept.
Lesson 19 Exercise
Problem 2 Consider the step response and the log incomplete response plot shown in Fig. 1.
(a) Step response of unknown system. (b) Log-incomplete response.
Fig. 1: Example of a log incomplete response plot
for a system that is not first-order.
Question Explain why we can conclude the system that produced this response is not 1st-order even though at first glance it appears it might be 1st-order.
Question Suppose a system with the transfer function given below, when subjected to a unit step input, produces the response shown in Fig. 1(a). Rewrite the transfer function in standard form and explain why Fig. 1(a) has the appearance it does.
Transfer function: