Professional Documents
Culture Documents
2021 - Praktikum DinSis - Modul 4
2021 - Praktikum DinSis - Modul 4
Name:____________
4
Function
NIM :____________
Score:
_________________
A. Introduction
In Module 3, students have already learnt on how to use Matlab to find the analytical and
numerical solutions of an ODE (Ordinary Differential Equation). In this module, students
will study further about numerical solutions of an ODE. Numerical solutions will be
calculated by using transfer function. In this module, transfer function of mechanical
system and electrical system will be studied more in depth.
1
1) ODE in Euler notation
Normally ODE is written as follows
𝑚𝑥̈ (𝑡) + 𝑐𝑥̇ (𝑡) + 𝑘𝑥(𝑡) = 𝑓(𝑡),
then, it should be changed into following form
𝑚𝐷/ 𝑥(𝑡) + 𝑐𝐷𝑥(𝑡) + 𝑘𝑥(𝑡) = 𝑓(𝑡),
where 𝐷/ 𝑥(𝑡) is the second derivatives of 𝑥(𝑡) and 𝐷𝑥(𝑡) is the first derivatives
of 𝑥(𝑡).
2) Perform Laplace Transform to transform the ODE from time (t) domain to s
domain
After the form is changed, students can easily apply Laplace Transform. The
result of Laplace Transform is as follow,
𝑚𝑠 / 𝑋(𝑠) + 𝑐𝑠𝑋(𝑠) + 𝑘𝑋(𝑠) = 𝐹(𝑠).
Pay attention on 𝑥 and 𝑓 function, both of them are changed into capital word.
Why? Because it makes us easier to differentiate which one is time domain
(before Laplace Transform is applied) and which one is s domain.
3) Derive the transfer function of ODE
Transfer function of ODE is defined as the ratio of output to input. Based on the
ODE in Laplace domain, transfer function is
𝑋(𝑠) 1
𝐺(𝑠) = = /
,
𝐹(𝑠) 𝑚𝑠 + 𝑐𝑠 + 𝑘
where, 𝐺(𝑠) is stated as transfer function of ODE.
4) Conduct the simulation on simulink to get the numerical solution of ODE
Exercise #2
Look back to problem number 1, 3, and 5 on Exercise #1, make the transfer function
simulation of those problems on simulink. Then, compare the simulation result with the
integration calculation (Exercise #1 result).
2.1. Transfer Function of Mechanical System
Table 2 shows the procedure to find transfer function of a simple mechanical system.
Usually, simple mechanical system consists of three component. Spring, damper, and
mass, as it is shown in table below. Use information on the table to do Exercise #3.
2
Table 2. Transfer function of a simple mechanical system
SPRING DAMPER MASS
Exercise #3
Use transfer function to find 𝑥(𝑡) and draw the graph, 𝑥(𝑡) vs 𝑡, for each problem listed
below.
a) The force 𝑓(𝑡) = 1(𝑡) is applied to a spring (k = 2 N/m).
b) The force 𝑓(𝑡) = 𝑡 is applied to a spring (k = 2 N/m).
c) The force 𝑓(𝑡) = sin(2𝜋𝑡)is applied to a spring (k = 2 N/m).
d) The force 𝑓(𝑡) = 1(𝑡) is applied to a damper (c = 2 N/(m/s)).
e) The force 𝑓(𝑡) = 𝑡 is applied to a damper (c = 2 N/(m/s)).
f) The force 𝑓(𝑡) = sin(2𝜋𝑡) is applied to a damper (c = 2 N/(m/s)).
g) The force 𝑓(𝑡) = 1(𝑡) is applied to a mass (m = 2 kg).
h) The force 𝑓(𝑡) = 𝑡 is applied to a mass (m = 2 kg).
i) The force 𝑓(𝑡) = sin(2𝜋𝑡) is applied to a mass (m = 2 kg).
Exercise #4
Figure 1 shows the example of mechanical system consists of spring (k = 2 N/m) and
damper (c = 1 N/(m/s)). Equation of motion of the system is 𝑓(𝑡) = 𝑐𝑥̇ (𝑡) + 𝑘𝑥(𝑡).
Based on the equation of motion, derive the transfer function for 𝑓(𝑡) is the input and
𝑥(𝑡) is the output. Then, find the numerical solution by integration and transfer function.
3
Figure 1. Simple mechanical system model (spring and damper)
Find the solution and draw the graph, 𝑥(𝑡) vs 𝑡, for each problem listed below!
a) 𝑓(𝑡) = 1(𝑡) is applied to the system.
b) 𝑓(𝑡) = 𝑡 is applied to the system.
c) 𝑓(𝑡) = sin(2𝜋𝑡)is applied to the system
Exercise #5
Figure 2 shows the example of mechanical system consists of spring (k = 2 N/m) and
mass (m = 1 kg). Equation of motion of the system is 𝑓(𝑡) = 𝑚𝑥̈ (𝑡) + 𝑘𝑥(𝑡). Based on the
equation of motion, derive the transfer function for 𝑓(𝑡) is the input and 𝑥(𝑡) is the
output. Then, find the numerical solution by integration and transfer function. Find the
solution and draw the graph, 𝑥(𝑡) vs 𝑡, for each problem listed below!
a) 𝑓(𝑡) = 1(𝑡) is applied to the system.
b) 𝑓(𝑡) = 𝑡 is applied to the system.
c) 𝑓(𝑡) = sin(2𝜋𝑡)is applied to the system
4
2.2. Transfer Function of Electrical System
Exercise #6
Figure 3 shows the example of electric system consists of capacitor (C = 100 mF) and
resistor (R = 3Ω). Supply voltage of the system is denoted by 𝑉=> (𝑡). As electric current
(𝑖) flows through the system, the output voltage (𝑉@AB ) can be calculated. The equation
below define the relation between 𝑉=> (𝑡) and 𝑖(𝑡).
1
𝑉=> (𝑡) = D 𝑖(𝑡)𝑑𝑡 + 𝑅𝑖(𝑡),
𝐶
meanwhile, 𝑣@AB (𝑡) can be calculated by using following formula
𝑉@AB (𝑡) = 𝑅𝑖(𝑡).
From two equations stated above, we can get two transfer functions,
𝐼(𝑠) 𝑠𝐶
𝐺H (𝑠) = = ,
𝑉=> (𝑠) 1 + 𝑠𝐶𝑅
and
𝑉@AB (𝑠)
𝐺/ (𝑠) = = 𝑅.
𝐼(𝑠)
Based on two transfer functions above, we can make following chart to help the
simulation
5
Find the solution and draw the graph, 𝑉=> (𝑡) vs 𝑡, 𝑖(𝑡) vs 𝑡, and 𝑉@AB (𝑡) vs 𝑡, for each
problem listed below!
a) 𝑉=> (𝑡) = 1(𝑡)
b) 𝑉=> (𝑡) = 10 + 0.1𝑠𝑖𝑛(20𝜋𝑡)
c) 𝑉=> (𝑡) = 10 + 0.1𝑠𝑖𝑛(0.2𝜋𝑡)
2.3. Transfer Function Simulation on Command Window
Exercise #7
Transfer function simulation can also be done on Matlab’s command window. Write
following program on your command window to see the electric system respon if it gets
𝑉=> (𝑡) = 1(𝑡).
clear all
close all
clc
t = 0:0.001:2; % Time
R = 3; % Resistance of the resistor
C = 100/10^3; % Capacitance of the capacitor
figure (1)
step(G1,t)
grid
figure (2)
step(G2,t)
grid
figure (3)
step(G1*G2,G,t)
grid
If you want to change the input into 𝑉=> (𝑡) = 𝑡, then you should add following command
into your program.
vin = t; % Input signal as a ramp signal
vout = lsim(G,vin,t); % Response (voltage output)
i = lsim(G1,vin,t); % Response (current output)
figure (4)
subplot 211
plot(t,i)
subplot 212
plot(t,vout)
How if the input is sinusoidal? Write your complete program on the answer sheet!