First-order low-pass filter (source code)

= First-order low-pass filter
{title2=$G(s)=K/(\tau s+1)$}

A <first-order low-pass filter> with positive constant gain $K$ and <time constant> $\tau>0$ obeys the <ordinary differential equation>
$$
\tau y'(t)+y(t)=Ku(t).
$$
The <derivative> term limits how quickly the <plant output> follows a changing <plant input>. A larger <time constant> means slower adjustment. This standard form, with $K=1$, is developed in https://www.ocw.mit.edu/courses/2-004-dynamics-and-control-ii-spring-2008/2cd1d6082fe3ba8a6a37fae62b10051f_lecture_20.pdf[Derek Rowell, MIT 2.004, lecture 20, section 1.1: first-order systems]; the following calculation keeps the gain $K$ explicit.

Write $y_0=y(0)$. The <Laplace transform> of the <derivative> is $sY(s)-y_0$, so
$$
\tau\bigl(sY(s)-y_0\bigr)+Y(s)=KU(s),\qquad
Y(s)=\frac{K}{\tau s+1}U(s)+\frac{\tau y_0}{\tau s+1}.
$$
Setting the <initial condition> $y_0=0$ gives the <transfer function> $G(s)=K/(\tau s+1)$. Its single <simple pole> is $s=-1/\tau$, which has negative <real part>. The unforced response decays, and the input/output map has <BIBO stability>. The eventual gain for a constant <plant input> is $G(0)=K$.

For a unit step, represented by the <Heaviside step function> $u(t)=H(t)$, the <Laplace transform> is $U(s)=1/s$. From zero <initial condition>,
$$
Y(s)=\frac{K}{s(\tau s+1)}
=\frac Ks-\frac K{s+1/\tau},\qquad
y(t)=K\bigl(1-e^{-t/\tau}\bigr)\quad(t\ge0).
$$
Take $K=2$ and $\tau=3\,\mathrm{s}$, with dimensionless <plant input> and <plant output>. Then $y(t)=2(1-e^{-t/(3\,\mathrm{s})})$ rises toward $2$. After one <time constant>, at $t=3\,\mathrm{s}$, it reaches $2(1-e^{-1})\approx1.2642$, or $63.2\%$ of its final value. At $t=9\,\mathrm{s}=3\tau$, it reaches $2(1-e^{-3})\approx1.9004$, or $95.0\%$. These percentages describe the rise from zero, rather than an instantaneous jump to the target.

With a nonzero <initial condition>, the same step instead gives
$$
y(t)=K\bigl(1-e^{-t/\tau}\bigr)+y_0e^{-t/\tau}.
$$
For $K=2$ and $\tau=3\,\mathrm{s}$, compare $y_0=0$ with $y_0=1$. Their <plant outputs> differ by $e^{-t/(3\,\mathrm{s})}$ despite having the same <transfer function> and the same <plant input>. The extra <exponential decay> term must be supplied from the <initial condition>; $G$ and $u$ alone cannot determine it.

\Image[/first-order-transfer-step-response.png]
{title=One <transfer function>, one unit step, two <initial conditions>}
{description=The <first-order low-pass filter> has $K=2$ and <time constant> $\tau=3\,\mathrm{s}$. The blue curve starts at $y_0=0$ and the orange curve at $y_0=1$. The marked $63.2\%$ and $95.0\%$ levels refer to the blue curve's final value $2$; the two curves' difference is the decaying initial-state contribution.}