basic electrical simulation lab › sites › default › files › pics › eee › eee-e... ·...
TRANSCRIPT
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 1 Cass: III year B.Tech EEE Ist Semester
Exp - 1 1 of 3
BASIC OPERATIONS ON MATRICES
AIM: Generate a matrix and perform basic operations on matrices using MATLAB software.
Software Required: MATLAB software
Theory:
MATLAB is a MATrix laboratory, It is widely used to solve different types of scientific problems. The basic data structure is a complex double
precision matrix.
MATLAB treats all variables as matrices. Vectors are special forms of
matrices and contain only one row or one column. A matrix with one row is
called row vector and a matrix with single column is called column vector. A matrix with only one row and one column is a scalar.
A matrix can be generated and portion of a matrix can be extracted
and stored in a smaller matrix by specifying the the rows and columns to
extract.
Following are some of the matrix building functions.
zeros(M,N) MxN matrix of zeros ones(M,N) MxN matrix of ones
eye(M) identity matrix of size M.
rand(M,N) MxN matrix of uniformly distributed random. numbers on (0,1)
Following are some of the commands on matrix and operations . det(A) -determinant of a square matrix A.
inv(A) - inverse of a matrix A.
rank(A) - rank of a matrix A.
eig(A) - eigenvalues and eigenvectors of Vector A. size(a) – size of matrix A
PROCEDURE:-
Open MATLAB
Open new M-file Type the program
Save in current directory
Compile and Run the program For the output see command window\ Figure window
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 1 Cass: III year B.Tech EEE Ist Semester
Exp - 1 2 of 3
PROGRAM -1:
clc;
% Creating a row vector A=[1 2 3]
% by using "," between the each element
B= [ 2.3, 4.5, 7.8 ]
% Creating a column vector
X =[1; 2; 3]
% Creating a matrix Q=[1 2 3; 4 5 6;7 8 9]
% Creating a Long array ( series vector) t = 1:10
% series vector with increments k =-2:0.5:1
t =linspace(1,10,4)
% Creating a matrix with series vector
B = [1:4; 5:8]
PROGRAM -2:
% Extracting an elements from the matrix.
A = [1,2,3;4,5,6;7,8,9]
x = A( 3 , 1)
% Extracting a column from the matrix.
y= A( : , 2)
% Extracting a row from the matrix.
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 1 Cass: III year B.Tech EEE Ist Semester
Exp - 1 3 of 3
y= A(3 ,: )
% Extracting a sub matrix from a Matrix. B=A(2 : 2 , 1 : 3)
PROGRAM -3:
% addition of two matrices
clc; A=[1 2 3; 4 5 6;7 8 9]
B= [ 5 3 2; -2 -4 0; -9 3 2 ]
C= A+B
% multiplications of two matrices
D= A*B
% Division of two matrices
E=A/B
% Inverse of Matrix
inv(B)
F= A*inv(B)
% Element byelement Multiplication;
A=[1 2 3];
B= [ 10 10 10 ] ; C= A.*B
% Element by element division;
A=[1 2 3]; B= [ 10 10 10 ] ;
D= A./B
Results :
Lab In –Charge HOD –EEE
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 2 Cass: III year B.Tech EEE Ist Semester
Exp - 2 1 of 7
Generation of various signals and sequences. Aim:
Generate various signals and sequences (Periodic and aperiodic), such as
Unit Impulse, Unit Step, Square, Saw tooth, Triangular, Sinusoidal, Ramp, Sinc.
Software Required: Matlab software.
Theory:
Unit impulse signal: The Ideal impulse function, is a function that is zero
everywhere but infinitely high at the origin. However, the area of the impulse
is finite . It is defined as δ(t) = 1 at t=0
=0 other wise
Unit step signal:The unit step function, also known as the Heaviside
function, is defined as such:
u(t) = 0 if t<0
=1 if t>=0
Sinc signal: The Sinc function is defined in the following manner:
x
xxc
sin)(sin if x≠0 and
sinc(x) = 1 at x=0
Following are some of the MATLAB functions used to plot the graphs.
Plot(Y): Plots the columns of Y versus their index if Y is a real number.
Plot(x,y): Plots all lines defined by vector X versus vector Y pairs. Stem(x,y):
A two-dimensional stem plot displays data as lines extending from a
baseline along the x-axis. A circle (the default) or other marker whose y-position represents the data value terminates each stem.
Subplot(m,n)
subplot divides the current figure into rectangular panes that are numbered row wise.
Subplot(m,n,p)
subplot(m,n,p) breaks the figure window into an m-by-n matrix
of small axes. P is a number that specifies the position of the pane
(subplot).
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 2 Cass: III year B.Tech EEE Ist Semester
Exp - 2 2 of 7
PROGRAM:
% Generation of signals and sequences
clc;
%generation of unit impulse signal
t1=-1:0.02:1
y1=(t1==0); subplot(2,2,1);
plot(t1,y1);
axis([-1 1 -0.5 1.5]);
xlabel('time'); ylabel('amplitude');
title('unit impulse signal');
%generation of impulse sequence subplot(2,2,2);
stem(t1,y1);
axis([-1 1 -0.5 1.5]);
xlabel('n'); ylabel('amplitude');
title('unit impulse sequence');
%generation of unit step signal
t2=-5:0.1:5; y2=(t2>=0);
subplot(2,2,3);
plot(t2,y2);
axis([-5 5 -0.5 1.5]); xlabel('time');
ylabel('amplitude');
title('unit step signal');
%generation of unit step sequence
subplot(2,2,4);
stem(t2,y2);
axis([-5 5 -0.5 1.5]);
xlabel('n'); ylabel('amplitude');
title('unit step sequence');
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 2 Cass: III year B.Tech EEE Ist Semester
Exp - 2 3 of 7
%generation of square wave signal t=0:0.2:10;
y3=square(t);
figure;
subplot(2,2,1); plot(t,y3);
axis([0 10 -2 2]);
xlabel('time');
ylabel('amplitude'); title('square wave signal');
%generation of square wave sequence
subplot(2,2,2);
stem(t,y3); axis([0 10 -2 2]);
xlabel('n');
ylabel('amplitude');
title('square wave sequence');
%generation of sawtooth signal
y4=sawtooth(t);
subplot(2,2,3); plot(t,y4);
axis([0 10 -2 2]);
xlabel('time');
ylabel('amplitude'); title('sawtooth wave signal');
%generation of sawtooth sequence
subplot(2,2,4);
stem(t,y4); axis([0 10 -2 2]);
xlabel('n');
ylabel('amplitude');
title('sawtooth wave sequence');
%generation of triangular wave signal
y5=sawtooth(t,0.5);
figure; subplot(2,2,1);
plot(t,y5);
axis([0 10 -2 2]);
xlabel('time');
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 2 Cass: III year B.Tech EEE Ist Semester
Exp - 2 4 of 7
ylabel('amplitude'); title(' triangular wave signal');
%generation of triangular wave sequence
subplot(2,2,2); stem(t,y5);
axis([0 10 -2 2]);
xlabel('n');
ylabel('amplitude'); title('triangular wave sequence');
%generation of sinsoidal wave signal
y6=sin(t);
subplot(2,2,3); plot(t,y6);
axis([0 10 -2 2]);
xlabel('time');
ylabel('amplitude'); title(' sinsoidal wave signal');
%generation of sin wave sequence
subplot(2,2,4);
stem(t,y6); axis([0 10 -2 2]);
xlabel('n');
ylabel('amplitude');
title('sin wave sequence');
%generation of ramp signal
y7=t;
figure; subplot(2,2,1);
plot(t,y7);
xlabel('time');
ylabel('amplitude'); title('ramp signal');
%generation of ramp sequence
subplot(2,2,2); stem(t,y7);
xlabel('n');
ylabel('amplitude');
title('ramp sequence');
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 2 Cass: III year B.Tech EEE Ist Semester
Exp - 2 5 of 7
%generation of sinc signal
t3=linspace(-5,5);
y8=sinc(t3); subplot(2,2,3);
plot(t3,y8);
xlabel('time');
ylabel('amplitude'); title(' sinc signal');
%generation of sinc sequence
subplot(2,2,4);
stem(y8); xlabel('n');
ylabel('amplitude');
title('sinc sequence');
output:
-1 -0.5 0 0.5 1-0.5
0
0.5
1
1.5
time
am
plit
ude
unit impulse signal
-1 -0.5 0 0.5 1-0.5
0
0.5
1
1.5
n
am
plit
ude
unit impulse sequence
-5 0 5-0.5
0
0.5
1
1.5
time
am
plit
ude
unit step signal
-5 0 5-0.5
0
0.5
1
1.5
n
am
plit
ude
unit step sequence
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 2 Cass: III year B.Tech EEE Ist Semester
Exp - 2 6 of 7
0 5 10-2
-1
0
1
2
time
am
plit
ude
square wave signal
0 5 10-2
-1
0
1
2
nam
plit
ude
square wave sequence
0 5 10-2
-1
0
1
2
time
am
plit
ude
sawtooth wave signal
0 5 10-2
-1
0
1
2
n
am
plit
ude
sawtooth wave sequence
0 5 10-2
-1
0
1
2
time
am
plit
ude
triangular wave signal
0 5 10-2
-1
0
1
2
n
am
plit
ude
triangular wave sequence
0 5 10-2
-1
0
1
2
time
am
plit
ude
sinsoidal wave signal
0 5 10-2
-1
0
1
2
n
am
plit
ude
sin wave sequence
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 2 Cass: III year B.Tech EEE Ist Semester
Exp - 2 7 of 7
0 5 100
5
10
time
am
plit
ude
ramp signal
0 5 100
5
10
n
am
plit
ude
ramp sequence
-5 0 5-0.5
0
0.5
1
time
am
plit
ude
sinc signal
0 50 100-0.5
0
0.5
1
n
am
plit
ude
sinc sequence
Results : Lab In –Charge HOD –EEE
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 3 Cass: III year B.Tech EEE Ist Semester
Exp - 3 1 of 7
Basic Operations on Signals and sequences Aim:
Perform the operations on signals and sequences such as addition,
multiplication,scaling, shifting, folding and also compute energy and power.
Software Required: Matlab software.
Theory:
Addition: Any two signals can be added to produce a new signal,
z (t) = x (t) + y (t)
Multiplication :
Multiplication of two signals can be obtained by multiplying their values at
every instants. z(t) = x (t).* y (t)
Time reversal/Folding:
Time reversal of a signal x(t) can be obtained by folding the signal about t=0. z(t)= x(-t)
if x(t) is original signal then z(t) is folded signal.
Signal Amplification/Scaling :
Y(n)=a.x(n) if a < 1 ; attenuation
a >1 ;amplification
Time shifting: The time shifting of x(n) obtained by delay or advance the
signal in time by using y(n)=x(n+k)
If k is a positive number, y(n) shifted to the right i e the shifting delays the
signal.
If k is a negative number, y(n ) it gets shifted left. Signal Shifting advances the signal.
Energy:
N
N
nxnE2
)()(
Average power: N
nxN
nP0
2)(
1)(
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 3 Cass: III year B.Tech EEE Ist Semester
Exp - 3 2 of 7
PROCEDURE:- Open new m-file and Save in current directory
Type the code
Compile and Run the program.
For the output, see command window\ Figure window
PROGRAM:
clc;
clear all; close all;
% Generating two input signals t=0:.01:1;
x1=sin(2*pi*4*t);
x2=sin(2*pi*8*t);
subplot(2,2,1); plot(t,x1);
xlabel('time');
ylabel('amplitude'); title('input signal 1');
subplot(2,2,2);
plot(t,x2); xlabel('time');
ylabel('amplitude');
title('input signal 2');
% Addition of signals
y1=x1+x2;
subplot(2,2,3); plot(t,y1);
xlabel('time');
ylabel('amplitude'); title('addition of two signals');
% Multiplication of signals y2=x1.*x2;
subplot(2,2,4);
plot(t,y2); xlabel('time');
ylabel('amplitude');
title('multiplication of two signals');
% Scaling of a signal1
A=2;
y3=A*x1;
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 3 Cass: III year B.Tech EEE Ist Semester
Exp - 3 3 of 7
figure;
subplot(2,2,1); plot(t,x1);
xlabel('time');
ylabel('amplitude');
title('input signal')
subplot(2,2,2); plot(t,y3);
xlabel('time');
ylabel('amplitude'); title('amplified input signal');
% Folding of a signal1 h=length(x1);
nx=0:h-1;
subplot(2,2,3);
plot(nx,x1); xlabel('nx');
ylabel('amplitude');
title('input signal') y4=fliplr(x1);
nf=-fliplr(nx);
subplot(2,2,4); plot(nf,y4);
xlabel('nf');
ylabel('amplitude'); title('folded signal');
%Shifting of a signal 1
figure; subplot(3,1,1);
plot(t,x1);
xlabel('time t'); ylabel('amplitude');
title('input signal');
subplot(3,1,2); plot(t+2,x1);
xlabel('t+2');
ylabel('amplitude'); title('right shifted signal');
subplot(3,1,3);
plot(t-2,x1);
xlabel('t-2'); ylabel('amplitude');
title('left shifted signal');
%~~~~~~~~~~~~~~~~~~~~~~~~~
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 3 Cass: III year B.Tech EEE Ist Semester
Exp - 3 4 of 7
%Operations on sequences n1=1:1:9;
s1=[1 2 3 0 5 8 0 2 4];
figure; subplot(2,2,1);
stem(n1,s1);
xlabel('n1'); ylabel('amplitude');
title('input sequence1');
s2=[1 1 2 4 6 0 5 3 6]; subplot(2,2,2);
stem(n1,s2);
xlabel('n2');
ylabel('amplitude'); title('input sequence2');
% Addition of sequences s3=s1+s2;
subplot(2,2,3);
stem(n1,s3); xlabel('n1');
ylabel('amplitude');
title('sum of two sequences');
% Multiplication of sequences
s4=s1.*s2;
subplot(2,2,4); stem(n1,s4);
xlabel('n1');
ylabel('amplitude'); title('product of two sequences');
% Program for energy of a sequence z1=[ 1 3 2 4 1 ];
e1=sum(abs(z1).^2);
disp('energy of given sequence is');e1
% Program for energy of a signal
t=0:1:10
z2=cos(2*pi*50*t).^2; e2=sum(abs(z2).^2);
disp('energy of given signal is'); e2
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 3 Cass: III year B.Tech EEE Ist Semester
Exp - 3 5 of 7
% program for power of a sequence
p1= (sum(abs(z1).^2))/length(z1);
disp('power of given sequence is');p1
% program for power of a signal
p2=(sum(abs(z2).^2))/length(z2); disp('power of given signal is');p2
Outputs:
0 0.5 1-1
-0.5
0
0.5
1
time
am
plit
ude
input signal 1
0 0.5 1-1
-0.5
0
0.5
1
time
am
plit
ude
input signal 2
0 0.5 1-2
-1
0
1
2
time
am
plit
ude
addition of two signals
0 0.5 1-1
-0.5
0
0.5
1
time
am
plit
ude
multiplication of two signals
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 3 Cass: III year B.Tech EEE Ist Semester
Exp - 3 6 of 7
0 0.5 1-1
-0.5
0
0.5
1
time
am
plit
ude
input signal
0 0.5 1-2
-1
0
1
2
time
am
plit
ude
amplified input signal
0 50 100-1
-0.5
0
0.5
1
nx
am
plit
ude
input signal
-100 -50 0-1
-0.5
0
0.5
1
nf
am
plit
ude
folded signal
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-1
0
1
time t
am
plit
ude
input signal
2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3-1
0
1
t+2
am
plit
ude
right shifted signal
-2 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1-1
0
1
t-2
am
plit
ude
left shifted signal
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 3 Cass: III year B.Tech EEE Ist Semester
Exp - 3 7 of 7
0 5 100
2
4
6
8
n1
am
plit
ude
input sequence1
0 5 100
2
4
6
n2
am
plit
ude
input sequence2
0 5 100
5
10
15
n1
am
plit
ude
sum of two sequences
0 5 100
10
20
30
n1
am
plit
ude
product of two sequences
Results :
Lab In –Charge HOD –EEE
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 4 Cass: III year B.Tech EEE Ist Semester
Exp - 3 1 of 6
Mesh and Nodal analysis Aim:
To determine
a) The node voltages for the circuit shown in figure 1 and b) The mesh currents for the circuit shown in figure 2 by using MATLAB m-files and simulink
Figure 1.0
Figure 2.0
Software Required: Multisim/Matlab software.
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 4 Cass: III year B.Tech EEE Ist Semester
Exp - 3 2 of 6
Theory:
Mesh and Nodal analysis provide a general procedure for analyzing circuits using
currents and voltages as the circuit variables.
Analyzing the connected circuit containing ‘n’ nodes will require ‘n-1’ KCL
equations. The KCL equations are obtained from each node with exception of the reference
node or the datum node. Similarly for mesh analysis KVL equations are obtained from each
mesh.
The above circuits can be solved with MATLAB by two methods
1. By using m-files
2. By using MATLAB Simulink
A.Procedure for Nodal analysis
• Express element current as function of the nodal voltage
• Apply KCL to each node with the exception of reference node
• Solve the resulting simultaneous equations to obtain the unknown voltages.
Applying KCL to node 1 of circuit in figure 1.0 we can obtain the following equations:
𝑖1 + 𝑖2 = 𝑖3
𝑣1 − 0
6+
𝑣1 − 𝑣2
10= 2 (1)
Applying KCL to node 2 of circuit in figure 1.0 we can obtain the following equations:
𝑖2 + 𝑖5 = 𝑖3 + 𝑖4
𝑣1 − 𝑣2
10+ 4 = 2 +
𝑣2 − 0
6 (2)
1 and 2 equations can be written as
(1
6+
1
10) v1 − (
1
10) v2 = 2 (3)
(1
10) 𝑣1 − (
1
10+
1
6) 𝑣2− = −2 (4)
Equations (3) and (4) can be represented in the matrix format in the following manner:
[(
1
6+
1
10) − (
1
10)
(1
10) − (
1
10+
1
6)
] × [𝑣1𝑣2
] = [2
−2]
𝑌 ∗ 𝑉 = 𝐼
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 4 Cass: III year B.Tech EEE Ist Semester
Exp - 3 3 of 6
B.Procedure for Mesh analysis
• Express element voltages as function of the mesh currents.
• Apply KVL to each mesh
• Solve the resulting simultaneous equations to obtain the unknown currents.
Applying KVL to mesh 1 of circuit in figure 2.0 we can obtain the following
equations:
10(𝑖1 − 𝑖2) + 30((𝑖1 − 𝑖3) − 10 = 0
40 𝑖1 − 10 𝑖2 − 30 𝑖3 = 10 (5)
Applying KVL to mesh 2 of circuit in figure 2.0 we can obtain the following
equations:
10(𝑖2 − 𝑖1) + 15 𝑖2 + 5((𝑖2 − 𝑖3) = 0
−10 𝑖1 + 30 𝑖2 − 5 𝑖3 = 0 (6)
Applying KVL to mesh 3 of circuit in figure 2.0 we can obtain the following
equations:
30(𝑖3 − 𝑖1) + 5((𝑖3 − 𝑖2) + 30 𝑖3 = 0
−30 𝑖1 − 5 𝑖2 + 65 𝑖3 = 0 (7)
Equations (5) ,(6) and (7) can be represented in the matrix format in the following manner:
[40 −10 −30
−10 30 −5−30 −5 65
] ∗ [𝑖1𝑖2𝑖3
] = [1000
]
𝑍 ∗ 𝐼 = 𝑉
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 4 Cass: III year B.Tech EEE Ist Semester
Exp - 3 4 of 6
1. MATLAB CODE FOR NODAL ANALYSIS:
Y=[ 1/6+1/10 -1/10 ; 1/10 -(1/10+1/6) ]
I=[ 2;-2];
V=inv(Y)*I;
2. MATLAB CODE FOR MESH ANALYSIS: Z=[ 40 -10 -30 ; -10 30 -5 ; -30 -5 65 ]
V=[ 10; 0; 0];
I=inv(Z)*V;
3. SIMULATION PROCEDURE BY SIMULINK:
1. Open a new MATLAB/SIMULINK model
2. Model the resistors through the Simulink block (SimPowerSystems--→Elements--
→Series RLC Branch. (Set the resistance to the given value, set L=0 and C=inf)
3. Model the current source through the Simulink block (SimPowerSystems--
→Electrical Sources--→Controlled Current Source)
4. Model the constant for the current source through (Simulink--→Sources--
→Constant)
5. Model the Voltage source through the Simulink block (SimPowerSystems--
→Electrical Sources--→Voltages Source)
6. Model the voltage measurement through (SimPowerSystems--→Measurements--
→Voltage Measurement)
7. Model the current measurement through (SimPowerSystems--→Measurements--
→Current Measurement)
8. Block name display can be invoked through (Simulink--→Sinks--→Display)
9. Nodes can be assigned by invoking the neutral through (SimPowerSystems--
→Elements---→Neutral. The node number can be changed by double click on the
neutral.
10. Continuous power GUI must be embedded in the circuit. (SimPowerSystems--
→power GUI 11. Connect each block/element as shown in the figurers
12. Debug and run the circuit and record the currents and voltages.
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 4 Cass: III year B.Tech EEE Ist Semester
Exp - 3 5 of 6
Figure 3.0 Model of the circuit of figure 1.0 for the node voltage analysis
Figure 4.0 Model of the circuit of figure 2.0 for the mesh analysis analysis
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 4 Cass: III year B.Tech EEE Ist Semester
Exp - 3 6 of 6
Results :
Lab In –Charge HOD –EEE
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 5 Cass: III year B.Tech EEE Ist Semester
Exp - 5 1 of 5
Verification of Super position and Thevinin’s Theorems
AIM: To verify a) Superposition theorem and b) Thevenin’s theorem for the following
circuit.
Figure 1.0
SOFTWARE USED: MULTISIM / MATLAB Simulink
SUPERPOSITION THEOREM:
“In a linear network with several independent sources which include equivalent
sources due to initial conditions, and linear dependent sources, the overall response in any
part of the network is equal to the sum of individual responses due to each independent
source, considered separately, with all other independent sources reduced to zero”. Procedure:
Step 1:
1. Make the connections as shown in the circuit diagram, figure 2.0 by using MATLAB
Simulink.
2. Measure the response ‘I’ in the load resistor by considering all the sources 10V, 15V and
8V in the network.
Step 2:
1. Replace the sources 15V and 8V with their internal impedances (short circuited) as shown
in figure 3.0.
2. Measure the response ‘I1’ in the load resistor by considering 10V source in the network.
Step 3:
1. Replace the sources 10V and 8V with their internal impedances (short circuited) as shown
in figure 4.0.
2. Measure the response ‘I2’ in the load resistor by considering 15V source in the network.
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 5 Cass: III year B.Tech EEE Ist Semester
Exp - 5 2 of 5
Step 4:
1. Replace the sources 10V and 15V with their internal impedances (short circuited) as shown
in figure 5.0.
2. Measure the response ‘I3’ in the load resistor by considering 8V source in the network.
The responses obtained in step 1 should be equal to the sum of the responses obtained
in step 2, 3 and 4. Verify I=I1+I2+I3
Figure 2: By considering all sources
Figure 3: By considering 10 V source alone
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 5 Cass: III year B.Tech EEE Ist Semester
Exp - 5 3 of 5
Figure 4: By considering 15 V source alone
Figure 5: By considering 8 V source alone
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 5 Cass: III year B.Tech EEE Ist Semester
Exp - 5 4 of 5
THEVENIN’S THEOREM:
“Any two terminal network consisting of linear impedances and generators may be
replaced at the two terminals by a single voltage source acting in series with an impedance.
The voltage of the equivalent source is the open circuit voltage measured at the terminals of
the network and the impedance, known as Thevenin’s equivalent impedance, ZTH, is the
impedance measured at the terminals with all the independent sources in the network reduced
to zero ”.
Procedure:
Step 1:
1. Make the connections as shown in the circuit diagram ,figure 2.0 by using MATLAB
Simulink.
2. Measure the response ‘I’ in the load resistor by considering all the sources in the network.
Step 2: Finding Thevenin’s Resistance(RTH)
1. Open the load terminals and replace all the sources with their internal impedances as
shown in figure 6.
2. Measure the impedance across the open circuited terminal which is known as Thevenin’s
Resistance.
Step 3: Finding Thevenin’s Voltage(VTH)
1. Open the load terminals and measure the voltage across the open circuited terminals
(Figure 7).
2. Measured voltage will be known as Thevenin’s Voltage.
Step 4: Thevenin’s Equivalent Circuit
1. VTH and RTH are connected in series with the load (figure 8)
2. Measure the current through the load resistor. 𝐼𝐿 = 𝑉𝑇𝐻
𝑅𝑇𝐻+𝑅𝐿
Current measured from Thevenin’s Equivalent Circuit should be same as current obtained
from the actual circuit. Verify I = IL.
Figure 6: Finding Thevenin’s Resistance(RTH)
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 5 Cass: III year B.Tech EEE Ist Semester
Exp - 5 5 of 5
Figure 7: Finding Thevenin’s Voltage(VTH)
Figure 8: Thevenin’s Equivalent Circuit ( to find Load current)
Exercise: Simulate to verify the Norton’s theorem for the same given circuit.
Results
Lab In –Charge HOD –EEE
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 6 Cass: III year B.Tech EEE Ist Semester
Exp - 6 1 of 5
Waveform Synthesis Using Laplace Transform
AIM: To obtain the Laplace transform for the a)Pulse wave form and b) the triangular wave
form by using waveform synthesis
Theory:
In waveform synthesis, the unit step function u(t) and other functions serve as
building blocks in constructing other waveforms. Once the waveforms are synthesized in the
form of other functions, Laplace transform is found and simplified.
a) To obtain the Laplace transform of the pulse using waveform synthesis
For example, we may describe a pulse waveform in terms of unit step functions. A
pulse of unit amplitude from t=a to t=b can be formed by taking the difference between the
two step functions
𝑥(𝑡) = 𝑢(𝑡 − 𝑎) − 𝑢(𝑡 − 𝑏)
Hence 𝑋(𝑠) = 𝑒−𝑎𝑠.1
𝑠− 𝑒−𝑏𝑠.
1
𝑠
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 6 Cass: III year B.Tech EEE Ist Semester
Exp - 6 2 of 5
b) To obtain the Laplace transform of the triangular Wave using waveform synthesis
As shown in the figure above, a ramp of slope „A‟ starting at t=0 is taken as f1(t). The
function f2(t) is the ramp of slope -2A starting at t=1. When we add f1(t) and f2(t) we get the
signal shown in figure (c). Observe that a negative going ramp of slope (A-2A=-A) starts at
t=1. To cancel the part of this ramp after t≥2, a positive going ramp of slope +A in figure (d)
is added. Then we get the required triangular pulse of Figure (e).
With the help of step functions, the ramp functions in the figure above can be expressed as
follows:
i) 𝑓1(𝑡) = 𝐴. 𝑡. 𝑢(𝑡)
{ The function u(t)=1 for t>0; It indicates that ramp is present only for t≥0}
ii) 𝑓2(𝑡) = −2𝐴. (𝑡 − 1). 𝑢(𝑡 − 1)
{ The function u(t-1)=1 for t>1; It indicates that ramp is present only for t≥1}
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 6 Cass: III year B.Tech EEE Ist Semester
Exp - 6 3 of 5
iii) 𝑓3(𝑡) = 𝐴. (𝑡 − 2). 𝑢(𝑡 − 2)
Therefore, 𝑓(𝑡) = 𝑓1(𝑡) + 𝑓2(𝑡) + 𝑓3(𝑡)
= 𝐴. 𝑡. 𝑢(𝑡) − 2𝐴. (𝑡 − 1). 𝑢(𝑡 − 1) + 𝐴. (𝑡 − 2). 𝑢(𝑡 − 2)
Since u(t), u(t-1) and u(t-2) have values of „1‟ and they just represent the time shifts and
directions of ramp functions, they can be dropped in this expression. Laplace transform of
above equation becomes
𝐴.1
𝑠− 2. 𝐴 .
𝑒−𝑠
𝑠2+ 𝐴.
𝑒−2𝑠
𝑠2
1.PROGRAM FOR PULSE WAVE SYNTHISIS
clear all;
close all;
clc
% WAVE FORM SYNTHISIS OF A PULSE WAVE FORM
syms f t s;
a=2;
b=5;
f1=heaviside(t-a) % unit step function starts at 'a
' sec
f2=-heaviside(t-b) % unit step function startts at
'b' sec
f=f1+f2
FS=laplace(f)
2.PROGRAM FOR TRIANGULAR WAVE SYNTHISIS
clear all;
close all;
clc
% WAVE FORM SYNTHISIS OF A PULSE WAVE FORM
syms f t s;
clc
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 6 Cass: III year B.Tech EEE Ist Semester
Exp - 6 4 of 5
A=1;
f1=A*t*heaviside(t) % Ramp function starts at 't=0 '
f2=-2*A*(t-1)*heaviside(t-1) % ramp function at 't=2' sec
f3=A*(t-2)*heaviside(t-2)
f=f1+f2+f3
FS=laplace(f)
Figure(a) Simulink diagram for Pulse waveform
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 6 Cass: III year B.Tech EEE Ist Semester
Exp - 6 5 of 5
Figure(b) Simulink diagram for Triangular waveform
Results
Lab In –Charge HOD –EEE
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 7 Cass: III year B.Tech EEE Ist Semester
Exp - 7 1 of 3
Pole zero Map and root locus design
AIM: 1) To obtain the Pole-zero plots for the given transfer functions.
a) 𝐺(𝑠) = 𝑠2+4.𝑠+3
(𝑠+5).(𝑠2+4.𝑠+7)
b) 𝐺(𝑠) = 2(𝑠+8)
𝑠(𝑠+3).(𝑠+6)2
2) To Design the (amplifier gain ) controller for the given system through pole zero map /
root locus such that settling time ts < 5sec and damping ratio = 0.6.
Verify the output response by Simulink.
Figure (1)
Theory:
pzmap(sys):
Plots the pole-zero map of the continuous- or discrete-time LTI model sys. For
SISO systems, pzmap plots the transfer function poles and zeros. For MIMO
systems, it plots the system poles and transmission zeros. The poles are plotted as
x's and the zeros are plotted as o's.
rlocus(sys)
rlocus computes the root locus of a SISO open-loop model. The root locus
gives the closed-loop pole trajectories as a function of the feedback gain k
(assuming negative feedback). Root loci are used to study the effects of varying
feedback gains on closed-loop pole locations.
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 7 Cass: III year B.Tech EEE Ist Semester
Exp - 7 2 of 3
1.A) PROGRAM:
num = [1 4 3]
den= conv ([1 5], [3 4 7])
g = tf (num,den)
[z,p,k] = tf2zp(num,den)
pzmap (g)
1.B) PROGRAM:
p = [0 -3 -6 -6 ]
z = [-8]
k = 2
GS= zpk(z,p,k)
Pzmap(GS)
2. PROGRAM FOR DESIGN OF CONTROLLER/Amplifier Gain
% To obtain the Transfer function
num1 = [60]
den1 = conv ([1 6],[1 2 0])
GS = tf ( num1 , den1 )
% To Draw the root locus/Pole zero MAP
figure (1)
rlocus (GS)
axis ([-3 3 -4 4])
sgrid (0.6,10)
% To find the controller gain
[ k , p ] = rlocfind (GS)
% Obtain the closed loop step response
Cloop = feedback (k*GS , 1)
figure(2)
step ( Cloop );
grid
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 7 Cass: III year B.Tech EEE Ist Semester
Exp - 7 3 of 3
Figure (2) : Simulink diagram for step response
Assignment:
Obtain Transfer function of the systems.
1. Poles = -1+i, -1-i, -4. Zeros = -2,-5, gain = 1
2. Poles = -1+4i, -1-4i, -5. Zeros = -8,-5, gain = .75
Results
Lab In –Charge HOD –EEE
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 8 Cass: III year B.Tech EEE Ist Semester
Exp - 8 1 of 3
Harmonic analysis of non sinusoidal wave forms
AIM: To generate a non sinusoidal wave and to measure the total harmonic distortion of
the non sinusoidal wave
Theory:
Harmonic is multiple of the fundamental frequency and it can be voltage and current in
an electric power system are a result of non-linear electric loads.
In a normal alternating current power system, the current varies sinusoidally at a specific
frequency, usually 50 or 60 hertz. When a linear electrical load is connected to the system, it
draws a sinusoidal current at the same frequency as the voltage .
When a non-linear load, such as a rectifier is connected to the system, it draws a current
that is not necessarily sinusoidal. The current waveform can become quite complex,
depending on the type of load and its interaction with other components of the system.
complex the current waveform can be deconstruct it into a series of simple sinusoids by
Fourier series analysis. The sinusoids start at the power system fundamental
frequency and occur at integer multiples of the fundamental frequency.
Fourier seris and Fourier Transform
Fourier discovered that such a complex signal could be decomposed into an infinite
series made up of cosine and sine terms and a whole bunch of coefficients which can
(surprisingly) be readily determined.
)2
sin()2
cos(2
1)(
11
0T
ntb
T
ntaatf
n
n
n
n
=
=
++=
• The coefficients are “readily” determined by integration.
−
−
=
=
2/
2/
2/
2/
)2
sin()(2
)2
cos()(2
T
Tn
T
Tn
dtT
nttf
Tb
dtT
nttf
Ta
fft(x):
Y = fft(X) returns the discrete Fourier transform (DFT) of vector X, computed with a fast Fourier transform (FFT) algorithm. If X is a matrix, fft returns the Fourier transform of each column of the matrix
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 8 Cass: III year B.Tech EEE Ist Semester
Exp - 8 2 of 3
Total harmonic distortion
The total harmonic distortion (THD) is a measurement of the harmonic distortion present in a signal and is defined as the ratio of the sum of the powers of all harmonic components to the power of the fundamental frequency
𝑇𝐻𝐷 = √𝑉2
2+𝑉3
2+𝑉4
2+…………….𝑉𝑛
2
𝑉1
where Vn is the RMS voltage of nth harmonic and n = 1 is the fundamental frequency.
1. PROGRAM FOR HORMONIC DISTORTION ANALYSIS
clear all
clc
fs=1000; % sampling frequency signal
Ts=1/fs
TT =3/50; % Total time
f=50;
V=230;
Vm=sqrt(2)*V
t=0:0.001:0.06
v1=Vm*sin(2*pi*f*t) % Fundamental component of signal
v2=(Vm/2)*sin(2*pi*2*f*t) % 2nd harmonic of signal
v3=(Vm/3)*sin(2*pi*3*f*t) % 3 rd harmonic of signal
% Total harmonic signal
vT=v1+v2+v3
figure(1)
plot(t,vT)
% To calculate Total harmonic distortion
V1=230
V2=230/2
V3=230/3
THD = sqrt((V2^2)+(V3^2))/V1
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 8 Cass: III year B.Tech EEE Ist Semester
Exp - 8 3 of 3
% To display Harmonics ( frequency Vs Amplitude)
FVT=abs(fft(vT))
VF1=max(FVT)
FVT=abs(fft(vT))/VF1
k=length(t)
f=0:1000/k:1000-1
figure(2)
plot(f,FVT)
xlim([0 500])
Figure 1. Simulink diagram for total harmonic distortion
Results :
Lab In –Charge HOD –EEE
Continuous
powergui
v+
-
Voltage Measurement
V3
V2
V1
ScopeRL branch
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 9 Cass: III year B.Tech EEE Ist Semester
Exp - 9
1 of 4
Transient Response of Series RLC Circuit
Aim: To find time response of current through series RLC circuit for step input voltages.
Theory:
The series RLC circuit is shown below. v(t) is the voltage source. The relation between the source voltage and current is given by equation
=++ )(1
)( tvidtCdt
diLtRi
This is a linear differential equation. Taking Laplace Transformer will get
(CS
LSR1
++ ) I (S) = V (S)
I(S) = V(S) CS /(RCS+LCS2+1)
Values of Parameters to be inserted in Circuit-Diagrams :
Step Input:- V=1 , L=50μH, C= 10μF & R= 1, 4.472 & 8 ohms
V1
L1
50uH
R2
1ohm
C2
10uF
0
21 3
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 9 Cass: III year B.Tech EEE Ist Semester
Exp - 9
2 of 4
Theory:- In the RLC circuit shown aside the equation governing the voltage, resistance,
Inductance & Capacitance is as follows:
V(t)=R*I(t)+Ldi(t)/dt+1/C I(t)dt
Taking Laplace Transform ,
V(s)=I(s)[R+sL+1/sC] &
I(s)=V(s) / [R +sL+1/sC]
=V(s) *s/L / {s2 +sR/L+1/LC}
=V(s) *s/L / [(s-1)*(s- 2)] ;
𝛼1 = − 𝑅
2𝐿+ √(
𝑅
2𝐿)
2
−1
𝐿𝐶
𝛼2 = − 𝑅
2𝐿− √(
𝑅
2𝐿)
2
−1
𝐿𝐶
𝛼1 = −𝜎 + 𝑗𝜔𝑑
𝛼2 = −𝜎 − 𝑗𝜔𝑑
The condition for critical resistance Rc is
(𝑅
2𝐿)
2
=1
𝐿𝐶 ; 𝑅𝑐 = 2. √
𝐿
𝐶
If R < Rc , Under Damped & If R > Rc, Over Damped
Current through the RLC circuit:
i) Over damped case:
𝐼(𝑡) = 𝐴1𝑒−𝜎1𝑡 + 𝐴2𝑒−𝜎2𝑡
ii) Critically damped case:
𝐼(𝑡) = (𝐴1 + 𝐴2. 𝑡)𝑒−𝜎𝑡
iii) Under damped case:
𝐼(𝑡) = 𝑒−𝜎𝑡(𝐴1 cos( 𝜔𝑑 . 𝑡) + 𝐴2 sin( 𝜔𝑑 . 𝑡))
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 9 Cass: III year B.Tech EEE Ist Semester
Exp - 9
3 of 4
Input Voltage &Current Waveforms
Sample calucultaion:
V=1 , L=50μH, C= 10μF & R= 1 ohms
Rc=2*sqrt(50e-6/10e-6) = 4.472 ,
R=1,
𝜎 =𝑅
2𝐿 = 1/(2*50e-6) = 1e4 ,
𝜔𝑑 = √(𝑅
2𝐿)
2
−1
𝐿𝐶 = √(1e4 ∗ 1e4 − 1/(50e − 6 ∗ 10e − 6)) = j 43589;
R=1
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 9 Cass: III year B.Tech EEE Ist Semester
Exp - 9
4 of 4
Figure 1. Simulink diagram for step response of under damped case
Figure 2. Simulink diagram for analysis of step response for different dampings.
Results : Lab In –Charge HOD –EEE
Continuous
powergui
V=3
Scope3R=1 L=1mH
i+-
Current Measurement
C=10 u F3
Breaker2
Continuous
powergui
V=3
V=2
V=1
Scope3
R=8
R=4.472
R=1
L=1mH2
L=1mH1
L=1mH
i+-
Current Measurement2
i+-
Current Measurement1
i+-
Current Measurement
C=10 u F3
C=10 u F2
C=10 u F1
Breaker3
Breaker2
Breaker1
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 10 Cass: III year B.Tech EEE Ist Semester
Exp - 10 1 of 6
Three phase power measurement
AIM: To Measure the power by two watt meters method for balance and unbalanced loads
Theory:
Two Wattmeter Method:
In two wattmeter method, a three phase balanced voltage is applied to a balanced three phase load where the current in each phase is assumed lagging or leading by an angle of Ø behind the corresponding phase voltage. The schematic diagram for the measurement of three phase power using two wattmeter method is shown below.
From the figure, it is obvious that current through the Current Coil (CC) of Wattmeter W1 = IR , current though Current Coil of wattmeter W2 = IB whereas the potential difference seen by the Pressure Coil (PC) of wattmeter W1= VRB (Line Voltage) and potential difference seen by Pressure Coil of wattmeter W2 = VYB. The phasor diagram of the above circuit is drawn by taking VR as reference phasor as shown below.
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 10 Cass: III year B.Tech EEE Ist Semester
Exp - 10 2 of 6
From the above phasor diagram,
Angle between the current IR and voltage VRB = (30° – Ø)
Angle between current IY and voltage VYB = (30° + Ø)
Therefore, Active power measured by wattmeter W1 = VRB IR Cos (30° – Ø)
Similarly, Active power measured by wattmeter W2 = VYB IY Cos(30° + Ø)
As the load is balanced, therefore magnitude of line voltage will be same irrespective of phase taken i.e. VRY, VYB and VRB all will have same magnitude. Also for Star / Y connection line current and phase current are equal, say IR = IY = IB = I
Let VRY = VYB = VRB = VL
Therefore,
W1 = VRB IR Cos (30° – Ø)
= VL IL Cos(30° – Ø)
In the same manner,
W2 = VL IL Cos(30° + Ø)
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 10 Cass: III year B.Tech EEE Ist Semester
Exp - 10 3 of 6
Hence, total power measured by watt meters for the balanced three phase load is given as,
W = W1 + W2
= VL IL Cos(30° – Ø) + VL IL Cos(30° + Ø)
= VL IL [Cos(30° – Ø) + Cos(30° + Ø)]
=√3 VL IL Cos Ø
Therefore, total power measured by watt meters W = √3 VL IL Cos Ø
Case1: When the Load is balanced (star connected )
VL=400 V
Vph = 400/sqrt(3) = 230.94 V
Z1 = 100 +j100 ohm
Z2 =100+j100 ohm
Z3=100+j100 ohm
IL = Vph/Zph = 230.94/(100+j100)
= 230.94/141.42 =1.64 A at -45
P= sqrt(3) Vl.IL. cos(phi) = 803. watts
Case2: When the Load is unbalanced balanced (star connected )
Z1=10 ohms
Z2 = 100+j10 ohms
Z3 = -j20 ohms
VR = 122.4 ∟0 V
VY = 122.4 ∟-120 V
VB = 122.4 ∟+120 V
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 10 Cass: III year B.Tech EEE Ist Semester
Exp - 10 4 of 6
IR =10.28 ∟30 A
IB = 9.20 ∟-149.90 A
IY =1.09 ∟-155.7 A
Total power P = (IR )2 *10 + (IY )2 *10
P = (10.28 )2 *10 + (1.09 )2 *100
P = 1056 +118.81 = 1174.81
Simulink procedure:
1. Model the Load resistors through (sim powersystem >> Elements >> Series
RLC branch.(set the values of R,L,C of the load)
2. Model the Voltage sources through (sim powersystem >> Electrical sources. (
set the values of Max Voltage ,frequency)
3. Model the voltage and current measurements through (sim powersystem >>
Measurements.
4. Model the watt meters through (sim powersystem >> Extra Library >>
Measurements.
5. Connect the watt meter-1 , current coil( ‘I’ input of watt meter) to R phase and
voltage input to RY lines
6. Connect the watt meter-2 , current coil( ‘I’ input of watt meter) to B phase and
voltage input to BR lines
7. Connect each block as shown in figure.
8. Model the power gui from simpower system.
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 10 Cass: III year B.Tech EEE Ist Semester
Exp - 10 5 of 6
G.N.I.T.S. – EEE DEPARTMENT
BASIC ELECTRICAL SIMULATION LAB
Experiment No: 10 Cass: III year B.Tech EEE Ist Semester
Exp - 10 6 of 6
Results :
Lab In –Charge HOD –EEE