Example H3.7
Matlab code for example 3.7 from the book "Regeltechniek voor het HBO"
Bode diagram and Polar diagram of first order system
- Date : 11/08/2021
- Revision : 1.0
Copyright (c) 2021, Studieboeken Specialist Permission is granted to copy, modify and redistribute this file, provided that this header message is retained.
The given situation
Assume that a first order system, type RC-network, is given as in figure 3.2 in the book:
Assume that K > 0 and that ω and τ are also > 0 . Thus the following equations are valid for the length and the angle of the vector : and Bode diagram
Before we draw the bodediagram using Matlab commands we could already think about how it could look like. Let us first take the case where ω is very small and approaching zero. In that case: and . Then let's take the case where ω is very big. Then and Another interesting case is the one where . This we call the breaking point. Here , that is why it is also called the -3dB point. In order to draw a bode diagram in Matlab we need to assign some numbers:
% clear all variables from Workspace and close all figures
K = 1; % Gain of the RC network is one
% Fix the frequency range to make it easier to see the effect of
Nyquist diagram (polaire figuur)
Conclusions
We can see in both diagrams that the amplitude of the harmonic outputsignal gets smaller and the phase difference gets biggers as the frequency increases. A response like this is called a Low Pass Filter response.
Generate Matlab figure(s) for usage in the book
Init create Enhanced Figures
Close all the earlier enhanced figures with a certain tag
EnhancedFig = findobj(0, 'Tag', 'EnhancedImage');
Enhance the figures
set(gcf, 'Tag','EnhancedImage');
% create the pzmap plot again but now with a figure handle
h = nyquistplot(H); % Use this command to return plot handle to programmatically customize the plot.
p.ShowFullContour = 'off'; % Only show positive frequencies
p.Title.String = 'Nyquist Diagram for a first order system';
p.Xlabel.String = 'Re(H)';
p.Ylabel.String = 'Im(H)';
% Calculate location axis
Xoffset=0.14; % left part of the figure window not used by the graph
Scale=0.8; % part of the whole figure window used by the graph
Vaxis_loc=Xoffset+0.8*abs(1.5)/abs(0-1.5);
omega = char(969); % Greek letter omega
annotation(figure1,'textarrow','X',[0.468 0.401],'Y',[0.188 0.231],...
'String',[omega, ' = 1 /tau']);
annotation(figure1,'textarrow','X',[0.73 0.655],'Y',[0.53 0.56],'String',[omega, ' = 0']);
annotation(figure1,'textarrow','X',[0.24 0.15],'Y',[0.60 0.56],'String',[omega, ' = inf']);