Design of First and Second Order Circuits in Time and Frequency Domain
Design of First and Second Order Circuits in Time and Frequency Domain
Design of First and Second Order Circuits in Time and Frequency Domain
Design of first and second order circuits in time and frequency domain
AIM: To analyze the First second order system in time domain using MATLAB.
PROCEDURE:
2. Type “SIMULINK” in the command window or just go to the simulink library bar. A new box will open where we can
get the output of different responses using block diagrams.
3. In the ‘New Model’ window, add input response, transfer function, scope and workspace.
THEORY:
CIRCUIT DIAGRAM:
Model graph
RESULT: Thus the importance of Damping Coefficient ζwas studied with its various conditions and for various values
for various inputs.
AIM: To analyze the First second order system in frequency domain using MATLAB.
Matlab Program:
%Draw the Bode Plot for the given transfer function(S)=1/S(S2+2S+3) %Find (i)Gain Margin (ii) Phase Margin (iii)
Gain Cross over Frequency %(iv) Phase Cross over Frequency (v)Resonant Peak (vi)Resonant %Frequency
(vii)Bandwidth
num=[1];
den=[1 2 3 0];
w=logspace(-1,3,100);
figure(1);
bode(num,den,w);
grid;
Gain_Margin_dB=20*log10(Gm)
Phase_Margin=Pm
Gaincrossover_Frequency=Wcp
Phasecrossover_Frequency=Wcg
[M P w]=bode(num,den);
[Mp i]=max(M);
Resonant_PeakdB=20*log10(Mp)
Wp=w(i);
Resonant_Frequency=Wp
for i=1:1:length(M);
if M(i)<=1/(sqrt(2));
Bandwidth=w(i)
break;
end;
end
Output
Non-unity Feedback Systems
Example M9.1
Resonance peak, resonance frequency, and bandwidth of the closed-loop frequency response may be obtained by
generating Bode plot of the closed-loop transfer function.
s = tf('s');
G = 10/(s*(s+5));
H = 1/(0.1*s+1);
M = feedback(G,H);
w = logspace(-1,1);
bode(M,w);
grid;
This MATLAB program produces Bode plots for the closed-loop system shown in Fig.M9.1. Right-clicking away from a
curve brings up a menu. From this menu, select Characteristics --> Peak Response. When selected, a dot appears on the
curve at the appropriate point Let your mouse rest on the point to read the parameters of the resonance peak. Now point
the mouse at any point on the magnitude curve and left-click. The arrow curser changes to four-pointed arrow. Hold
down the left mouse button and drag the four-pointed arrow along the magnitude curve. By trial-and-error, locate the
point where magnitude is - 3dB. The frequency at this point is the bandwidth.
From Fig, we obtain the following:
The gain margin and phase margin can be obtained from the Bode plot of G(s)H(s). The Bode plot and the performance
measures generated by the command margin(G*H) are shown in Fig.
2. Performance evaluation of medium and long transmission lines
As we can see here, VS and VR is the supply and receiving end voltages respectively, and
I1 and I3 are the values of currents flowing through the admittances. And
..........(1)
..........(2)
Now substituting equation (2) to equation (1)
Comparing equation (4) and (5) with the standard ABCD parameter equations
Voltage regulation of transmission line is measure of change of receiving end voltage from
no-load to full load condition.
Circuit Diagram:
PROCEDURE:
Problem statement 1:
A 3-phase overhead transmission line deliver a 1100kw at 11kv at 0.8pf lagging the total resistance
and inductive reactance of the line are 8 ohm and 16 ohm respectively. Determine 1)Line current 2)
Sending end voltage 3Sending end power factor 4)Sending end real power 5)Sending end reactive
power 6)Transmission efficiency 7)Percentage regulation 8)ABCD parameters.
clc;
R=input('resistance of the line in ohm=');
X=input('reactance of the line in ohm=');
VR3ph=input('voltage at receiving end in KV=');
PR=input('real load at receiving end in MW=');
QR=input('reactive load at receiving end in MVAR=');
Z=R+j*X;
ABCD=[1 Z;0 1];
VR=VR3ph/sqrt(3)+j*0;
SR=PR+j*QR;
IR=conj(SR)/(3*conj(VR));
VSIS=ABCD*[VR;IR]; VS=VSIS(1);
VS3ph=sqrt(3)*abs(VS);
IS=VSIS(2);
ISm=1000*abs(IS);
pfs=cos(angle(VS)-angle(IS));
SS=3*VS*conj(IS);
Reg=((VS3ph-VR3ph)/(VR3ph))*100;
Eff=PR/real(SS)*100;
fprintf('\n IS=%g A',ISm);
fprintf('\n pf=%g',pfs);
fprintf('\n VS=%g L-L KV',VS3ph);
fprintf('\n PS=%g MW',real(SS));
fprintf('\n QS=%g MVAR',imag(SS));
fprintf('\n percentage voltage regulation=%g',Reg);
fprintf('\n percentage transmission line efficiency=%g',Eff);
fprintf('\n ABCD parameters of transmission line\n');
disp(ABCD);
Inputs
resistance of the line in ohm=8 reactance of
the line in ohm=16 voltage at receiving end
in KV=11 real load at receiving end in
MW=1.1
reactive load at receiving end in MVAR=0.825
Output response:
IS=72.1688 A
pf=0.751626
VS=13.0384 L-L
KV PS=1.225
MW QS=1.075
MVAR
percentage voltage regulation=18.531
percntage transmission line
Efficiency=89.7959 ABCD parameters of
transmission line
1.0000 8.0000 +16.0000i
0 1.0000
Problem statement :
A 3-phase 50Hz overhead tranmission line delivers 10 MW at 0.8pf lagging at 66 kV. The
resistance, inductive reactance and capacitive susceptance 10 ohm, 20 ohm and 4*10^-4 siemen.
Determine 1)Sending end current 2)Sending end voltage 3)Sending end power factor 4)ABCD
parameter 5) Regulation 6) Transmission effeciency using nominal T method.
clear;
clc;
R=input('resistance of the line in ohm=');
X=input('reactance of the line in ohm=');
B=input('susceptance of shunt line in mho=');
VR3ph=input('voltage at receiving end in KV=');
PR=input('real load at receiving end in MW=');
QR=input('reactive load at receiving end in MVAR=');
Z=R+j*X;
Y=0+j*B;
type=input('type(P-Pie/T-tmethod)=','s');
switch type
case'P'
ABCD=[1+Z*Y/2 Z;Y*(1+Z*Y/4) 1+Z*Y/2];
case'T'
ABCD=[1+Z*Y/2 Z*(1+Z*Y/4);Y 1+Z*Y/2];
otherwise
Error('Invaid type choosen!!!')
end
VR=VR3ph/sqrt(3)+j*0;
SR=PR+j*QR;
IR=conj(SR)/(3*conj(VR)); VSIS=ABCD*[VR;IR]; VS=VSIS(1);
VS3ph=sqrt(3)*abs(VS); IS=VSIS(2); ISm=1000*abs(IS);
Pfs=cos(angle(VS)-angle(IS)); SS=3*VS*conj(IS);
Reg=(VS3ph-VR3ph)/VR3ph*100; Eff=PR/real(SS)*100;
fprintf('\n IS=%g A',ISm); fprintf('\n Pfs=%g',Pfs);
fprintf('\n VS=%g L-L KV',VS3ph);
fprintf('\n PS=%g MW',real(SS)); fprintf('\n QS=%g MVAR',imag(SS));
fprintf('\n percentage voltage regulation=%g',Reg);
fprintf('\n percentage transmission line efficiency=%g',Eff);
fprintf('\n ABCD parameters of transmission line\n');
disp(ABCD);
Inputs:
resistance of the line in ohm=10 reactance
of the line in ohm=20 voltage at receiving
end in KV=66 real load at receiving end in
MW=10
reactive load at receiving end in
MVAR=7.5 susceptance of shunt line in
mho=4e-4 type(P-Pie/T-tmethod)=T
Output response:
IS=100.533 A
Pfs=0.853122
VS=69.5439 L-L
KV PS=10.331 MW
QS=6.31771 MVAR
percentage voltage regulation=5.36958
percentage transmission line
efficiency=96.7965 ABCD parameters of
transmission line
0.9960 + 0.0020i 9.9600 +19.9700i
0 + 0.0004i 0.9960 + 0.0020i
Inputs:
resistance of the line in ohm=24 reactance of the
line in ohm=49.0088 susceptance of shunt line
in mho=3.76e-4 voltage at receiving end in
KV=132
real load at receiving end in MW=40 reactive load
at receiving end in MVAR=30
Output
response:
IS=200.922 A
Pfs=0.830052
VS=149.46 L-L
KV PS=43.1736
MW Qs=29.007
MVAR
percentage voltage
regulation=13.2272
Efficiency=92.6493
A*D-B*C=1
ABCd parameters of transmission
line 0.9908 + 0.0045i 23.8528
+48.8944i
-0.0000 + 0.0004i 0.9908 + 0.0045i
3.SYMMETRICAL COMPONENTS
Apparatus: MATLAB
Theory:
Before we discuss the symmetrical component transformation, let us first define the a-
operator.
a e j120 1 j 3
0
2 2
Note that for the above operator the following relations hold
a2 e j 240 1 j 3
0
a
2
2
a e 1
3 j 360 0
and so on
a5 e j 600 e j 360 e j 240 a
0 0 2 0
1 3 1 3
1 a a2 1 j j 0
2 2 2 2
Similarly
Vb2 aVa2 and Vc2 a2V
a2
Finally
Program:
V012 = [0.6 90; 1.0 30; 0.8 -30];
rankV012=length(V012(1,:));
if rankV012 == 2
mag= V012(:,1); ang=pi/180*V012(:,2);
V012r=mag.*(cos(ang)+j*sin(ang)); elseif rankV012 ==1
V012r=V012;
else
fprintf('\n Symmetrical components must be expressed in a one column array in rectangular
complex form \n')
fprintf(' or in a two column array in polar form, with 1st column magnitude & 2nd
column\n')
fprintf(' phase angle in degree. \n')
return,
end
a=cos(2*pi/3)+j*sin(2*pi/3);
A = [1 1 1; 1 a^2 a; 1 a a^2]; Vabc= A*V012r
Vabcp= [abs(Vabc) 180/pi*angle(Vabc)]; fprintf(' \n Unbalanced phasors \n')
fprintf(' Magnitude Angle Deg.\n')
disp(Vabcp)
Vabc0=V012r(1)*[1; 1; 1];
Vabc1=V012r(2)*[1; a^2; a]; Vabc2=V012r(3)*[1; a; a^2];
Procedure:
1. Open Matlab--> File ---> New---> Script
2. Write the program
3. Enter F5 to run the program
4. Observe the results in MATLAB command window.
Result:
Vabc =
1.5588 + 0.7000i
-0.0000 + 0.4000i
-1.5588 + 0.7000i
Unbalanced phasors
Apparatus: MATLAB
Theory: The response of the armature current when a three-phase symmetrical short circuit
occurs at the terminals of an unloaded synchronous generator.
It is assumed that there is no dc offset in the armature current. The magnitude of the current
decreases exponentially from a high initial value. The instantaneous expression for the fault
current is given by
where Vt is the magnitude of the terminal voltage, α is its phase angle and
with .
we have neglected the effect of the armature resistance hence α = π/2. Let us assume that the
fault occurs at time t = 0. From (6.9) we get the rms value of the
current as
which is called the subtransient fault current. The duration of the subtransient current is
dictated by the time constant Td . As the time progresses and Td´´< t < Td´ , the first
exponential term will start decaying and will eventually vanish. However since t is still nearly
equal to zero, we have the following rms value of the current
This is called the transient fault current. Now as the time progress further and the second
exponential term also decays, we get the following rms value of the current for the sinusoidal
steady state
In addition to the ac, the fault currents will also contain the dc offset. Note that a symmetrical
fault occurs when three different phases are in three different locations in the ac cycle.
Therefore the dc offsets in the three phases are different. The maximum value of the dc offset
is given by
Procedure:
1. Open Matlab-->Simulink--> File ---> New---> Model
2. Open Simulink Library and browse the components
3. Connect the components as per circuit diagram
4. Set the desired voltage and required frequency
5. Simulate the circuit using MATLAB
6. Plot the waveforms
Circuit Diagram:
Graph:
Calculations:
9. Design and analysis of feedback control system
Block diagram reduction technique using MATLAB
Aim: simulation of multi feedback system
THEORY:
Block diagram is a diagram of a system in which the principal parts or functions are represented by blocks connected by
lines that show the relationships of the blocks.[1] They are heavily used in the engineering world in hardware
design, electronic design, software design, and process flow diagrams.
Overview
The block diagram is typically used for a higher level, less detailed description aimed more at understanding
the overall concepts and less at understanding the details of implementation. Contrast this with the schematic
diagram and layout diagram used in the electrical engineering world, where the schematic diagram shows the
details of each electrical component and the layout diagram shows the details of physical construction.
Because block diagrams are a visual language for describing actions in a complex system, it is possible to
formalize them into a specialized programmable logic controller (PLC) programming language. An example is
the Function block diagram, one of five programming languages defined in part 3 of the IEC 61131 (see IEC
61131-3) standard.
Since this is a real, bona fide computer programming language, it is highly formalized (see formal system) with
strict rules for how diagrams are to be built. Directed lines are used to connect input variables to function
inputs, function outputs to output variables, and function outputs to inputs of other functions.
These blocks portray mathematical or logical operations that occur in time sequence. They do not represent the
physical entities, such as processors or relays, that perform those operations. Each block is therefore a black
box. The rules require the logical sequence to go from left to right and top to bottom.
Usage
As an example, a block diagram of a radio is not expected to show each and every wire and dial and switch, but
the schematic diagram is. The schematic diagram of a radio does not show the width of each wire in the printed
circuit board, but the layout diagram does.
To make an analogy to the map making world, a block diagram is similar to a highway map of an entire nation.
The major cities (functions) are listed but the minor county roads and city streets are not. When
troubleshooting, this high level map is useful in narrowing down and isolating where a problem or fault is.[2]
Block diagrams rely on the principle of the black box where the contents are hidden from view either to avoid
being distracted by the details or because the details are not known. We know what goes in, we know what
goes out, but we can't see how the box does its work.[3][4]
In electrical engineering, a design will often begin as a very high level block diagram, becoming more and
more detailed block diagrams as the design progresses, finally ending in block diagrams detailed enough that
each individual block can be easily implemented (at which point the block diagram is also a schematic
diagram). This is known as top down design.[4] Geometric shapes are often used in the diagram to aid
interpretation and clarify meaning of the process or model. The geometric shapes are connected by lines to
indicate association and direction/order of traversal. Each engineering discipline has their own meaning for
each shape.
Blockdiagram:
PROGRAM:
System Response
The transfer function manipulations give us a transfer function model M(s) between
command input R(s) and output Y(s); model Mw(s) between disturbance input W(s) and
output Y(s); a model between command input R(s) and control U(s), etc. It is now easy to
use some of the control analysis commands available from the Control System
Toolbox. impulse(M) and step(M) commands represent common control analysis
operations that we meet in this book. Also frequently used in the book are frequency-
response plots.
Example
Program:
KA = 80;
num1=[5000]
den1=[1 1000]
G1=tf(num1,den1);
num2=[1];
den2=[1 20 0];
G2=tf(num2,den2);
M=feedback(series(KA*G1,G2),1)
step(M)
Transfer function:
.......................400000
--------------------------------------------------
s^3 + 1020 s^2 + 20000 s + 400000
%Step response with respect to W(s)
>> s = tf('s');
>> KA = 80;
>> G1 = 5000/(s+1000);
>> G2 = 1/(s*(s+20));
>> step(Mw)
Example 2
Let us examine the sensitivity of the feedback system represented by the transfer function
Note that the sensitivity is small for lower frequencies, while the transfer function primarily
passes low frequencies.
w = 0.1:0.1:10;
M = abs(0.25./((j*w).^2+j*w+0.25));
plot(w,M,'r',w,SMK,'b');
xlabel('Frequency (rad/sec)');
ylabel('Magnitude');
Fig.
Of course, the sensitivity S only represents robustness for small changes in gain K.
If K changes from 1/4 within the range K = 1/16 to K = 1, the resulting range of step
responses, generated by the following MATLAB script, is shown in Fig. This system, with
an expected wide range of K, may not be considered adequately robust. A robust system
would be expected to yield essentially the same (within an agreed-upon variation)
response to selected inputs.
s = tf('s');
S = (s*(s+1))/(s^2+s+0.25);
M1 = 0.0625/(s^2+s+0.0625);
M2 = 0.25/(s^2+s+0.25);
M3 = 1/(s^2+s+1);
step(M1);
hold on;
step(M2);
step(M3);
Fig.
11 LOAD FREQUENCY CONTROL OF A SINGLE AREA POWER SYSTEM
Aim: To become familiar with modeling and analysis of the frequency and tie-line flow dynamics of a
power system without and with load frequency controllers (LFC) and to design better controllers for
getting better responses
PROCEDURE:
3. Pick up the blocks from the simulink library browser and form a block diagram.
AIM: To become familiar with modeling and analysis of the frequency and tie-line flow dynamics of a two area power
system without and with load frequency controllers (LFC) and to design better controllers for getting better responses.
THEORY: Active power control is one of the important control actions to be perform to be normal operation of the
system to match the system generation with the continuously changing system load in order to maintain the constancy
of system frequency to a fine tolerance level. This is one of the foremost requirements in proving quality power supply.
A change in system load cases a change in the speed of all rotating masses (Turbine – generator rotor systems) of the
system leading to change in system frequency. The speed change form synchronous speed initiates the governor
control (primary control) action result in the entire participating generator – turbine units taking up the change in load,
stabilizing system frequency. Restoration of frequency to nominal value requires secondary control action which
adjusts the load - reference set points of selected (regulating) generator – turbine units. The primary objectives of
automatic generation control (AGC) are to regulate system frequency to the set nominal value and also to regulate the
net interchange of each area to the scheduled value by adjusting the outputs of the regulating units. This function is
referred to as load – frequency control (LFC). PROCEDURE: 1. Enter the command window of the MATLAB 2. Create a
new Model by selecting File - New – Model 3. Pick up the blocks from the simulink library browser and form a block
diagram 4. After forming the block diagram, save the block diagram 5. Double click the scope and view the result
MATLAB Circuit:
Model Graph:
Result:
12.Economic Dispatch of Thermal Units
Aim : To develop a program for solving economic dispatch problem without transmission
losses for a given load condition using direct method and Lambda-iteration method.
Apparatus: MATLAB
Theory:
As the losses are neglected, the system model can be understood as shown in Fig, here n number
of generating units are connected to a common bus bar, collectively meeting the total power
demand PD. It should be understood that share of power demand by the units does not involve
losses.
Since transmission losses are neglected, total demand PD is the sum of all generations of n-
number of units. For each unit, a cost functions Ci is assumed and the sum of all costs computed
from these cost functions gives the total cost of production CT.
where the cost function of the ith unit, from Eq. (1.1) is:
Ci = αi + βiPi + γiPi2
Now, the ED problem is to minimize CT, subject to the satisfaction of the following equality and
inequality constraints.
Equality constraint
The total power generation by all the generating units must be equal to the power demand.
where Pi = power generated by ith unit
PD = total power demand.
Inequality constraint
Pimin ≤ Pi ≤ Pimax i = 1, 2, … , n
Economic dispatch problem can be carried out by excluding or including generator power
limits, i.e., the inequality constraint.
The constrained total cost function can be converted into an unconstrained function by using
the Lagrange multiplier as:
The conditions for minimization of objective function can be found by equating partial
differentials of the unconstrained function to zero as
Since Ci = C1 + C2+…+Cn
From the above equation the coordinate equations can be written as:
The second condition can be obtained from the following equation:
For a known value of λ, the power generated by the ith unit from can be written as:
The value of λ can be calculated and compute the values of Pi for i = 1, 2,…, n for optimal
scheduling of generation.
PD = 800;
DelP = 10;
fprintf(' ')
disp(['Lamda P1 P2 P3 DP'...
iter = 0;
iter = iter + 1;
P = (lamda - beta)./(2*gamma);
DelP = PD - sum(P);
J = sum(ones(length(gamma),1)./(2*gamma));
Delamda = DelP/J;
disp([lamda,P(1),P(2),P(3),DelP,J,Delamda])
end
Result: