Example H3.6

MATLAB code for example 3.6 from the book "Regeltechniek voor het HBO"

Determine the transfer function in the ω-domain

Copyright (c) 2021, Studieboeken Specialist Permission is granted to copy, modify and redistribute this file, provided that this header message is retained.
Table of Contents

The given situation

Determine the transfer function in the ω-domain of the electrical system as given in the figure 3.14

Determine the relations

In the time domain the following relations hold:
and
In the s-domain this becomes:
and
And in the ω-domain this becomes:
and
The transfer functions then become:
and so that:
And in the ω-domain they become:
and so that:
The equations in the ω-domain have the same form as the ones in the s-domain. It is a matter of simply replacing s with jω.

Example 1 with numbers (sinusoidal input)

Assume that in the example before the following is valid:
% clear all variables from Workspace and close all figures
clear variables;
close all;
 
% Replace s of type tf with s of type sym (symbolic)
syms s;
% create symbolic functions
syms t e1(t) e2(t);
amp=5*sqrt(2);
omega=1000;
e1(t)=amp*sin(omega*t)
e1(t) = 
Then select the values of R and C to be equal to 10kOhm and C=0.1uF. Or else to see what happens then.
R=10; % kOhm
C=0.1; % uF
L=0; % H
 
% define transferfunction of RC network
j=1i; % Define complex number
H=(j*omega*R*1000*C*1e-6)/(1+j*omega*R*1000*C*1e-6);
% Calculate the gain and the phase change of the system for the given
% frequency
gain=abs(H)
gain = 0.7071
arg=angle(H) % [Rad]
arg = 0.7854
Then calculate the output signal e2(t)
e2(t)=gain*amp*sin(omega*t+arg)
e2(t) = 
% Plot the output signal e2(t)
t_interval = [0 1e-1];
figure(101);
fplot(e2(t),t_interval);
grid on;
title('outputsignal e_2(t) with sinusoidal input');
xlabel('t [s]');
ylabel('e_2(t) [V]');
ylim([-10 10]);
xlim(t_interval);
If you had chosen R = 10 kOhm and C = 0.1 uF the magnitude or gain of H equals and the phase equals =.
And the output signal would then be equal to:

Example 2 with numbers (sinusoidal input from t=0)

In the example before the sine at the input is always there. In this example we choose an inputsignal in which the sine is switched on at t=0
Because we have a transient at t=0 we can no longer work in the ω-domain only. We need to go to the s-domain:
% create symbolic time domain functions
syms t e1(t) e2(t);
% create symbolic s domain functions
syms s H(s) E1(s) E2(s);
 
amp=5*sqrt(2);
omega=1000;
e1(t)=amp*sin(omega*t)*heaviside(t)
e1(t) = 
% Convert e1(t) to s-domain
E1(s)=laplace(e1(t),s)
E1(s) = 
Then select the values of R and C to be equal to 10kOhm and C=0.1uF. Or else to see what happens then.
R=10; % kOhm
C=0.1; % uF
 
% define transferfunction of RC network
H(s)=(s*R*1000*C*1e-6)/(1+s*R*1000*C*1e-6)
H(s) = 
 
Then calculate the output signal E2(s)
E2=E1*H
E2(s) = 
Then calculate the output signal e2(t)
e2(t)=ilaplace(E2(s))
e2(t) = 
% Plot the output signal e_2(t)
t_interval = [0 5e-2];
figure(102);
fplot(e2(t),t_interval);
grid on;
title('outputsignal e_2(t) with sinusoidal input from t=0');
xlabel('t [s]');
ylabel('e_2(t) [V]');
ylim([-10 10]);
xlim(t_interval);
It can be seen that the last equation for is equal to the one found in the ω-domain as soon as the transient of is over. In the ω-domain you could imagine that the transient already took place at .