3

I made a mathematical model (transfer function) of a rlc circuit. I simulated it in matlab simulink with step input and square wave input and observed the result. I can also calculate this system with step input since its transfer function is simple 1/s. But i do not know how to calculated square wave transfer function. Is there a way to find square wave transfer function or just i have to break the signal in to high or low form. THanks

Taha
  • 87
  • 1
  • 7

2 Answers2

5

I thought I would expand a little on the answer offered by Karlo.

Long story short, I would not try to calculate the analytical time response of a system to a square wave. That would be a serious pure-maths exercise, and not necessary for most engineering applications.

Instead, I would suggest using the step response analytical vs. simulated to validate your model, and then trust that your MATLAB Simulink model is working properly for the square wave case.

But if you feel like trying it out, here is what you need to know:

The transfer function $G(s)$ is a description of the relationship between the input $U(s)$ and output $Y(s)$ of your system.

$$G(s) = \frac{Y(s)}{U(s)}$$

When you want to determine the time response of your system to a specified input analyticalally, you rearrange for $Y(s)$ and then use the inverse Laplace Transform:

$$Y(s) = G(s)U(s)$$

$$y(t) = \mathcal{L}^{-1}\{G(s)U(s)\}$$

As stated in the Question, for a simple step input $U(s) = \frac{1}{s}$ the time response is then:

$$y(t) = \mathcal{L}^{-1}\{\frac{G(s)}{s}\}$$

It gets a lot more difficult for a square wave. A square wave is a series of time-shifted step functions (or Heaviside functions) $H(t-T)$ where $T$ is the time at which the step occurs. The derivation for the Laplace transform of a square wave is given in the answer to this question by alexjo:

$$u(t) = A\sum_{k=0}^{\infty} \left[H\left(t-kT\right)-2H\left(t-\frac{2k+1}{2}T\right)+H\left(t-(k+1)T\right)\right]$$ $$U(s) =\frac{A}{s}\frac{1-\mathrm e^{-\frac{Ts}{2}}}{1+\mathrm e^{-\frac{Ts}{2}}}$$

Where $A$ is the amplitude of the square wave. You would then multiply this expression by your transfer function and then take the inverse Laplace transform of the entire mess. I am not aware of any simple way of doing this. Good luck.

2

You want to look for the Laplace transform of a square wave.

Note: The transfer function $H(s)$ is the ratio of the Laplace transforms of output $Y(s)$ and input $U(s)$: $Y(s)=H(s)\cdot U(s)$

If you take the Laplace transform of a function (input our output), it is not called a transfer function.

Karlo
  • 540
  • 7
  • 20