Impulse response of two tanks in series  
Author's Data: Housam BINOUS
Department of Chemical Engineering
National Institute of Applied Sciences and Technology
Tunis, TUNISIA
Email: binoushousam@yahoo.com

Assume volumeric flowrate proportional to liquid volume in the tank :  \(TraditionalForm\`q\_i\ \((t)\)\  = \ \(\(k\_i\)\(\ \)\(\(v\_\(\(i\)\(\ \)\)\)(t)\)\(\ \)\)\) where i=1, 2. Initially the two tanks are empty.

Dynamic response to a pulse in feed flowrate

q[t_]:=ϵ (UnitStep[t]-UnitStep[t-1/ϵ])

ϵ = 100;

Plot[q[t],{t,0,5/ϵ},PlotStyle->RGBColor[0,0,1]]

sol1 = 
      NDSolve[{(D[(Subscript[v, 1])[t], {t, 1}] == q[t] - k (Subscript[v, 1])[t]) /. 
            k -> 
              1, (D[(Subscript[v, 2])[t], {t, 1}] == k (Subscript[v, 1])[t] - k (Subscript[v, 2])[t]) /. 
            k -> 1, (Subscript[v, 1])[0] == 0, (Subscript[v, 2])[0] == 0}, {(Subscript[v, 1])[t], 
          (Subscript[v, 2])[t]}, {t, 0, 100}]

plt1 = 
      Plot[{(Subscript[v, 2])[t] /. sol1, (Subscript[v, 1])[t] /. sol1}, {t, 0, 10}, 
        PlotStyle -> {RGBColor[1, 0, 0], RGBColor[0, 1, 0]}, 
        PlotRange -> All]

Dyanmic response to a specific feed flowrate (for example a (Sin^2)wave)

q[t_]:=Sin[t]^2

plt2=Plot[q[t],{t,0,20},PlotStyle->RGBColor[0,0,1]]

sol2 = 
      NDSolve[{(D[(Subscript[v, 1])[t], {t, 1}] == q[t] - k (Subscript[v, 1])[t]) /. 
            k -> 
              1, (D[(Subscript[v, 2])[t], {t, 1}] == k (Subscript[v, 1])[t] - k (Subscript[v, 2])[t]) /. 
            k -> 1, (Subscript[v, 1])[0] == 0, (Subscript[v, 2])[0] == 0}, {(Subscript[v, 1])[t], 
          (Subscript[v, 2])[t]}, {t, 0, 100}]

plt3 = 
      Plot[{(Subscript[v, 2])[t] /. sol2, (Subscript[v, 1])[t] /. sol2}, {t, 0, 20}, 
        PlotStyle -> {RGBColor[1, 0, 0], RGBColor[0, 1, 0]}, 
        PlotRange -> All]

Obtaining the same dynamic response using the convolution theorem and the impulse response.

Off[NIntegrate::slwcon]

Off[NIntegrate::ncvb]

f[τ_] := 
      NIntegrate[
        First[(Subscript[v, 1])[t] /. sol1] q[τ - t], {t, 0, τ}]

plt4=Plot[f[x],{x,0.01,20},DisplayFunction->Identity,PlotStyle->RGBColor[0,1,0]];

g[τ_] := 
      NIntegrate[
        First[(Subscript[v, 2])[t] /. sol1] q[τ - t], {t, 0, τ}]

plt5=Plot[g[x],{x,0,20},DisplayFunction->Identity,PlotStyle->RGBColor[1,0,0]];

Show[plt2,plt3,plt4,plt5,DisplayFunction->$DisplayFunction]