TransWikia.com

Create Transfer Function with Known Input Delay and Specified Attributes

Mathematics Asked by Lawliet on January 6, 2021

I have a transfer function $$G(s) = e^{-5.8s}cdot frac{5}{s+5}$$

How to get the $frac{dx}{dt} = Ax+Bu$ form out of it , The example is taken from Mathwork site

And when I Try to find the Z transform (discrete time ) of the same , I am getting struck at the point where HeavySide function comes ,
$$frac{dx}{dt} + 5cdot x = 5cdot u(t-5.8)$$

In the Matlab , the c2d(G, 0.5,’zoh’) , is giving me the result like

$$frac{1}{z^{12}} * frac{0.6321 z + 0.2858
}{z – 0.08208
}$$

the time sampling assumed here is $0.5$

Please explain the steps involved also.

3 Answers

The zero order hold discretization is easiest done in state space. The continuous state space model can be written as

$$ dot{x}(t) = A,x(t) + B,u(t-d), tag{1} $$

with $x$ the state, $u$ the input delayed by $d$ time units and the matrices $A$ and $B$ given by

$$ A = -5, quad B = 5. $$

The entire state space model can be completed using $C=1$ and $D=0$, with the output of the state space model defined as $y(t) = C,x(t) + D,u(t-d)$.

For zero order hold discretization it is assumed that the input is held constant during one sample time, with the sample time in your case is given to be $T=0.5$, so

$$ u(t) = u_k, forall k,T leq t < (k+1),T,, forall k in mathbb{Z} tag{2} $$

similarly the state at the discrete sample $k$ is denoted with $x_k$.

The zero order hold discretization can now be derived using the convolution integral (obtained by adding the delay to equation 19 on page 5 from these handouts)

$$ x(t) = e^{A,t} x(0) + int_0^t e^{A,(t-tau)} B,u(tau-d),dtau. tag{3} $$

Time shifting $(3)$ from $0$ to $k,T$ and evaluating it at $t=(k+1),T$ yields

$$ x((k+1),T) = e^{A,T} x(k,T) + int_{k,T}^{(k+1),T} e^{A,((k+1),T-tau)} B,u(tau-d),dtau, tag{4} $$

which using the definition of the discrete sampled state is equivalent to

$$ x_{k+1} = e^{A,T} x_k + int_{k,T}^{(k+1),T} e^{A,((k+1),T-tau)} B,u(tau-d),dtau. tag{5} $$

If the delay is not a whole multiple of the sample time then when substituting $(2)$ in $(5)$ allows one to split the integral into two parts, such that each partial integral is only a function of one of the discrete sampled inputs and thus can be factored out of the integral. If the delay is a whole multiple of the sample time then the integral does not have to be split in order to factor out the input.

For example when substituting in the values from your question, so $A = -5$, $B = 5$, $d=5.8$ and $T=0.5$, yields

begin{align} x_{k+1} &= e^{-2.5} x_k + int_{k,0.5}^{(k+1),0.5} e^{-5,((k+1),0.5-tau)} 5,u(tau-5.8),dtau, tag{6a} \ &= e^{-2.5} x_k + int_{k,0.5}^{k,0.5+0.3} e^{-5,((k+1),0.5-tau)} 5,u_{k-12},dtau + int_{k,0.5+0.3}^{k,0.5+0.5} e^{-5,((k+1),0.5-tau)} 5,u_{k-11},dtau, tag{6b} \ &= e^{-2.5} x_k + int_{0}^{0.3} e^{-5,(0.5-tau)} dtau,5,u_{k-12} + int_{0.3}^{0.5} e^{-5,(0.5-tau)} dtau,5,u_{k-11}, tag{6c} \ &approx 0.0820850,x_k + 0.285794,u_{k-12} + 0.632121,u_{k-11}. tag{6d} end{align}

Transforming the difference equation from $(6d)$ into the Z-transform yields

$$ z,X(z) = 0.0820850,X(z) + 0.285794,z^{-12},U(z) + 0.632121,z^{-11},U(z). tag{7} $$

Since the output $y(t)$ is identical to the state $x(t)$ means that $Y(z) = X(z)$ and thus the zero order hold discretization transfer function can be obtained using

$$ G(z) = frac{Y(z)}{U(z)} = frac{X(z)}{U(z)}, tag{8} $$

which when substituting in $(7)$ yields

$$ G(z) = frac{0.632121,z + 0.285794}{z^{12} (z - 0.0820850)}. tag{9} $$

Answered by Kwin van der Veen on January 6, 2021

$$G(s) = e^{-5.8s} frac{5}{s+5}$$ $$implies dfrac {X(s)}{U(s)}= e^{-5.8s} frac{5}{s+5}$$ $$sX(s)+5X(s)= 5e^{-5.8s}U(s)$$ Since $x(0)=0$: $$(sX(s)-x(0))+5X(s)= 5e^{-5.8s}U(s)$$ Apply inverse Laplace Transform: $$x'(t)+5x(t)= 5u(t-5.8)$$ $$implies A=-5, B=5$$

Answered by Satyendra on January 6, 2021

In $Y(s)=G(s)X(s)$ transfer the denominator to the left side and apply the inverse Laplace transform to get $$ y'(t)+5y(t)=5x(t-5.8) $$ for the input function $x$ and the output function $y$. By the usual conventions $y(t)=x(t)=0$ for $tle 0$


I switched from using the pair $(x,u)$ to the pair $(y,x)$, as $u$ has two conventional uses, ones as the unit ramp or Heaviside function, also denoted $Theta$, and on the other hand as an arbitrary control input. Here it is used in the latter role. It is less confusing this way.


The $z$ transform produces a linear multi-step method to this problem. One could just take the Euler or better Adams-Bashford method and some interpolation procedure to get about the same result. Explicit Euler is unstable, let's try implicit Euler $$ y_{k+1} = y_{k}+tau(x((k+1)tau-5.8)-5y_{k+1}) $$ so that with $tau=0.5$ and linear interpolation $$ 3.5y_{k+1}-y_k= 0.5(0.8x_{k-11}+0.2x_{k-10}) $$ making for a transfer function of $$ z^{-11}frac{0.1142857+0.0285714z}{z-0.285714} $$


To replicate c2d, according to https://www.mathworks.com/help/control/ug/continuous-discrete-conversion-methods.html, one needs to solve the equation for the step function, $u[k]=1$ for $kge 0$, $u(t)=1$ for $tge 0$, else zero. Then sample the output and compute the transfer function. $$ (e^{5t}y(t))'=5e^{5cdot 5.8}cdot u(t-5.8)e^{5(t-5.8)} \ e^{5t}y(t)=e^{5cdot 5.8}u(t-5.8)(e^{5(t-5.8)}-1) \ y(t)=u(t-5.8)(1-e^{-5(t-5.8)}) $$ Then compute the discretization $$ Y[z]=sum_{k=12}^infty z^{-k}y(0.5k)=frac{z^{-12}}{1-z^{-1}} -frac{z^{-12}e^{-1}}{1-e^{-2.5}z^{-1}} $$ Now $U[z]=frac1{1-z^{-1}}$, so that in their fraction $$ H[z]=z^{-12}left(1-e^{-1}frac{z-1}{z-e^{-2.5}}right) =z^{-12} frac{(1-e^{-1})z+(e^{-1}-e^{-2.5})}{z-e^{-2.5}} \ =z^{-12}frac{0.6321205588285577,z+0.28579444254754355}{z-0.0820849986238988} $$ is exactly the result of the Matlab routine.

Answered by Lutz Lehmann on January 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP