Example H4.5
Matlab code for example 4.5 from the book "Regeltechniek voor het HBO"
Integrated effect in practice
- Date : 28/02/2022
- Revision : 2.0
Copyright (c) 2022, Studieboeken Specialist Permission is granted to copy, modify and redistribute this file, provided that this header message is retained.
Example of an integrator: flow in a container
The incoming flow of water in a cilindrical container is , while the outgoing flow equals . The diameter of the container is 0.8 meter. What is the level going to be in the container?
The block diagram of this system is displayed in figure 4.12a. The (positive) difference between in- and outgoing flow is integrated (summed up) to the volume . Dividing this volume by the surface of the container () provides the height of the container. Figure 4.12b shows the progression of the level over time. In case that and/or would change, the height and thus the level would change and not be a straight line as shown in this case. Two other examples of an integrator
Two other examples of an integrator are these:
- the angle over which a motor shaft (with an angular velocity ω rad/s) has turned.
- the distance travelled at a certain speed is another example of an integrating action.
The result of an integrating action is not always positive: with a negative input the result will decrease. And at the start of an integration, the output does not always have to be zero. This is the so called initial value of an integrator.
Matlab code solution 1
% clear all variables from Workspace and close all figures
Flow_in=0.2; % Flow in [mˆ3/s]
Flow_out=0.1; % Flow out [mˆ3/s]
Surface_cyl=0.16*pi; % [mˆ2]
Tsim1=1.2; % Simulation time in seconds
t1 = 0:Tsim1/100:Tsim1; % Make time array
e1 = (Flow_in-Flow_out)*ones(size(t1)); %
% Simulate the response of system H to the input x1
title('outputsignal level');
Matlab code solution 2 (with Symbolic Math Toolbox)
% create symbolic functions
syms t phi_i(t) phi_o(t) level(t);
flow_in=0.2; % Flow in [mˆ3/s]
flow_out=0.1; % Flow out [mˆ3/s]
surface_cyl=0.16*pi; % [mˆ2]
volume(t)=int(flow_in-flow_out,sym(t))
volume(t) =
level(t)=volume(t)/surface_cyl
level(t) =
% Plot the output signal level(t)
fplot(level(t),t_interval);
title('outputsignal level');