What are time constants and where are they found?
Time constants are everywhere. Since (almost) nothing happens instantaneously, but rather with a delay, processes are said to have time constants associated with them.
In electrical systems, purely resistive circuits are static (not dynamic) as there are no energy storing elements. Resistors do not store energy but rather dissipate it. However, consider these circuits:
In mechanical systems:
In thermal systems:
Psychology:
Measuring Time Constants
When would one want to measure the time constant of a system?
It should be noted that systems typically have more than one time constant. However, it is very typical for a system to have its time constants far apart from each other, resulting in a separation between fast transient responses and the dominant response (which is the slowest one).
E.g. a power electronics switch (say a silicon-carbide MOSFET) contains a junction within a package. The package is mounted on a heatsink. The switch junction temperature rises almost immediately with increased current since its time constant is very short; the package (middle picture) might take a few seconds. The heatsink will have a time constant on the order of minutes.
Picture is owned by GE
We will examine properties of time-domain response that will allow you to obtain an estimate of a time constant.
This write-up focuses only on time-domain. See the Further Reading section for links to relevant articles in frequency domain analysis.
A very standard first-order system response is as below:
Such shape looks like an impulse response of a system.
How does impulse response work?
Impulse response is a parameter of a system that dictates how the system reacts to its inputs. For example, when we take out a frozen fish from the refrigerator, the ambient temperature changes from 30F to 70F. The equations below show how the output of a system is related to the input and the impulse response (h(t) = impulse response, x(t) = input):
The figure above shows both the impulse response and the output signal when the input is a step function, which is quite often the case. The shape and duraration of the response is described with the time constant parameter "tau".
When time "t" is zero, no decay has happened yet and the signal is equal to y(0).
At time "t" equal to "tau", exactly one time constant has elapsed. The signal is now equal to:
Now that we have established the notion of time constant and the time-domain waveform, let's see how to obtain time constant from experimental data.
There are three simple methods to estimate the time constant from time-domain data:
The 37% Method
The 37% method is a widely used method for finding a time constant. It is quite simple:
E.g., for this system, the initial value is 5. 37% of 5 is 1.85, which happens at approximately 1 second. Hence, the time constant tau is 1 second.
However, there are some restrictions to this method:
The first restriction is explained in more detail here:
Alternatively, the temperature of chilled water in a glass converges to the ambient temperature of the environment. Exactly the same procedure as shown above can be applied to this situation (the time constant is equal to 1 second).
Therefore, it is not necessary to have a response that decays to zero.
The Initial Slope Method
This method is based on the initial derivative of the transient response. Let's start from the equation shown above:
The slope at time 0 is given by:
Hypothetically, the signal would decay linearly if it followed the initial slope:
Continuing the thought experiment, if the signal did decay at this slope, it would hit its steady state value (either 0 or a non-zero value) exactly at time "t" = "tau". In such case, the time term "t" in the numerator would cancel out with the denominator term "tau".
E.g., the time constant "tau" would be equal to 2 seconds in the figure below.
The method can be applied to signals that do not decay to zero, such as the one shown below. The time constant would be measured on the steady-state line (dashed).
This method does not utilize any data but the initial point and the initial slope. Also, this method is used less often than the 37% method since measured waveforms typically contain noise.
The Logarithmic Method
The last method does not rely on one or two data points as the previous two methods but rather on the complete dataset. This property comes in handy when the data set contains a lot of noise. Again, let's consider the basic decaying exponential:
Let's take the natural logarithm of the response curve:
Note that this is an equation of a straight line when plotted against time "t".
This is the strategy:
An example is shown below:
#=============================
# Logarithmic method
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
def linear_fit(x, A, B): # this is your 'straight line' y=f(x)
return A*x + B
# data parameters
tau = 3;
y0 = 25;
noise_amp = 2;
# generate time vector
y = y0*np.exp(-t/tau) + noise_amp*np.random.rand(len(t));
# take the natural logarithm
y_ln = np.log(y)
# do curve fit on ln(y)
A,B = curve_fit(linear_fit, t, y_ln)[0] # your data x, y to fit
# generate a line based on A, B
y_ln_fit = linear_fit(t,A,B)
fig = plt.figure(num=None, figsize=(5, 5), dpi=80, facecolor='w', edgecolor='k')
f, ax = plt.subplots(2, sharex=True)
ax[0].cla()
ax[0].plot(t, y, c='green', label='y1',linewidth=3.0)
ax[0].grid(1)
ax[0].set_ylabel('y(t)')
plt.xlabel('Time [s]')
plt.grid(1)
ax[1].plot(t, y_ln, c='green', label='y1',linewidth=3.0)
ax[1].set_ylabel('ln(y(t)')
line2, = ax[1].plot(t, y_ln_fit, c='green', label='y1',linewidth=3.0)
dashes = [10, 10]
line2.set_dashes(dashes)
line2.set_color('red')
# save the picture
plt.savefig('csa0008_2.png')
# Estimate time constant
tau_est = -1/A
print("Estimated time constant is ", tau_est, "s")
Further Reading
In MatLab, DSPs, and FPGAs.
.
The fundamentals of signal flow.
Introduction to dynamic systems.
It is all sine waves.
Q: Is the slowest response always dominant?A: Not necessarily. If the fast transient has higher magnitude then the slow transient, the slow transient might not be perceived by the control system.
E.g., climate change causes the ocean level to slowly rise. However, tides due to the Moon are much more perceptible.