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.
例如,一个电力电子开关(比如碳化硅 MOSFET)包含一个封装内的结。该封装安装在散热器上。随着电流的增加,开关结温几乎立即上升,因为它的时间常数非常短;而封装(中间图片)可能需要几秒钟。散热器的时间常数大约在分钟级别。
Picture is owned by GE
图片归 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):
脉冲响应是一个系统的参数,它决定了系统如何对输入做出反应。例如,当我们从冰箱中取出一条冷冻鱼时,环境温度从 30 华氏度变化到 70 华氏度。下面的方程显示了系统的输出与输入和脉冲响应之间的关系(h(t) = 脉冲响应,x(t) = 输入):
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".
上面的图显示了当输入为阶跃函数时的脉冲响应和输出信号,这种情况是相当常见的。响应的形状和持续时间用时间常数参数“tau”来描述。
When time "t" is zero, no decay has happened yet and the signal is equal to y(0).
当时间“t”为零时,尚未发生衰减,信号等于 y(0)。
At time "t" equal to "tau", exactly one time constant has elapsed. The signal is now equal to:
当时间“t”等于“tau”时,正好经过了一个时间常数。此时信号等于:
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 37% 方法
The 37% method is a widely used method for finding a time constant. It is quite simple:
37% 方法是一种广泛使用的寻找时间常数的方法。它非常简单:
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.
例如,对于这个系统,初始值是 5。5 的 37%是 1.85,这大约发生在 1 秒时。因此,时间常数τ是 1 秒。
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).
或者,玻璃中冷却水的温度会趋向于环境的温度。与上述情况完全相同的过程可以应用于这种情况(时间常数等于 1 秒)。
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:
时间 0 的斜率由以下公式给出:
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".
继续这个思想实验,如果信号确实以这个斜率衰减,它将在时间“t” = “tau”时恰好达到其稳态值(要么是 0,要么是非零值)。在这种情况下,分子中的时间项“t”将与分母中的“tau”项相抵消。
E.g., the time constant "tau" would be equal to 2 seconds in the figure below.
例如,图中的时间常数“tau”将等于 2 秒。
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.
该方法仅使用初始点和初始斜率,不利用任何其他数据。此外,由于测量波形通常包含噪声,因此该方法的使用频率低于 37%方法。
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".
请注意,当与时间“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.
在 MatLab、DSP 和 FPGA 中。
.
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.
例如,气候变化导致海平面缓慢上升。然而,由于月球引起的潮汐则更加明显。