SLNS Lab Manual Ver1.0 - Compressed
SLNS Lab Manual Ver1.0 - Compressed
MANUAL
AS PER 2021 CURRICULUM
SIMULATION
SOFTWARE LAB USING
NUMERICAL
SOFTWARE
Diploma in Electronics Engg.
Diploma in Electronics & Comm. Engg.
Diploma in Biomedical Engg.
SEMESTER 6
Prepared by:
Sreeraj K. P.
Lecturer in Electronics Engg.
Dept. of Technical Education
6047 – Simulation Lab with Numerical Software Semester 6
Prepared by:
Sreeraj K. P.,
Lecturer in Electronics Engineering
Dept. of Technical Education
PROGRAM OUTCOMES
POs Statements
Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
PO1 science and engineering fundamentals and engineering
specialization to solve the engineering problems.
Problem analysis: Identify and analyse well-defined engineering problems
PO2
using codified standard methods.
Design/ development of solutions: Design solutions for well-defined
PO3 technical problems and assist with the design of systems components or processes to
meet specified needs.
Engineering Tools, Experimentation and Testing: Apply modern
PO4 engineering tools and appropriate technique to conduct standard tests and
measurements.
Engineering practices for society, sustainability and environment: Apply
PO5 appropriate technology in context of society, sustainability, environment and
ethical practices.
Project Management: Use engineering management principles individually, as a
PO6 team member or a leader to manage projects and effectively communicate about
well-defined engineering activities.
Life-long learning: Ability to analyse individual needs and engage in updating in
PO7
the context of technological changes.
Course outcomes:
CO1: Develop programs to perform basic matrix operations, solve equations and plot basic
signals.
CO2: Develop simulations to demonstrate basic electronic circuits and study their
characteristics.
CO3: Develop simulation models to illustrate analog and pulse modulation schemes.
CO4: Develop simulation models to implement various combinational logic circuits.
Sl.
Module outcome CO1 CO2 CO3 CO4
No.
Perform basic matrix operations – addition, subtraction,
1 multiplication, division and inverse. (Verify ֍
mathematically)
Solution of linear constant coefficient differential
2 ֍
equation. (Verify mathematically)
Determine eigen values and eigen vectors of a square
3 ֍
matrix. (Verify mathematically)
Determine roots of a polynomial. (Verify
4 ֍
mathematically)
Generation of various signals and sequences (Periodic
5 and Aperiodic), such as Step, Square, Saw tooth, ֍
Triangular, Sinusoidal, Ramp signal
6 Plot different types of plots 3D, surface plot, polar plot ֍
7 Plot input output characteristics of diode. ֍
8 Plot input output characteristics of npn transistor. ֍
9 Plot input output characteristics of MOSFET. ֍
Simulate single Phase Full Wave Diode Bridge Rectifier
10 ֍
with LC Filter
Solve node, mesh and loop equations of simple
11 ֍
electrical/network circuits
12 Simulate an R-L-C circuit to determine time response ֍
GENERAL INSTRUCTIONS
1. Rough record and Fair record are needed to record the experiments conducted in the
laboratory.
2. Rough records are needed to be certified immediately on completion of the
experiment.
3. Fair records are due at the beginning of the next lab period.
4. Fair records must be submitted as neat, legible, and complete.
SAFETY INSTRUCTIONS
1. Do not wear loose-fitting clothing or jewelry in the lab. Rings and necklaces
areexcellent conductors of electricity.
2. Sandals or open-toed shoes are NOT allowed.
3. Do not handle any equipment without reading the safety instructions. Read
the handout and procedures in the lab manual before starting the experiments.
4. Setup the circuit and perform a careful circuit check before applying power.
Do not make circuit changes or perform any wiring when power is on.
5. Avoid contact with energized electrical circuits.
6. Do not insert connectors forcefully into the sockets.
7. NEVER try to experiment with the power from the wall plug.
8. Immediately report dangerous or exceptional conditions to the Lab instructor /
teacher: Equipment that is not working as expected, wires or connectors are
broken, the equipment that smells or “smokes”. If you are not sure what the
problem is or what's going on, switch off the Emergency shutdown.
9. Never use damaged instruments, wires or connectors. Hand over these parts to
the Lab instructor/Teacher.
10. Be sure of location of fire extinguishers and first aid kits in the laboratory.
11. Handling of Semiconductor Components: Sensitive electronic circuits and
electronic components have to be handled with great care. The inappropriate
handling of electronic component can damage or destroy the devices. The
devices can be destroyed by driving to high currents through the device, by
overheating the device, by mixing up the polarity, or by electrostatic discharge
(ESD). Therefore, always handle the electronic devices as indicated by the
handout, the specifications in the data sheet or other documentation.
CONTENT PAGE
PRACTICAL SIGNIFICANCE
MATLAB is incredibly practical for engineers, scientists, and researchers due to its
robust toolset for numerical computation, data analysis, and visualization. It offers a user-
friendly interface to design algorithms, simulate systems, and model complex phenomena,
making it an indispensable tool for solving real-world problems in diverse fields such as
signal processing, image analysis, control systems, and beyond. Its extensive libraries and
functions streamline tasks, enabling efficient prototyping and accelerating innovation in
various industries.
RELEVANT PROGRAM OUTCOMES(POS)
PO1: Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7: Life-long learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
THEORY
The name MATLAB stands for Matrix Laboratory. The basic building block of
MATLAB is the matrix. It is not confined to the solution of Matrix related problems. With its
inbuilt functions, it is an excellent tool for linear algebraic computations, data analysis, signal
• Command Window: This is the main window, where commands are written. It is
characterized by MATLAB command prompt (>>). The results also appear on this
window (except figures, which appear on figure window) which command is written.
Commands cannot be edited in this window.
• Current Directory: This appears on the bottom left side of MATLAB desktop. It is
where all files are listed. With a mouse right click, you can run M-files, rename,
delete them etc. after selecting a file from here.
• Workspace: This sub-window shows all the variables generated so far and also shows
their type and size.
• Command History: All commands typed on the MATLAB prompt are recorded here.
Also, commands can be selected from here and create as M-file. Thus, it remains
records of MATLAB functions run.
2. Figure Window:
The output of all the commands written on the command window or executed by
writing in M-file, whose output is a graph, appears on the window. The user can create as
many figure windows as the system memory allows. A figure window is showing sine curve
is shown in Fig 0.2.
3. Editor Window
This is where we can write, create, edit and save programs in a file. The file is known
as M-file. To select editor window, go to file and then select M-file. The programs written on
the file are first saved and then run to get the results. To save and run the program, go to
debug and select ‘save and run’. The result appears on the command window. The figure
appears on the figure window. An editor window is shown as in Fig 0.3:
INPUT-OUTPUT
MATLAB takes input from the screen and rushes output to the screen i.e. it supports
interactive computation. It can read input files and write output files.
1. Data Type: There is no need to declare a data to be real or complex. When a real
number is entered as a variable, MATLAB automatically sets the variable to be real.
Fundamental data type is the array.
2. Dimension: Dimension state is not required in the MATLAB. It is automatic.
3. Case Sensitivity: It differentiates between lower and upper cases. It is case sensitive.
4. Output Display: The output of every command appears on the screen unless
MATLAB is directed otherwise. A semi-colon(;) suppress the output when used at the
end of a command except for the graphics.
GETTING STARTED
Starting MATLAB
On windows platform, start MATLAB by double clicking the MATLAB shortcut icon
on your Windows desktop.
Writing Command
When you start MATLAB, the MATLAB desktop appears containing tools for
managing files, variables, and applications associated with MATLAB. You can start writing
your command at the prompt appears on command Window. You can also write command in
M-file.
Printing Graphics
The simplest way to get print out of the graph is to type print command window after
the graph appears in the figure window. Alternatively activate the figure window and then
select print from the file menu.
Quitting MATLAB
To end your MATLAB session, select file >Exit MATLAB in the desktop or type quit
in the command window. You can run a script file named finish.m each time MATLAB quits
that, for example, executes function to save the workplace, or display a quit confirmation
dialog box.
ACCESSORIES
Toolboxes
MATLAB features a family of add-on-application specific solutions called toolboxes. Very
important to most users of MATLAB, toolboxes allow you to learn and apply specialized
technology. Toolboxes are comprehensive collections of MATLAB environment to solve
particular classes of problems. Areas in which toolboxes are available include signal
processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many
others. There are 78 toolboxes available. Thus, we can say MATLAB basically works as a
platform and for solving a particular problem, concerned toolbox is required. Few of the
toolboxes are as follows:
• Communication toolbox
• Control system toolbox
• Curve fitting toolbox
• Data acquisition toolbox
• Filter design toolbox
• Fuzzy logic toolbox
• Instrument control toolbox
• Optimization toolbox
• Statistics toolbox
• Symbolic maths toolbox, etc.
Simulink
Simulink is a software package that enables you to model, simulate, and analyze
systems whose outputs change over time. Such system are often referred to as dynamic
systems. Simulink can be used to explore the behaviour of a wide range of real- world
dynamic systems, including electrical circuits, shock absorbers, braking systems, and many
other electrical, mechanical, and thermodynamic system. This section explains how Simulink
works.
Simulating a dynamic system is a two-step process with Simulink. First, a user creates
a block diagram, using a block diagram Simulink model editor that graphically depicts time
dependent mathematical relationship among the system’s inputs, states, and outputs. The user
then commands Simulink to simulate the system represented by the model from a specified
start time to a specified stop time.
COMMON COMMANDS
Some commonly used basic MATLAB commands are : To learn more about each command
type help <command> in the command window.
ver - MATLAB, SIMULINK, and toolbox version information.
help - M-file help, displayed at the command line.
helpwin - M-file help, displayed in the help browser.
demo - Run demonstrations.
who - List current variables.
workspace - Display Workspace Browser, a GUI for managing workspace.
clear - Clear variables and functions from memory.
quit - Quit MATLAB session.
type - List M-file.
edit - Edit M-file.
echo - Echo commands in M-files.
format - Set output format.
error - Display error message and abort function.
warning - Display warning message.
fprintf - Display formatted message.
sprintf - Write formatted data to a string.
input - Prompt for user input.
RESOURCES REQUIRED
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PRACTICAL RELATED QUESTIONS
1. Differentiate between a script and a function in MATLAB.
2. Explain the concept of vectors and matrices in MATLAB.
3. How does MATLAB handle errors, and what are some common debugging
techniques?
REFERENCES
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PRACTICAL SIGNIFICANCE
Performing basic matrix operations in MATLAB holds practical significance in
various scientific and engineering applications. These operations are essential for solving
systems of linear equations, which commonly arise in fields such as physics, electrical
engineering, and civil engineering. Additionally, matrix operations play a crucial role in data
manipulation, making them indispensable for tasks like image processing, signal analysis,
and statistical calculations. MATLAB's efficiency in handling these operations facilitates
faster and more accurate numerical computations, contributing significantly to the
advancement of research and problem-solving in diverse domains.
RELEVANT PROGRAM OUTCOMES(POs)
PO1: Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
THEORY
MATLAB, which stands for MATrix LABoratory, is a state-of-the-art mathematical
software package, which is used extensively in both academia and industry. It is an
interactive program for numerical computation and data visualization, which along with its
programming capabilities provides a very useful tool for almost all areas of science and
engineering. Unlike other mathematical packages, such as MAPLE or MATHEMATICA,
MATLAB cannot perform symbolic manipulations without the use of additional Toolboxes.
It remains however, one of the leading software packages for numerical computation. As you
might guess from its name, MATLAB deals mainly with matrices. A scalar is a 1-by-1 matrix
and a row vector of length say 5, is a 1-by-5 matrix. One of the many advantages of
MATLAB is the natural notation used. It looks a lot like the notation that you encounter in a
linear algebra. This makes the use of the program especially easy and it is what makes
MATLAB a natural choice for numerical computations. The purpose of this experiment is to
familiarize MATLAB, by introducing the basic features and commands of the program.
Built in Functions:
Scalar Functions:
Certain MATLAB functions are essentially used on scalars, but operate element-wise
when applied to a matrix (or vector). They are summarized below.
1. sin - trigonometric sine
2. cos - trigonometric cosine
3. tan - trigonometric tangent
4. asin - trigonometric inverse sine (arcsine)
5. acos - trigonometric inverse cosine (arccosine)
6. atan - trigonometric inverse tangent (arctangent)
7. exp - exponential
8. log - natural logarithm
9. abs - absolute value
10. sqrt - square root
11. rem - remainder
12. round - round towards nearest integer
13. floor - round towards negative infinity
14. ceil - round towards positive infinity
Vector Functions:
Other MATLAB functions operate essentially on vectors returning a scalar value.
Some of these functions are given below.
1. max : get the row in which the maximum element lies
2. min : smallest component
3. length : length of a vector
4. sort : sort in ascending order
5. sum : sum of elements
6. prod : product of elements
7. median : median value
8. mean : mean value std standard deviation
Matrix Functions:
Much of MATLAB‟ s power comes from its matrix functions. These can be further
separated into two sub-categories.
The first one consists of convenient matrix building functions, some of which are given
below.
1. eye - identity matrix
2. zeros - matrix of zeros
3. ones - matrix of ones
4. diag - extract diagonal of a matrix or create diagonal matrices
5. triu - upper triangular part of a matrix
6. tril - lower triangular part of a matrix
7. rand - randomly generated matrix
Commands in the second sub-category of matrix functions are
1. size - size of a matrix
2. det - determinant of a square matrix
3. inv - inverse of a matrix
4. rank - rank of a matrix
5. rref - reduced row echelon form
6. eig - eigenvalues and eigenvectors
7. poly - characteristic polynomial
RESOURCES REQUIRED
PROCEDURE
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see command window
c. Matrix Multiplication: A ∗ B
e. Square: A ∗ A
f. Inverse of A & B: inv(A), inv(B)
g. Division: A*inv(B) or A\ B
of the following given matrices:
3 2 1 1 3 0
1. 𝐴 = [ 0 3 4 ] ; 𝐵 = [ 2 6 4]
−1 1 −1 −1 0 2
1 4 3 2 6 2 4 0
2. 𝑃 = [−1 2 0 3] ; 𝑄 = [ 1 2 2 −1]
2 3 1 5 −2 3 5 4
4 2 1 3 1 3 2 −1
1 2 −1 2
3. 𝑅 = [ ];𝑆 = [ ]
3 4 2 3
𝜋 0 1 1
4. 𝑈 = [ ];𝑉 = [ ]
2𝜋 −𝜋 −1 2
8 3 4 2 2 1
5. 𝐴 = [1 5 9] ; 𝐵 = [1 3 −2]
6 1 2 0 2 4
PROGRAM
1.
clc;
clear all;
close all;
A=[3, 2, 1; 0, 3, 4; -1, 1, -1];
B=[1, 3, 0; 2, 6, 4; -1, 0, 2];
add1=A+B
sub1=A-B
mull11=A*B
mull12=A.*B
sq11=A*A
sq12=B*B
invA=inv(A)
invB=inv(B)
div11=A*invB
div12=B*invA
2.
clc;
clear all;
close all;
P=[1, 4, 3, 2; -1, 2, 0, 3; 2, 3, 1, 5; 4, 2, 1, 3];
Q=[6, 2, 4, 0; 1, 2, 2, -1; -2, 3, 5, 4; 1, 3, 2, -1];
add2=P+Q
sub2=PQ
mull21=P*Q
mull22=P.*Q
sq21=P*P
sq22=Q*Q
invP=inv(P)
invQ=inv(Q)
div21=P*invQ
div22=Q*invP
3.
clc;
clear all;
close all;
R=[1, 2; 3, 4];
S=[-1, 2 ; 2, 3];
add3=R+S
sub3=R-S
mull31=R*S
mull32=R.*S
sq31=R*R
sq32=S*S
invR=inv(R)
invS=inv(S)
div31=R*invS
div32=S*invR
4.
clc;
clear all;
close all;
U=[pi, 0; 2*pi, -pi];
V=[1, 1 ; -1, 2];
add4=U+V
sub4=U-V
mull41=U*V
mull42=U.*V
sq41=U*U
sq42=V*V
invU=inv(U)
invV=inv(V)
div4=U*invV
div4=V*invU
5.
clc;
clear all;
close all;
C=[8, 3, 4; 1, 5, 9; 6, 1, 2];
D=[2, 2, 1; 1, 3, -2; 0, 2, 4];
add5=C+D
sub5=C-D
mull51=C*D
mull52=C.*D
sq51=C*C
sq52=D*D
invC=inv(C)
invD=inv(D)
div51=C*invC
div52=D*invD
OUTPUT
1.
4 5 1
A + B, add1 = [ 2 9 8]
−2 1 1
2 −1 1
A - B, sub1 = [−2 3 0]
0 1 −3
6 21 10
A * B, mul11 = [2 18 20]
2 3 2
3 6 0
A .* B, mul12 = [0 18 16 ]
1 0 −2
8 13 10
A * A, sq11 = [−4 13 8 ]
−2 0 4
7 21 12
B * B, sq12 = [ 10 42 32]
−3 −3 4
0.2692 −0.1154 −0.1923
Inverse of A, invA = [ 0.1538 0.0769 0.4615 ]
−0.1154 −0.1923 −0.3462
−1.00 0.50 −1.00
Inverse of B, invB = [0.6667 −0.1667 0.3333]
−0.50 0.25 0
−2.1667 1.4167 −2.3333
A/B, div11 = [ 0 0.5000 1.0000 ]
2.1667 −0.9167 1.3333
2.
7 6 7 2
P + Q, add2 = [0 4 2 2]
0 6 6 9
5 5 3 2
−5 2 −1 2
P - Q, sub2 = [ −2 0 −2 4]
4 0 −4 1
3 −1 −1 4
6 25 31 6
P * Q, mul21 = [−1 11 6 −5 ]
18 28 29 −4
27 24 31 −1
6 8 12 0
P .* Q, mul22 = [−1 4 0 −3]
−4 9 5 20
4 6 2 −3
11 25 8 35
P * P, sq21 = [ 9 6 0 13 ]
21 27 12 33
16 29 16 28
30 28 48 14
Q * Q, sq22 = [ 3 9 16 7 ]
−15 29 31 13
4 11 18 6
3.
0 4
R + S, add3 = [ ]
5 7
2 0
R - S, sub3 = [ ]
1 1
3 8
R * S, mul31 = [ ]
5 18
−1 4
R .* S, mul32 = [ ]
6 12
7 10
R * R, sq31 = [ ]
15 22
5 4
S * S, sq32 = [ ]
4 13
−2.0000 1.0000
Inverse of R, invR = [ ]
1.5000 −0.5000
−0.4286 0.2857
Inverse of S, invS = [ ]
0.2857 0.1429
0.1429 0.5714
R/S, div31 = [ ]
−0.1429 1.4286
5.0000 −2.0000
R\S, div32 = [ ]
0.5000 0.5000
4.
4.1416 1.0000
U + V, add4 = [ ]
5.2832 −1.1416
2.1416 −1.0000
U - V, sub4 = [ ]
7.2832 −5.1416
3.1416 3.1416
U * V, mul41 = [ ]
9.4248 0
3.1416 0
U .* V, mul42 = [ ]
−6.2832 −6.2832
9.8696 0
U * U, sq41 = [ ]
0 9.8696
0 3
V * V, sq42 = [ ]
−3 3
0.3183 0
Inverse of U, invU = [ ]
0.6366 −0.3183
06667 −0.3333
Inverse of V, invV = [ ]
0.3333 0.3333
2.0944 −1.0472
U/V, div41 = [ ]
3.1416 −3.1416
0.9549 −0.3183
U\V, div42 = [ ]
0.9549 −0.6366
5.
10 5 5
C + D, add5 = [ 2 8 7]
6 3 6
6 1 3
C - D, sub5 = [0 2 11 ]
6 −1 −2
19 33 18
C * D, mul51 = [ 7 35 27]
13 19 12
16 6 4
C .* D, mul52 = [ 1 15 −18]
0 2 8
91 43 67
C * C, sq51 = [67 37 67]
61 25 37
6 12 2
D * D, sq52 = [5 7 −13]
2 14 12
0.0208 −0.0417 0.1458
Inverse of C, invC = [ 1.0833 −0.1667 −1.4167]
−0.6042 0.2083 0.7708
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
REFERENCES
Sl. Text
Autho
No Book/ Publication
r
. Website
https://in.mathworks.com/help/matlab/math/basic-matrix-
operations.html
https://in.mathworks.com/help/matlabmobile/ug/matrix-
Web operations.html
1 referenc https://in.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-
es operations.html
https://www.javatpoint.com/matlab-operations-on-matrices
https://uomustansiriyah.edu.iq/media/lectures/9/9_2018_12_28!11_46
_29_PM.pdf
ASSESSMENT SCHEME
PRACTICAL SIGNIFICANCE
Solving differential equations through MATLAB Simulink allows for the simulation
and analysis of dynamic systems in various fields such as engineering, physics, and biology.
It enables the modelling of complex behaviours and interactions within these systems, aiding
in predicting their future states and behaviours. The visual representation provided by
Simulink helps in understanding the dynamics of the system and optimizing its design or
performance. Furthermore, the ability to easily tweak parameters and observe real-time
responses facilitates rapid prototyping and iterative refinement of systems.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
Solution of linear constant coefficient differential equation and verify its mathematically.
THEORY
Though MATLAB is primarily a numerics package, it can certainly solve
straightforward differential equations symbolically. Suppose, for example, that we want to
solve the first order differential equation.
𝑑𝑦
= 𝑥𝑦
𝑑𝑥
We can use MATLAB’s built-in dsolve(). The input and output for solving this
problem in MATLAB is given below.
≫y = dsolve(’Dy = y*x’,’x’)
Output:
y = C1*exp(1/2*x^2)
Notice in particular that MATLAB uses capital D to indicate the derivative and
requires that the entire equation appear in single quotes. MATLAB takes t to be the
independent variable by default, so here x must be explicitly specified as the independent
variable. Alternatively, if you are going to use the same equation a number of times, you
might choose to define it as a variable, say, eqn1.
eqn1 = Dy = y*x
≫y = dsolve(eqn1,’x’)
y = C1*exp(1/2*x^2)
To solve an initial value problem, with y(1) = 1, use
≫y = dsolve(eqn1,’y(1)=1’,’x’)
y = 1/exp(1/2)*exp(1/2*x^2)
or
≫inits = ’y(1)=1’;
≫y = dsolve(eqn1,inits,’x’)
y = 1/exp(1/2)*exp(1/2*x^2)
RESOURCES REQUIRED
PROCEDURE
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see command window
PROGRAM
1.
clc;
clear all;
close all;
syms x y;
y11=dsolve(’Dy=a*y’);
y12=dsolve(’Dy=a*y’,’x’);
2.
clc;
clear all;
close all;
syms x y;
y21=dsolve(’Dy=-a*y’,’y(0)=1’);
y22=dsolve(’Dy=-a*y’,’y(0)=1’,’x’);
3.
clc;
clear all;
close all;
syms x y;
y31=dsolve(’D2y=-a^2*y’,’y(0)=1’,’Dy(pi/4)=0’);
y32=dsolve(’D2y=-a^2*y’,’y(0)=1’,’Dy(pi/4)=0’,’x’);
4.
clc;
clear all;
close all;
syms x y;
y41=dsolve(’Dy=(x*y-y^2)/x^2’);
y42=dsolve(’Dy=(x*y-y^2)/x^2’,’x’);
5.
clc;
clear all;
close all;
syms x y;
y51=dsolve(’Dy=tan(y/x)+y/x’);
y52=dsolve(’Dy=tan(y/x)+y/x’,’x’);
OUTPUT
1.
y11 = C2*exp(a*t)
y12 = C4*exp(a*x)
2.
y21 = exp(a*t)
y22 = exp(a*x)
3.
y31 = (exp(-(pi*a*i)/4)*exp(a*t*i))/(exp(-(pi*a*i)/4) + exp((pi*a*i)/4)) + (exp((pi*a*i)/4)*exp(-
a*t*i))/(exp(-(pi*a*i)/4) + exp((pi*a*i)/4))
y32 = (exp(-(pi*a*i)/4)*exp(a*x*i))/(exp(-(pi*a*i)/4) + exp((pi*a*i)/4)) + (exp((pi*a*i)/4)*exp(-
a*x*i))/(exp(-(pi*a*i)/4) + exp((pi*a*i)/4))
4.
y41 = -x/(exp(-x*(C19 + t/x^2)) - 1)
y42 = x/(C22 + log(x))
5.
y51 = solve(y + x*tan(y/x) == 0, y)
solve(int(1/(y + x*tan(y/x)), y, ’IgnoreAnalyticConstraints’, true) - t/x - C25== 0, y)
y52 = x*asin(C30*x)
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Describe the process of setting up a differential equation in MATLAB Simulink.
What are the essential steps involved?
𝑑2 𝑦 𝑑𝑦
2. Solve the second-order differential equation 𝑑𝑥 2 = 5 𝑑𝑥 + 6𝑦 = 0 using MATLAB.
Provide both the general solution and a specific solution satisfying the initial
𝑑𝑦
conditions y(0) = 2, (0) = 1.
𝑑𝑥
PRACTICAL RELATED QUESTIONS
1. Explain the role of boundary conditions in solving partial differential equations using
MATLAB. Provide an example of how MATLAB handles boundary value problems
(BVPs) for second-order PDEs.
2. What are the various plotting functions available in MATLAB for visualizing
solutions to differential equations? Explain how these plots help in understanding the
behavior of solutions.
REFERENCES
PRACTICAL SIGNIFICANCE
Eigenvalues and eigenvectors are crucial in various fields like physics and
engineering. In MATLAB, they help in solving systems of differential equations,
understanding stability in control systems, and analyzing structural mechanics. By calculating
eigenvalues, MATLAB can determine stability criteria, while eigenvectors help identify the
principal directions in a system, aiding in understanding complex phenomena like vibrations
or fluid dynamics. These concepts empower engineers and scientists to comprehend and
manipulate the behavior of systems efficiently.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
Determine eigen values and eigen vectors of a square matrix and verify mathematically.
THEORY
For an n × n matrix A, the real number λ is called an Eigen value of A if there exists a
nonzero vector x in Rn such that Ax = λx. The vector x is called an eigenvector belonging to
λ. The equation Ax = λx is equivalent to (A − λI)x = 0, so all of the following are equivalent:
• λ is an Eigen value of A.
• (A − λI)x = 0 has a nontrivial solution.
• A − λI is singular.
• det(A − λI) = 0
The eigenvectors for λ are the nonzero solutions x to (A − λI)x = 0. These vectors
together with the 0 vector is called the eigen space corresponding to eigen value λ. The
expression det(A − λI) is a polynomial in λ of degree n, called the characteristic polynomial.
By property 4, the eigen values are the roots of the characteristic equation det(A − λI) = 0.
Determining eigen values and eigenvectors with MATLAB using below two methods:
1. In MATLAB we can find the characteristic polynomial of a matrix A by entering
poly(A). If A is an n×n matrix, poly(A) is a row vector with n+1 elements that are the
coefficients of the characteristic polynomial. The command roots(C) computes the
roots of the polynomial whose coefficients are the elements of the vector C. Thus,
roots (poly(A)) returns the eigen values of A in a column vector.
To find the eigenvectors corresponding to each eigenvalue found above, we need to
find the nonzero solutions x to (A−I)x = 0. One way of doing this in MATLAB is to
compute rref(A-I) and then use Gauss-Jordan elimination.
The reduced form of echelon form for A − 2I gives the general solution to (A −2I)x =
0 0
0 as 𝑥 = [ 𝑟 ] = 𝑟 [1], the form for eigenvectors corresponding to λ = 2.
𝑟 1
Similarly, the reduced echelon forms for A − 1I and A − (−1)I allow us to determine
1 1
eigenvectors of the form 𝑠 [0] for λ = 1 and 𝑡 [−1] for λ = −1.
1 1
2. Determining the eigenvalues and eigenvectors in MATLAB is to use the eig function.
For an n × n matrix A, eig(A) returns a n × 1 column vector whose elements are the
eigenvalues of A. The command in the form
[V D] = eig(A)
computes both the eigenvalues and eigenvectors of A. V will be a matrix whose
columns are eigenvectors of A and D will be a diagonal matrix whose entries along
the diagonal are eigenvalues of A. The ith column of V; V (:; i), is the eigenvector
corresponding to the eigenvalue D(i; i). A sample session is shown for the matrix
A above.
RESOURCES REQUIRED
PROCEDURE
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see command window
PROGRAM
1.
clc;
clear all;
close all;
A = [1, 3, 0; 2, 6, 4; -1, 0, 2];
%method 1
rA=roots(poly(A));
vA1=rref(A-rA(1)*eye(3));
vA2=rref(A-rA(2)*eye(3));
vA3=rref(A-rA(3)*eye(3));
%method 2
[ VA DA ]=eig(A);
2.
clc;
clear all;
close all;
B = [1, -2; -5, 4];
%method 1
rB=roots(poly(B));
vB1=rref(B-rB(1)*eye(2));
vB2=rref(B-rB(2)*eye(2));
%method 2
[ VB DB ]=eig(B);
3.
clc;
clear all;
close all;
C = [2, 2, -2; 2, 1, -6; -1, 2, 0];
%method 1
rC=roots(poly(C));
vC1=rref(C-rC(1)*eye(3));
vC2=rref(C-rC(2)*eye(3));
vC3=rref(C-rC(3)*eye(3));
%method 2
[ VC DC ]=eig(C);
4.
clc;
clear all;
close all;
D = [6, -2, 2; -2, 3, -1; 2, -1, 3];
%method 1
rD=roots(poly(D));
vD1=rref(D-rD(1)*eye(3));
vD2=rref(D-rD(2)*eye(3));
vD3=rref(D-rD(3)*eye(3));
%method 2
[ VD DD ]=eig(D);
5.
clc;
clear all;
close all;
E = [3, 1, 4; 0, 2, 6; 0, 0, 5];
%method 1
rE=roots(poly(E));
vE1=rref(E-rE(1)*eye(3));
vE2=rref(E-rE(2)*eye(3));
vE3=rref(E-rE(3)*eye(3));
%method 2
[ VE DE ]=eig(E);
OUTPUT
1.
6.6056
𝑟𝐴 = [ 3.0000 ]
−0.6056
1 0 0
𝑣𝐴1 = [0 1 0]
0 0 1
1.0000 0 1.0000
𝑣𝐴2 = [ 0 1.0000 0.6667]
0 0 0
1.0000 0 −2.6056
𝑣𝐴3 = [ 0 1.0000 1.3944 ]
0 0 0
0.8352 −0.6396 0.4694
𝑉𝐴 = [−0.4470 −0.4264 0.8771 ]
0.3205 0.6396 −0.1019
−0.6056 0 0
𝐷𝐴 = [ 0 3.0000 0 ]
0 0 6.6056
2.
6
𝑟𝐵 = [ ]
−1
1.0000 0.4000
𝑣𝐵1 = [ ]
0 0
1 −1
𝑣𝐵2 = [ ]
0 0
−0.7071 0.3714
𝑉𝐵 = [ ]
−0.7071 −0.9285
−1 0
𝐷𝐵 = [ ]
0 6
3.
3.0000
𝑟𝐶 = [2.6458𝑖 ]
2.6458𝑖
1 0 0
𝑣𝐶1 = [0 1 0]
0 0 1
1 0 −1
𝑣𝐶2 = [0 1 −0.50000 − 1.3229𝑖 ]
0 0 0
1 0 −1
𝑣𝐶3 = [0 1 −0.5000 + 1.3229𝑖 ]
0 0 0
0.8285 −0.1768 + 0.4677𝑖 −0.1768 − 0.4677𝑖
𝑉𝐶 = [0.5523 −0.7071 −0.7071 ]
0.0921 −0.1768 + 0.4677𝑖 −0.1768 − 0.4677𝑖
3 0 0
𝐷𝐶 = [0 2.6458𝑖 0 ]
0 0 −2.6458𝑖
4.
8
𝑟𝐷 = [2]
2
1 0 0
𝑣𝐷1 = [0 1 0]
0 0 1
1 0 0
𝑣𝐷2 = [0 1 0]
0 0 1
1 0 0
𝑣𝐷3 = [0 1 0]
0 0 1
0.2842 0.5025 0.8165
𝑉𝐷 = [−0.3313 0.8506 −0.4082]
−0.8997 −0.1544 0.4082
2.0000 0 0
𝐷𝐷 = [ 0 2.0000 0 ]
0 0 8.0000
5.
5
𝑟𝐸 = [3]
2
1.0000 0 −3.0000
𝑣𝐸1 = [ 0 1.0000 −2.0000]
0 0 0
0 1 0
𝑣𝐸2 = [0 0 1]
0 0 0
1.0000 1.0000 0
𝑣𝐸3 = [ 0 0 1.0000]
0 0 0
1.0000 −0.7071 0.8081
𝑉𝐸 = [ 0 0.7071 0.5345]
0 0 0.2673
3 0 0
𝐷𝐸 = [0 2 0]
0 0 5
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Generate a random symmetric matrix of size 4x4 and compute its eigenvalues.
Discuss any observations you make about the eigenvalues of symmetric matrices.
2. Compare the computation time required to find eigenvalues and eigenvectors for
matrices of different sizes (e.g., 100x100, 500x500, 1000x1000). Plot a graph
illustrating the relationship between matrix size and computation time.
PRACTICAL RELATED QUESTIONS
1. How many eigenvalues does a square matrix have?
2. What does an eigenvalue represent in the context of a matrix?
3. Can a non-square matrix have eigenvalues?
4. What MATLAB command is used to check if a matrix is diagonalizable?
5. What property do eigenvectors possess when a matrix is multiplied by them?
REFERENCES
Sl. Text
Auth
No Book/ Publication
or
. Website
https://in.mathworks.com/help/matlab/ref/eig.html
Web https://www.geeksforgeeks.org/eigenvalues-and-eigenvectors-in-
matlab/
1 referenc
https://youtu.be/VGVTHDN3XL4
es https://www.math.ucdavis.edu/~wally/teaching/67/assignments/eigenv
alues_98.pdf
ASSESSMENT SCHEME
PRACTICAL SIGNIFICANCE
Finding roots of polynomials using MATLAB has practical significance in various
fields like engineering, physics, and economics. It helps in solving real-world problems by
determining the values that make an equation equal to zero, aiding in system stability
analysis, control system design, and signal processing. These roots provide critical
information about the behaviour and characteristics of systems, allowing engineers and
scientists to make informed decisions and predictions. MATLAB's efficient algorithms for
root-finding empower professionals to analyze complex systems and optimize designs
effectively.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
𝑓(𝑥) = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥 2 … + 𝑎𝑛 𝑥 𝑛
The coefficients a0, a1,…, an are often real numbers and n which is a nonnegative integer, is
the degree or order of the polynomial.
𝑓(𝑥) = 9𝑥 3 − 5𝑥 2 + 3𝑥 + 7
𝑔(𝑥) = 6𝑥 2 − 𝑥 + 2
The polynomial vector will be
𝑓 = [9 −5 3]
𝑔 = [6 −1 2]
The command "roots" determines the roots of a polynomial. The usage of the function
is:
r= roots (p)
where r is a column vector with the roots and p is a row vector with the coefficients of
the polynomial.
RESOURCES REQUIRED
PROCEDURE
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see command window
1. 5𝑥 5 + 2𝑥 4 + 𝑥 3 + 𝑥 + 8 = 0
2. 3𝑥 6 + 15𝑥 5 − 10𝑥 3 + 4𝑥 = 0
PROGRAM
1.
clc;
clear all;
close all;
a1=[5, 2, 1, 0, 1, 8];
%method 1
r1=roots(a1);
%method 2
syms x;
s1=solve(5∗x^5 + 2∗x^4 + 1∗x^3 + 0∗x^2 + 1∗x + 8);
2.
clc;
clear all;
close all;
a2=[3, 15, 0, -10, 0, 4, 0];
%method 1
r2=roots(a2);
%method 2
syms x;
s2=solve(3∗x^6 + 15∗x^5 − 10∗x^3 + 4∗x);
3.
clc;
clear all;
close all;
a3=[1, -16, 86, -176, 105];
%method 1
r3=roots(a3);
%method 2
syms x;
s3=solve(105 + 86∗x^2 − 176∗x − 16∗x^3 + 1∗x^4);
4.
clc;
clear all;
close all;
5.
clc;
clear all;
close all;
a5=[1, 0, 0, 12, -5];
%method 1
r5=roots(a5);
%method 2
syms x;
s5=solve(x^4 + 12∗x − 5);
6.
clc;
clear all;
close all;
a6=[1, -14, 73, -168, 144];
%method 1
r6=roots(a6);
%method 2
syms x;
s6=solve(x^4 − 14∗x^3 + 73∗x^2 − 168∗x + 144);
OUTPUT
1.
𝑎1 = [5 2 1 0 1 8]
−1.1142
−0.4413 + 1.0530𝑖
𝑟1 = −0.4413 − 1.0530𝑖
0.7984 + 0.6812𝑖
[ 0.7984 − 0.6812𝑖 ]
−1.114
0.7984 − 0.6812 ∗ 𝑖
𝑠1 = −0.4413 + 1.053 ∗ 𝑖
−0.4413 − 1.0530 ∗ 𝑖
[ 0.7984 + 0.6812 ∗ 𝑖 ]
2.
𝑎2 = [3 15 0 10 0 4 0]
0
−4.8613 + 0.0000𝑖
−0.6925 + 0.3093𝑖
𝑟2 =
−0.6925 − 0.3093𝑖
0.6232 + 0.2975𝑖
[ 0.6232 − 0.2975𝑖 ]
0
−4.8613
0.6231 + 0.2975 ∗ 𝑖
𝑠2 =
−0.6925 + 0.3093 ∗ 𝑖
−0.6925 − 0.3093 ∗ 𝑖
[ 0.6231 − 0.2975 ∗ 𝑖 ]
3.
𝑎3 = [3 15 0 −10 0 4 0]
7.0000
𝑟3 = [5.0000]
3.0000
1.0000
1
𝑠3 = [3]
5
7
4.
𝑎4 = [1 0 −3 −42 −40]
4.0000 + 0.0000𝑖
𝑟4 = [−1.5000 + 2.7839𝑖 ]
−1.5000 − 2.7839𝑖
−1.0000 + 0.0000𝑖
4
−1
1
𝑠4 = (312 𝑖) /2 − 3/2
1
[− (31 𝑖) /2 − 3/2]
2
5.
𝑎5 = [1 0 0 12 −5]
−2.4142
𝑟5 = [1.0000 + 2.0000𝑖 ]
1.0000 − 2.0000𝑖
0.4142 + 0.0000𝑖
21/2 − 1
1/2
𝑠5 = [−2 − 1]
1 + 21
1 − 2𝑖
6.
𝑎6 = [1 −14 73 −168 144]
4.0000
𝑟6 = [4.0000]
3.0000
3.0000
3
𝑠6 = [3]
4
4
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
REFERENCES
Sl. Text
Autho
No Book/ Publication
r
. Website
https://in.mathworks.com/help/matlab/ref/roots.html
Web https://youtu.be/MmPtxZOUfQE
1 reference https://www.educba.com/matlab-root-finding/
s https://www.math.csi.cuny.edu/Computing/matlab/Tutorial/tutorial0
07.html
ASSESSMENT SCHEME
PRACTICAL SIGNIFICANCE
Generating signals using MATLAB holds immense practical significance in various
fields like telecommunications, signal processing, and control systems by enabling simulation
and analysis of real-world scenarios. It allows engineers to prototype and test algorithms
before implementation, saving time and resources. MATLAB's signal generation capabilities
aid in understanding signal behavior, enabling the development of robust systems and
algorithms for applications like image processing, audio signal analysis, and sensor
technologies. Its versatility empowers researchers and practitioners to explore, model, and
manipulate signals with ease, facilitating innovation and advancements in numerous
technological domains.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
surfaces and mesh plots, and many more. In this experiment you will learn how MATLAB
can be used to create and format many types of 2-D and 3-D plots.
2-D Plot of a Function
In many situations there is a need to plot a given function. This can be done by using the
‘plot’ or the ‘fplot’ command. In order to plot a function y =f(x) with the plot command, the
user needs to first create a vector of x for the domain over which the function will be plotted.
Then a vector y is created with the corresponding values of f(x) by using element-by-element
calculations as explained in Experiment number 1. Once the two vectors are defined, they can
be used in the plot command. The fplot command plots a function with the form y=f(x)
between specified limits. The command has the form
fplot(‘function’,limits,’line specifiers’)
‘function’ can be typed directly as a string inside the command. For example if the
function that is being plotted is f(x) = 8x^2+5 cos(x),it is typed as:’8*x^2+5*cos(x)’. the
function can include MATLAB built-in functions and functions that are created by the users.
Plotting multiple graphs in the same plot
In many situations there is a need to make several graphs in the same plot. There are
three methods to plot multiple graphs in one figure. One is by using the plot command, the
second by using the hold on and hold off and the third is by using the line command.
ymax])
11 subplot(1,2,1) Creates the plot with 2 panes and 1 row, and that this
particular plot will appear in the first pane
12 bar(x,y) Creates bar chart
13 [x,y] = meshgrid (-5 : 0.1 : Generate a matrix of elements that give the range over x
5 ,–3 : 0.1 : 3); and y we want to use along with the specification of
increment in each case
1 ; 𝑡≥0
𝑢(𝑡) = {
0 ; 𝑡<0
1 ; 𝑛≥0
𝑢[𝑛] = {
0 ; 𝑛<0
1 ; 𝑡=0
𝛿(𝑡) = {
0 ; 𝑡≠0
1 ; 𝑛=0
𝛿[𝑛] = {
0 ; 𝑛≠0
Ramp Signal
Ramp signal in continuous time is denoted by r(t), and it is defined as
𝑡 ; 𝑡≥0
𝑟(𝑡) = {
0 ; 𝑡<0
𝑛 ; 𝑛≥0
𝑟[𝑛] = {
0 ; 𝑡<0
Sinusoidal Signal
The sine wave or sinusoid is a mathematical function that describes a smooth
repetitive oscillation. It occurs often in pure mathematics, as well as physics, signal
processing, electrical engineering and many other fields. Its most basic form as a function of
time (t) is:
where:
• A, the amplitude, is the peak deviation of the function from its center position.
• 𝜔0 , the angular frequency, specifies how many oscillations occur in a unit time interval, in
radians per second
Square Signal
The simplest formula for the square waveform is just taking the sign of the sine
Triangular Signal
A triangle wave is a non-sinusoidal waveform named for its triangular shape. A
bandlimited triangle wave pictured in the time domain (top) and frequency domain (bottom).
The fundamental is at 220 Hz (A2). Like a square wave, the triangle wave contains only odd
harmonics. However, the higher harmonics roll off much faster than in a square wave
(proportional to the inverse square of the harmonic number as opposed to just the inverse).
Triangular signal in continuous time is denoted as x(t)
|𝑡|
𝑥(𝑡) = 𝐴 [1 − ]
𝑇
Sawtooth Signal
The sawtooth wave (or saw wave) is a kind of non-sinusoidal waveform. It is named a
sawtooth based on its resemblance to the teeth on the blade of a saw. The convention is that a
sawtooth wave ramps upward and then sharply drops. However, there are also sawtooth
waves in which the wave ramps downward and then sharply rise. The latter type of sawtooth
wave is called a 'reverse sawtooth wave' or 'inverse sawtooth wave'.
1
𝑠(𝑡) = 2 (𝑡% ) 𝑓 − 1
𝑓
where f is the sawtooth’s frequency in Hz, t is time in seconds, and % is the modulo
operator applied to real values.
The formula reads, “increase the value linearly (t), jump back to 0 every period, scale
to the [0,1] range (multiplication by f), and then expand the range from [0,1] to [−1,1]
(multiplication by 2 and subtraction of 1).”
RESOURCES REQUIRED
PROCEDURE
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see figure window
PROGRAM
Square wave
%square function%
clc;
clear all;
close all;
t=0:0.01:2;
x=square(2*pi*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('square signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('square sequence');
Sine wave
%sinusoidal function%
clc;
clear all;
close all;
t=0:0.01:2;
x=sin(2*pi*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sinusoidal sequence');
Triangular wave
%triangular function%
clc;
clear all;
close all;
t=0:0.01:2;
x=sawtooth(2*pi*5*t,0.5);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('triangular signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('triangular sequence');
Sawtooth wave
%sawtooth function%
clc;
clear all;
close all;
t=0:0.01:2;
x=sawtooth(2*pi*5*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sawtooth signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sawtooth sequence');
OUTPUT WAVEFORMS
Sawtooth wave
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Plot triangular and sawtooth wave of same frequency and plot in the same figure
window.
2. Generate a sinusoidal signal x(t)=A⋅sin(2πft+ϕ) where A=2, f=5 Hz, and ϕ=π/4. Plot
the signal over the time interval 0 ≤ t ≤ 2 seconds.
3. Create a square wave signal x(t) with a frequency of 2 Hz and a duty cycle of 30%.
Plot the signal over the time interval 0 ≤ t ≤ 4 seconds.
4. How can you add legends to a plot in MATLAB? Provide the syntax and an example
of adding a legend to differentiate between plotted signals.
5. Discuss the significance of the 'hold on' and 'hold off' commands in MATLAB
plotting. When and why would you use them?
6. Explain the process of saving a MATLAB plot as an image file. What are the
available file formats, and how do you specify them in MATLAB?
REFERENCES
ASSESSMENT SCHEME
PRACTICAL SIGNIFICANCE
In MATLAB, the significance of 3D representation lies in its ability to visually
portray complex data with depth and perspective. This dimensionality allows for a more
comprehensive analysis of volumetric data, enabling a better understanding of relationships
and patterns within the data. Moreover, MATLAB's 3D plotting capabilities aid in visualizing
surfaces, which is crucial in fields like engineering, physics, and biology, where depicting
functions, terrain, or experimental results as surfaces greatly enhances comprehension.
Surface plotting in MATLAB is instrumental in representing mathematical functions,
experimental data, and modelling results in a way that emphasizes their behaviour across
multiple dimensions, providing a clearer insight into their characteristics and trends. This
functionality empowers researchers, engineers, and scientists to analyze and interpret data
more effectively in their respective fields.
PRACTICAL OUTCOME
Plot different types of plots 3D, surface plot, polar plot.
THEORY
Three-Dimensional Graphics
One of the best features of MATLAB is the use of 3D plotting to create beautiful
visualisation of functions and relationships between them. It offers 3-dimensional plotting
functions such as plot3, comet3, mesh, surf, surfl, contour, ezsurf, fsurf etc.
MATLAB provides a variety of functions to display 3-D data. Some functions plot lines
in 3-D, while others draw surfaces and wire frames. In addition, colour can be used to
represent a fourth dimension. When colour is used in this manner, it is called pseudo colour,
since colour is not inherent or natural property of the underlying data in the way that colour
in a photograph is natural characteristic of the image.
a) LINE PLOTS: General format of the command is plot3(x1,y1,z1,S1,x2,y2,z2,S2,…)
where xn,yn and zn are vectors or matrices and Sn are optional character strings
specifying colour, marker symbol and or line style.
b) MESH PLOT: MATLAB defines a mesh surface by the z-coordinates of points
above a rectangular grid in the x-y plane. It formats a mesh plot by joining adjacent
points with straight lines. The result looks like a fishing net with knots at the data
points.
c) SURFACE PLOTS: A surface plot is like a mesh plot, except that the spaces
between the lines called patches are filled in. Plots of this type are generated using the
surf function.
RESOURCES REQUIRED
PROCEDURE
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see figure window
PROGRAM
OUTPUT WAVEFORMS
Helix using the function plot3() Cylinder using the function plot3()
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Plot a 3d surface plot for the function x.*exp(-x.^2-y.^2) for range -2 to 2.
REFERENCES
Text
Sl.
Book/ Author Publication
No.
Website
https://subarna-lamsal1.medium.com/basics-of-beautiful-3d-
plotting-in-matlab-b85e252b244c
https://www.studocu.com/in/document/chandigarh-college-of-
Web engineering-and-technology/routing-and-switching/matlab-lab-
1 manual/65664798
references https://in.mathworks.com/help/matlab/visualize/creating-3-d-
plots.html
https://mathweb.ucsd.edu/~bdriver/21d-s99/matlab-
primer2.html#s18
ASSESSMENT SCHEME
PRACTICAL SIGNIFICANCE
Plotting diode characteristics in MATLAB is crucial for understanding their
behaviour under different conditions like voltage and current. It helps in visualizing the
diode's forward and reverse bias characteristics, aiding engineers and researchers in designing
and analyzing circuits accurately. MATLAB's graphical representation allows for quick
analysis of the diode's nonlinear behaviour, enabling parameter extraction and model fitting
for various applications in electronics. Ultimately, these plotted characteristics facilitate
informed decision-making in circuit design and optimization processes.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
Plot input output characteristics of diode(P-N junction).
THEORY
V-I characteristics of P-N junction diodes is a curve between the voltage and current
through the circuit. Voltage is taken along the x-axis while the current is taken along the y-
axis. The below graph is the V-I characteristics curve of the P-N junction diode.
With the help of the curve, we can understand that there are three regions in which the
diode works, and they are:
• Zero bias
• Forward bias
• Reverse bias
When the P-N junction diode is in zero bias condition, there is no external voltage applied
and this means that the potential barrier at the junction does not allow the flow of current.
When the P-N junction diode is in forward bias condition, the p-type is connected to the
positive terminal while the n-type is connected to the negative terminal of the external
voltage. When the diode is arranged in this manner, there is a reduction in the potential
barrier. For silicone diodes, when the voltage is 0.7 V and for germanium diodes, when the
voltage is 0.3 V, the potential barriers decrease, and there is a flow of current.
When the diode is in forward bias, the current increases slowly, and the curve obtained is
non-linear as the voltage applied to the diode overcomes the potential barrier. Once the diode
overcomes the potential barrier, the diode behaves normally, and the curve rises sharply as
the external voltage increases, and the curve obtained is linear.
When the P-N junction diode is in negative bias condition, the p-type is connected to the
negative terminal while the n-type is connected to the positive terminal of the external
voltage. This results in an increase in the potential barrier. Reverse saturation current flows in
the beginning as minority carriers are present in the junction.
RESOURCES REQUIRED
PROCEDURE
1. Open MATLAB
2. Open a new simulation window by clicking on simulink button.
3. Window that appears in simulink library browser the window contains component
that can be plotted into simulink or design window.
4. Drag & drop the following components from library and do the settings also as given.
Diode
Ramp
Multimeter
Demux
Bus selector
Scope
Powergui
5. Run the simulation with Slope = 1in the ramp for obtaining forward V-I
characteristics.
6. Run the simulation with Slope = -1in the ramp for obtaining forward V-I
characteristics.
SIMULINK MODEL FOR SIMULATION
OUTPUT WAVEFORMS
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Demonstrate the use of Simulink to analyze the impact of different resistors on a
diode's voltage-current relationship.
PRACTICAL RELATED QUESTIONS
1. What are the different regions of operation for a diode?
2. How does the temperature affect the diode characteristics, and can this be simulated in
MATLAB Simulink?
3. Discuss the differences between ideal and practical diode characteristics and their
impact on circuit analysis.
REFERENCES
Sl Text
. Book/ Aut
Publication
N Websi hor
o. te
https://www.avit.ac.in/lab/electrical_circuits_and_electronic_devices_lab/
Web download/17ECCC93/lab_manual.pdf
https://www.youtube.com/watch?v=qb8McSN8hHw
1 refere
https://youtu.be/vCrFplXxuaQ
nces https://byjus.com/physics/p-n-junction/#v-i-characteristics-of-pn-junction-
diode
ASSESSMENT SCHEME
PRACTICAL SIGNIFICANCE
Plotting transistor characteristics in MATLAB allows engineers to visualize and
analyze the behaviour of transistors under different operating conditions. These plots help in
understanding key parameters like current-voltage relationships, gain, and cutoff regions,
aiding in circuit design and optimization. MATLAB's graphical representations enable quick
identification of transistor operating regions, assisting in efficient circuit design and
troubleshooting. Furthermore, these characteristics aid in the validation and verification of
theoretical models, ensuring accurate transistor behaviour in practical applications.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
Plot input output characteristics of BJT(Bipolar Junction Transistor).
THEORY
In Common Emitter (CE) configuration, the emitter is the common terminal. Hence, the input
is between the base and the emitter while the output is between the collector and the emitter.
Two terms that you must remember:
• Input characteristic – the variation of the base current (IB) with the base-emitter
voltage (VBE)
• Output characteristic – the variation of the collector current (IC) with the collector-
emitter voltage (VCE)
Input Characteristics
A curve is plotted between the base current (IB) and the base-emitter voltage (VBE) to
study the input characteristics of the junction transistor in CE configuration. The collector-
emitter voltage (VCE) is kept at a fixed value to study the relation between IB and VBE.
Output Characteristics
Plot a curve is between the Collector current (IC) and the collector-emitter voltage
(VCE). Also, keep the base current (IB) at a steady value.
RESOURCES REQUIRED
PROCEDURE
1. Open MATLAB
2. Open a new simulation window by clicking on simulink button.
3. Window that appears in simulink library browser the window contains component
that can be plotted into simulink or design window.
4. First create the Simulink model for output characteristics and then for input
characteristics.
5. Drag & drop the following components from library and do the settings also as given.
Block name Block icon Block settings
DC voltage source
Controlled voltage
Default settings
source
PS-Simulink
Default settings
Converter
Simulink-PS
Default settings
Converter
Ramp
6. Using the logging option in the configuration settings of the scope, save the Scope
measuring IC values as ScopeData and the Scope measuring VCE values as
ScopeData1.
7. Run the simulation. The two scopes gives plots, IC vs time and VCE vs time.
8. To get the plot between VCE vs IC, plot these two values against each other using the
function
plot(ScopeData1.signals.values,ScopeData.signals.values)
9. To plot the output characteristics for various values of IB in a single plot, run the
simulation for IB values ranging from 10mA to 60mA and generate the two scope
datas in the workspace as mentioned in Step 5. The variables used for various scope
datas are given below.
IB value Variable for scope data of IC Variable for scope data of VCE
10mA ScopeData ScopeData1
20mA ScopeData2 ScopeData3
30mA ScopeData4 ScopeData5
40mA ScopeData6 ScopeData7
50mA ScopeData8 ScopeData9
60mA ScopeData10 ScopeData11
10. Create an m-file using the code given in the code section to use all the above scope
data to plot the output characteristics for more than one value of IB.
11. Create the Simulink model for finding input characteristics.
12. Using the logging option in the configuration settings of the scope, save the Scope
measuring IB values as ScopeData and the Scope measuring VBE values as
ScopeData1.
13. Run the simulation. The two scopes gives plots, IB vs time and VBE vs time.
14. To get the plot between VBE vs IB, plot these two values against each other using the
function
plot(ScopeData1.signals.values,ScopeData.signals.values)
15. To plot the output characteristics for various values of VCE in a single plot, run the
simulation for VCE values ranging from 0V to 1V and generate the two scope datas in
the workspace as mentioned in Step 5. The variables used for various scope datas are
given below.
VCE value Variable for scope data of ID Variable for scope data of VDS
0V ScopeData ScopeData1
0.1V ScopeData2 ScopeData3
0.2V ScopeData4 ScopeData5
Output characteristics
Input characteristics
Output characteristics
plot(ScopeData1.signals.values,ScopeData.signals.values,'b')
hold on
plot(ScopeData3.signals.values,ScopeData2.signals.values,'g')
hold on
plot(ScopeData5.signals.values,ScopeData4.signals.values,'c')
hold on
plot(ScopeData7.signals.values,ScopeData6.signals.values,'m')
hold on
plot(ScopeData9.signals.values,ScopeData8.signals.values,'y')
hold on
plot(ScopeData11.signals.values,ScopeData10.signals.values,'k')
hold on
axis([0 5 0 6])
xlabel('Collector to Emitter voltage(VCE)')
ylabel('Collector current(IC)')
legend('IB=10mA','IB=20mA','IB=30mA','IB=40mA','IB=50mA','IB=60mA
')
title('BJT output characteristics')
Input characteristics
plot(ScopeData1.signals.values,ScopeData.signals.values,'b')
hold on
plot(ScopeData3.signals.values,ScopeData2.signals.values,'g')
hold on
plot(ScopeData5.signals.values,ScopeData4.signals.values,'c')
hold on
plot(ScopeData7.signals.values,ScopeData6.signals.values,'m')
hold on
plot(ScopeData9.signals.values,ScopeData8.signals.values,'y')
hold on
plot(ScopeData11.signals.values,ScopeData10.signals.values,'k')
hold on
axis([0 1 0 0.3])
xlabel('Base to Emitter voltage(VBE)')
ylabel('Base current(IB)')
legend('VCE=0V','VCE=0.1V','VCE=0.2V','VCE=0.3V','VCE=0.5V','VCE=
1V')
title('BJT input characteristics')
OUTPUT WAVEFORMS
Output characteristics
Input characteristics
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Plot the input and output characteristics of pnp BJT.
REFERENCES
ASSESSMENT SCHEME
PRACTICAL SIGNIFICANCE
Analyzing MOSFET characteristics using MATLAB holds practical significance in
electronic circuit design by providing a detailed insight into device behavior. MATLAB
allows engineers to simulate and visualize key parameters such as threshold voltage,
transconductance, and drain current, aiding in the optimization of circuit performance. This
enables designers to fine-tune MOSFET operating points, ensuring optimal power efficiency
and signal integrity. Furthermore, MATLAB facilitates the exploration of various MOSFET
configurations and their impact on overall circuit behaviour, streamlining the design process
and contributing to the development of high-performance electronic systems.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
Plot input output characteristics of MOSFET.
THEORY
MOSFET stands for Metal Oxide Silicon Field Effect Transistor or Metal Oxide
Semiconductor Field Effect Transistor.
Depending upon the type of materials used in the construction, and the type of
operation, the MOSFETs are classified as in the following figure.
A thin layer of Silicon dioxide (SiO2) is grown over the entire surface and holes are
made to draw ohmic contacts for drain and source terminals. A conducting layer of
aluminium is laid over the entire channel, upon this SiO2 layer from source to drain which
constitutes the gate. The SiO2 substrate is connected to the common or ground terminals.
Characteristics of MOSFET
Fig 9.2a shows the transfer characteristics (drain-to-source current IDS versus gate-to-
source voltage VGS) of n-channel Enhancement-type MOSFETs. From this, it is evident that
the current through the device will be zero until the VGS exceeds the value of threshold
voltage VT. This is because under this state, the device will be void of channel which will be
connecting the drain and the source terminals. Under this condition, even an increase in VDS
will result in no current flow as indicated by the corresponding output characteristics (IDS
versus VDS) shown by Figure Fig 9.2b. As a result, this state represents nothing but the cut-
off region of MOSFET’s operation.
Next, once VGS crosses VT, the current through the device increases with an increase
in IDS initially and then saturates to a value as determined by the VGS (saturation region of
operation) i.e. as VGS increases, even the saturation current flowing through the device also
increases. This is evident by Figure b where IDSS2 is greater than IDSS1 as VGS2 > VGS1, IDSS3 is
greater than IDSS2 as VGS3 > VGS2, so on and so forth. Further, Figure b also shows the locus of
pinch-off voltage (black discontinuous curve), from which VP is seen to increase with an
increase in VGS.
RESOURCES REQUIRED
PROCEDURE
1. Open MATLAB
2. Open a new simulation window by clicking on simulink button.
3. Window that appears in simulink library browser the window contains component
that can be plotted into simulink or design window.
4. Drag & drop the following components from library and do the settings also as given.
Block name Block icon Block settings
DC voltage source
Controlled voltage
Default settings
source
PS-Simulink
Default settings
Converter
Simulink-PS
Default settings
Converter
Ramp
5. Using the logging option in the configuration settings of the scope, save the Scope
measuring ID values as ScopeData and the Scope measuring VDS values as
ScopeData1.
6. Run the simulation. The two scopes gives plots, ID vs time and VDS vs time.
7. To get the plot between VDS vs ID, plot these two values against each other using the
function
plot(ScopeData1.signals.values,ScopeData.signals.values)
8. To plot the drain characteristics for various values of VGS in a single plot, run the
simulation for VGS values ranging from 4 to 9V and generate the two scope datas in
the workspace as mentioned in Step 5. The variables used for various scope datas are
given below.
VGS value Variable for scope data of ID Variable for scope data of VDS
4V ScopeData ScopeData1
5V ScopeData2 ScopeData3
6V ScopeData4 ScopeData5
7V ScopeData6 ScopeData7
8V ScopeData8 ScopeData9
9V ScopeData10 ScopeData11
9. Create an m-file using the code given in the code section to use all the above scope
data to plot the drain characteristics for more than one value of VGS.
OUTPUT WAVEFORMS
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Plot the drain characteristics of p-channel MOSFET.
REFERENCES
Sl. Text
Autho
No Book/ Publication
r
. Website
Web https://youtu.be/8Z_qz8I5WLE
https://www.tutorialspoint.com/basic_electronics/basic_electronics_
1 referenc
mosfet.htm
es https://www.electrical4u.com/mosfet-characteristics/
ASSESSMENT SCHEME
PRACTICAL SIGNIFICANCE
Implementing a full-wave bridge rectifier with an LC filter in MATLAB Simulink is
practically significant for power electronics applications. This setup helps convert AC to DC
efficiently, reducing ripple voltage and enhancing the quality of the output signal. The
Simulink model allows real-time simulation, enabling engineers to analyze and optimize the
circuit's performance before physical implementation. Moreover, it aids in understanding the
behavior of the rectifier-filter combination under varying loads and input conditions,
facilitating robust design practices in power systems.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
Simulate single Phase Full Wave Diode Bridge Rectifier with LC Filter.
THEORY
A rectifier is an electrical device that converts an Alternating Current (AC) into a Direct
Current (DC) by using one or more P-N junction diodes.
There are two types of rectifiers – Half wave and Full wave.
Full wave bridge rectifier
The bridge rectifier circuit is made of four diodes D1, D2, D3, D4, and a load resistor
RL. The four diodes are connected in a closed-loop configuration to efficiently convert the
alternating current (AC) into Direct Current (DC).
The input signal is applied across terminals A and B, and the output DC signal is
obtained across the load resistor RL connected between terminals C and D.
When an AC signal is applied across the bridge rectifier, terminal A becomes positive
during the positive half cycle while terminal B becomes negative. This results in diodes D1
and D3 becoming forward biased while D2 and D4 becoming reverse biased.
During the negative half-cycle, terminal B becomes positive while terminal A
becomes negative. This causes diodes D2 and D4 to become forward biased and diode D1 and
D3 to be reverse biased.
The current flow across load resistor RL is the same during the positive and negative half-
cycles.
Fig 10.2 Full wave bridge rectifier – input and output wavforms
RESOURCES REQUIRED
PROCEDURE
1. To start Simulink, you must start the MATLAB first
2. Now open the Simulink, by clicking on Simulink Icon
3. To create a new model , click the New Model button on the Library Browser’s
toolbar.
4. To create the model, you need to drag and drop required blocks into the model from
the following Simulink block libraries:
• Sources library (the Sine Wave block)
• Sinks library (the Scope block)
• Commonly used blocks
5. Sine wave block drag and drop from sources to new model.
6. Construct the model as shown in figure with blocks and links to connect them
7. Set the parameters for linear transformer as:
• Units = S.I.
• Nominal power and frequency [Pn(VA) fn(Hz)] = [ 1e3 50 ]
• Winding 1 parameters [V1(Vrms) R1(ohm) L1(H)] = [2 0 0]
• Winding 1 parameters [V1(Vrms) R1(ohm) L1(H)] = [1 0 0]
• Uncheck the check box – Three windings transformer
8. Set the value of RL = 100.
9. Run the simulink by clicking on run button and observe the waveforms to obtain the
output of full wave bridge rectifier.
10. Now add LC filter to get filtered output.
11. First keep L=173 mH and C=318uF and observe the output waveform.
12. Then keep L=5 mH and C=100uF and observe the output waveform.
13. Then keep L=5 mH and C=470uF and observe the output waveform.
OUTPUT WAVEFORMS
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
REFERENCES
ASSESSMENT SCHEME
PRACTICAL SIGNIFICANCE
Node and mesh analysis are fundamental techniques in electrical circuit analysis.
MATLAB enables the application of these methods to solve complex circuits efficiently,
offering a practical way to understand and design circuits. Through MATLAB, engineers can
quickly implement node analysis to determine node voltages or mesh analysis to calculate
mesh currents, streamlining the analysis process and aiding in circuit optimization. This
software facilitates not only the computation but also visualization of results, allowing for
easier interpretation and validation of circuit designs.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
Solve node, mesh and loop equations of simple electrical/network circuits.
THEORY
Mesh analysis
Mesh analysis is a method for obtaining loop currents. The technique uses Kirchoff
voltage law (KVL) to write a set of independent simultaneous equations. The Kirchoff
voltage law states that the algebraic sum of all the voltages around any closed path in a circuit
equals zero.
In mesh analysis, we want to obtain current from a set of simultaneous equations. The
latter equations are easily set up if the circuit can be drawn in planar fashion. This implies
that a set of simultaneous equations can be obtained if the circuit can be redrawn without
crossovers.
For a planar circuit with n-meshes, the KVL can be used to write equations for each
mesh that does not contain a dependent or independent current source. Using KVL and
writing equations for each mesh, the resulting equations will have the general form:
where:
I1, I2, ... In are the unknown currents for meshes 1 through n.
Z11, Z22, …, Znn are the impedance for each mesh through which individual current flows.
Zij, j # i denote mutual impedance.
∑ Vx is the algebraic sum of the voltage sources in mesh x.
Equation can be expressed in matrix form as
in a circuit, and we select a reference node, the other nodes can be numbered from V1 through
Vn-1. With one node selected as the reference node, there will be n-1 independent equations.
If we assume that the admittance between nodes i and j is given as Yij, we can write the nodal
equations:
V1, V2 and Vm are voltages from nodes 1, 2 and so on ..., n with respect to the reference node.
∑ Ix is the algebraic sum of current sources at node x.
Equation can be expressed in matrix form as
PROCEDURE
1. Open MATLAB.
2. Open new M-file.
3. Type the program.
4. Save in current directory.
5. Compile and Run the program.
6. For the output see command window.
7. Implement the same circuit in Simulink and measure the voltages or currents using
node analysis or mesh analysis respectively and cross check the results obtained using
solving the equation written using MATLAB script file.
1. Use the mesh analysis to find the current flowing through the resistor RB.
2. Use the mesh analysis to find all the three mesh currents.
3. For the circuit shown below, find the nodal voltages V1, V2 and V3.
4. For the circuit shown below, find the nodal voltages V1 and V2.
1.
Loop 1,
40𝐼1 − 10𝐼2 − 30𝐼3 = 10
Loop 2,
−10𝐼1 + 30𝐼2 − 5𝐼3 = 0
Loop 3,
−30𝐼1 − 5𝐼2 + 65𝐼3 = 0
In matrix form
40 −10 −30 𝐼1 10
[−10 30 𝐼
−5 ] [ 2 ] = [ 0 ]
−30 −5 65 𝐼3 0
2.
Loop 1,
3𝐼1 − 1𝐼2 − 2𝐼3 = 8
Loop 2,
−1𝐼1 + 8𝐼2 − 3𝐼3 = 10
Loop 3,
−2𝐼1 − 3𝐼2 + 10𝐼3 = 12
In matrix form
3 −1 −2 𝐼1 8
[−1 8 −3] [𝐼2 ] = [10]
−2 −3 10 𝐼3 12
3.
For node1,
𝑉1 − 𝑉2 𝑉1 − 𝑉3
+ −5=0
10 20
0.15𝑉1 − 0.1𝑉2 − 0.05𝑉3 = 5
For node2,
𝑉2 − 𝑉1 𝑉2 𝑉2 − 𝑉3
+ + =0
10 50 40
−0.1𝑉1 + 0.145𝑉2 − 0.025𝑉3 = 0
For node3,
𝑉3 − 𝑉1 𝑉3 − 𝑉2
+ −2=0
20 40
−0.05𝑉1 − 0.025𝑉2 + 0.075𝑉3 = 2
In matrix form
0.15 −0.1 −0.05 𝑉1 5
[ −0.1 0.145 −0.025] [𝑉2 ] = [0]
−0.05 −0.025 0.075 𝑉3 2
4.
For node1,
𝑉1 − 60 𝑉1 − 𝑉2
+ =1
20 30
0.083𝑉1 − 0.033𝑉2 = 4
For node2,
𝑉2 − 𝑉1 𝑉2 − 40 𝑉2
+ + =0
30 50 100
−0.033𝑉1 + 0.063𝑉2 = 0.8
In matrix form
0.083 −0.033 𝑉1 4
[ ][ ] = [ ]
−0.033 −.063 𝑉2 0.8
PROGRAM
1.
clc;
clear all;
close all;
mesh=[40, -10, -30, 10; -10, 30, -5, 0; -30, -5, 65, 0];
I=rref(mesh);
2.
clc;
clear all;
close all;
mesh=[ 3, -1, -2, 8; -1, 8, -3, 10; -2, -3, 10, 12];
I=rref(mesh);
3.
clc;
clear all;
close all;
mesh=[ 0.15, -0.1, -0.05, 5; -0.1, 0.145, -0.025, 0; -0.05 -0.025, 0.075,2];
V=rref(node);
4.
clc;
clear all;
close all;
node=[3, -1, -2, 8; -1, 8, -3, 10; -2, -3, 10, 12];
I=rref(mesh);
OUTPUT
1.
1 0 0 0.4753
𝐼 = [0 1 0 0.1975]
0 0 1 0.2346
Hence I1 = 0.4753A, I2 = 0.1975A and I3 = 0.2346A
Current through R3 = I3 - I2 = 0.0371A
2.
1 0 0 6.0126
𝐼 = [0 1 0 3.2704]
0 0 1 3.3836
Hence I1 = 6.0126A, I2 = 3.2704A and I3 = 3.3836A
3.
1 0 0 404.2857
𝑉 = [0 1 0 350 ]
0 0 1 412.8571
Hence V1 = 404.2857V, V2 = 350V and V3 = 412.8571V
4.
1 0 67.2464
𝑉=[ ]
0 1 47.9227
Hence V1 = 67.2462V, V2 = 47.9227V
SIMULINK MODEL
1.
2.
3.
4.
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Take a linear circuit containing voltage sources, current sources and resistors. Perform
node and mesh analysis of the same using Simulink and evaluate the obtained voltage
and current value results.
REFERENCES
ASSESSMENT SCHEME
PRACTICAL SIGNIFICANCE
The time response of an RLC circuit in MATLAB Simulink is crucial as it helps
analyze the behaviour of the circuit over time when subjected to different inputs. It allows
engineers to study transient behaviours such as settling time, overshoot, and damping in the
circuit's response to input signals. Understanding these responses aids in designing and
optimizing circuit parameters for specific applications, ensuring stable and desired
performance. MATLAB Simulink's visualization tools provide an intuitive way to observe
and analyze these time-domain characteristics efficiently.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
Simulate an R-L-C circuit to determine time response.
THEORY
𝑑𝑖 𝑑2𝑖 1
𝑅 +𝐿 2+ 𝑖 =0
𝑑𝑡 𝑑𝑡 𝐶
𝑑 2 𝑖 𝑅 𝑑𝑖 1
2
+ + 𝑖=0
𝑑𝑡 𝐿 𝑑𝑡 𝐿𝐶
This equation describes the response of the circuit.
RESOURCES REQUIRED
PROCEDURE
1. To start Simulink, you must start the MATLAB first.
2. Now open the Simulink, by clicking on Simulink Icon.
3. To create a new model, click the New Model button on the Library Browser’s toolbar.
4. To create the model, you need to drag and drop required blocks into the model from
the following Simulink block libraries:
• Sources library (the Sine Wave block)
• Sinks library (the Scope block)
• Commonly used blocks
5. Construct the model as shown in figure with blocks and links to connect them.
6. Set the parameters of the blocks used in the model.
7. Run the simulink by clicking on run button.
8. Double click on scope block to observe waveforms.
OUTPUT WAVEFORMS
𝒅𝟐 𝒊
Scope output:
𝒅𝒕𝟐
𝒅𝒊
Scope output: 𝒅𝒕
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Demonstrate the use of Simulink to analyze the effects of different input signals (e.g.,
step, impulse) on the time response of an RLC circuit. What conclusions can you
draw from these simulations?
2. Create a Simulink model for a second-order RLC circuit and simulate its response to a
square wave input. Determine the damping factor and natural frequency from the
output response.
3. Develop a Simulink model for an RLC circuit and analyze the effect of varying the
resistor value on the transient response. Plot and compare the responses for different
resistance values.
REFERENCES
ASSESSMENT SCHEME
Performance indicators Weightage
Process related (27 marks) 60%
1 Coding ability 20%
2 Debugging ability 30%
3 Follow ethical practices 10%
Product related (18 marks) 40%
1 Relevance of output of the problem definition. 20%
2 Timely Submission of report, Answer to sample questions. 20%
Total (37.5 marks) 100%
PRACTICAL SIGNIFICANCE
Implementing an amplitude modulator using MATLAB Simulink allows for real-time
simulation and analysis of modulation techniques, providing a hands-on understanding of
signal processing concepts. It offers a practical way to visualize how varying the amplitude of
a carrier signal encodes information, crucial in telecommunications and broadcasting.
Simulink's graphical interface simplifies the design process, enabling swift prototyping and
testing of different modulation schemes before deployment. Overall, this tool facilitates
practical learning and experimentation, crucial for engineers and researchers in the field of
communications.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
𝑒𝑚 = 𝐸𝑚 𝑠𝑖𝑛𝜔𝑚 𝑡
where, Em is the peak amplitude of modulating signal and wm = 2πfm. Let carrier signal of
AM wave is represented as
𝑒𝑐 = 𝐸𝑐 𝑠𝑖𝑛𝜔𝑐 𝑡
PROCEDURE
1. To start Simulink, you must start the MATLAB first
2. Now open the Simulink, by clicking on Simulink Icon
3. To create a new model , click the New Model button on the Library Browser’s
toolbar.
4. To create the model, you need to drag and drop required blocks into the model from
the following Simulink block libraries:
• Sources library (the Sine Wave block)
• Sinks library (the Scope block)
• Commonly used blocks
5. Sine wave block drag and drop from sources to new model
6. Construct the model as shown in 10.1 with blocks and links to connect them
7. Set the parameters for modulating signal as:
• Amplitude = 1
• Frequency = 2π
• Phase = 0
• Sample time = 1/1000
8. Set the parameters for carrier signal as:
• Amplitude = 1
• Frequency = 2π*25
• Phase = 0
• Sample time = 1/1000
9. Set the parameters for modulation index = 0.5 for under modulation, 1 for perfect
modulation, 1.5 for over modulation.
10. Run the simulink by clicking on run button.
11. Double click on scope block to observe waveforms.
OUTPUT WAVEFORMS
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
REFERENCES
ASSESSMENT SCHEME
Performance indicators Weightage
Process related (27 marks) 60%
1 Coding ability 20%
2 Debugging ability 30%
3 Follow ethical practices 10%
Product related (18 marks) 40%
1 Relevance of output of the problem definition. 20%
2 Timely Submission of report, Answer to sample questions. 20%
Total (37.5 marks) 100%
PRACTICAL SIGNIFICANCE
Implementing a Frequency Modulator using MATLAB Simulink allows for the
simulation and analysis of modulation techniques, crucial in communication systems. It aids
in understanding how information is encoded onto carrier signals, influencing bandwidth
utilization and signal quality. Simulink's visualization tools enable real-time observation of
the modulation process, facilitating troubleshooting and optimization of modulation
parameters. This practical implementation helps engineers grasp the complexities of
frequency modulation, vital in designing robust communication systems.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PROCEDURE
1. To start Simulink, you must start the MATLAB first
2. Now open the Simulink, by clicking on Simulink Icon
3. To create a new model, click the New Model button on the Library Browser’s toolbar.
4. To create the model, you need to drag and drop required blocks into the model from
the following Simulink block libraries:
Sources library (the Sine Wave block)
Sinks library (the Scope block).
Commonly used blocks
Math operations
DSP system toolbox
5. Construct the model as shown in figure with blocks and links to connect them
6. Set the parameters for modulating signal as:
• Amplitude = 1
• Frequency = 2π*10
• Phase = 0
• Sample time = 1/1000
7. Set the parameters for constant as:
• Constant value = 100
8. Set the parameters for Gain as:
• Constant value = 50
9. Set the parameters for sum as:
• List of signs = |++
• Sample time = 0.001
10. Set the parameters for trigonometric function as:
• Function = cos
11. Set the parameters for Gain1 as:
• Gain = 2*pi
12. Set the parameters for Analog Filter as:
• Design method = Butterworth
OUTPUT WAVEFORMS
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Demonstrate the process of varying the modulation index in a Simulink frequency
modulation model? How does this affect the output signal?
2. Investigate the bandwidth requirements for FM transmission. Design a Simulink
model to depict how changing the modulation index influences the signal bandwidth.
REFERENCES
ASSESSMENT SCHEME
Performance indicators Weightage
Process related (27 marks) 60%
1 Coding ability 20%
2 Debugging ability 30%
3 Follow ethical practices 10%
Product related (18 marks) 40%
1 Relevance of output of the problem definition. 20%
2 Timely Submission of report, Answer to sample questions. 20%
Total (37.5 marks) 100%
PRACTICAL SIGNIFICANCE
Pulse modulation schemes, implemented using MATLAB Simulink, play a pivotal
role in signal processing by encoding analog information into digital signals. These schemes,
like Pulse Amplitude Modulation (PAM) or Pulse Width Modulation (PWM), enable efficient
transmission, reducing noise susceptibility and ensuring accurate signal reproduction.
MATLAB Simulink's simulation capabilities allow for real-time modelling and analysis,
offering a robust platform to evaluate and optimize various pulse modulation techniques for
diverse applications, from telecommunications to control systems. Mastering these
techniques through Simulink enhances understanding and proficiency in digital
communication and signal processing domains.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
RESOURCES REQUIRED
PROCEDURE
1. To start Simulink, you must start the MATLAB first
2. Now open the Simulink, by clicking on Simulink Icon
3. To create a new model, click the New Model button on the Library Browser’s toolbar.
4. To create the model, you need to drag and drop required blocks into the model from
the following Simulink block libraries:
Sources library (the Sine Wave block)
Sinks library (the Scope block).
Commonly used blocks
Math operations
DSP system toolbox
5. Construct the model as shown in figure with blocks and links to connect them
6. Set the parameters for signal generator as:
• Waveform = sine
• Amplitude = 0.9
• Frequency = 1
• Unit = rad/sec
7. Set the parameters for saw tooth generator as:
• Waveform = saw tooth
• Amplitude = 1
• Frequency = 10
• Unit = rad/sec
8. Set the parameters for pulse generator as:
• Pulse type = time based
• Amplitude = 1
• Period = 0.1
• Pulse width = 1
• Phase delay = 0
9. Set the parameters for monostable multivibrator as:
• Edge detection = rising
• Pulse duration = 0.05s
• Initial condition of previous input = 0
• Sample time = 0
OUTPUT WAVEFORMS
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. How does MATLAB Simulink facilitate the analysis of pulse modulation schemes in
terms of signal reconstruction? Demonstrate the reconstruction process of a
modulated signal using Simulink blocks.
REFERENCES
Sl Text
. Book/ Aut
Publication
N Webs hor
o. ite
https://www.youtube.com/watch?v=jnuXL5beA74
Web https://www.youtube.com/watch?v=OvYnblg7G24
1 refere https://www.vedantu.com/question-answer/what-is-pam-pwm-and-ppm-
class-12-physics-cbse-60d4c5bb5bde31476b3bf9cc
nces https://www.tutorialspoint.com/principles_of_communication/principles_of
_communication_analog_pulse_modulation.htm
ASSESSMENT SCHEME
Performance indicators Weightage
Process related (27 marks) 60%
1 Coding ability 20%
2 Debugging ability 30%
3 Follow ethical practices 10%
Product related (18 marks) 40%
1 Relevance of output of the problem definition. 20%
2 Timely Submission of report, Answer to sample questions. 20%
Total (37.5 marks) 100%
PRACTICAL SIGNIFICANCE
Pulse Code Modulation (PCM) is practically significant as it enables efficient digital
representation of analog signals, crucial in various communication systems. Using MATLAB
Simulink, PCM can be simulated to showcase its ability to accurately sample, quantize, and
encode analog data into discrete digital signals. Understanding PCM through Simulink helps
in designing and optimizing communication systems, ensuring fidelity and reliability in
transmitting and storing information. This practical application aids engineers in
implementing robust digital communication schemes across diverse industries like
telecommunications, audio processing, and medical instrumentation.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
Simulate Pulse Code Modulation(PCM), scheme.
THEORY
In Pulse Code Modulation (PCM) a signal is pulse code modulated to convert its
analog information into a binary sequence, i.e., 1s and 0s. The output of a PCM will resemble
a binary sequence. The following figure shows an example of PCM output with respect to
instantaneous values of a given sine wave.
Instead of a pulse train, PCM produces a series of numbers or digits, and hence this
process is called as digital. Each one of these digits, though in binary code, represent the
approximate amplitude of the signal sample at that instant.
In Pulse Code Modulation, the message signal is represented by a sequence of coded
pulses. This message signal is achieved by representing the signal in discrete form in both
time and amplitude.
Basic Elements of PCM
The transmitter section of a Pulse Code Modulator circuit consists of Sampling,
Quantizing and Encoding, which are performed in the analog-to-digital converter section.
The low pass filter prior to sampling prevents aliasing of the message signal.
The basic operations in the receiver section are regeneration of impaired signals,
decoding, and reconstruction of the quantized pulse train. Following is the block diagram of
PCM which represents the basic elements of both the transmitter and the receiver sections.
PROCEDURE
1. To start Simulink, you must start the MATLAB first
2. Now open the Simulink, by clicking on Simulink Icon
3. To create a new model, click the New Model button on the Library Browser’s toolbar.
4. To create the model, you need to drag and drop required blocks into the model from
the following Simulink block libraries:
Sources library (the Sine Wave block)
Sinks library (the Scope block).
Commonly used blocks
Math operations
DSP system toolbox
5. Construct the model as shown in figure with blocks and links to connect them
6. Set the parameters for pulse generator as:
• Pulse type = time based
• Amplitude = 1
• Period = 1/3000 sec
• Pulse width = 30%
• Phase delay = 0
7. Set the parameters for sine wave generator as:
• Sine type = time based
• Amplitude = 5
• Bias = 0
• Frequency = 2*pi*50
• Phase = pi/2
• Sample time = 1/50000
8. Set the parameters for quantizer as:
• Quantization interval = 1
• Sample time = -1
9. Set the parameters for uniform encoder as:
• Peak = 5
• Bits = 8
10. Set the parameters for Integer to bit converter as:
• Number of bits per integer(M) = 8
• Treat input values as = Signed
• Output bit order = MSB first
• Output data type = Inherit via internal rule
11. Set the parameters for Bit to integer converter as:
• Number of bits per integer(M) = 8
• After bit packing, treat resulting integer values as = Signed
• Input bit order = MSB first
12. Set the parameters for uniform encoder as:
• Peak = 5
• Bits = 8
13. Set the parameters for analog filter design as:
• Design method = Butterworth
• Filter type = low pass
• Filter order = 8
• Passband edge frequency (rad/s) = 2*pi*55
14. Run the simulation for 0.1 sec.
OUTPUT WAVEFORMS
Encoder
Sampled Signal
Quantized signal
Decoder
Decoded signal
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. How does the sampling rate affect the quality of PCM? Can you demonstrate this
relationship using a Simulink model?
2. Can you simulate the effect of quantization noise in PCM using MATLAB Simulink?
How does changing the number of bits per sample affect this noise?
REFERENCES
Sl Text
. Book/ Auth
Publication
N Websi or
o. te
https://youtu.be/5JjtzzFa6iw
Web https://youtu.be/sMkOuFH5CPc
1 referen https://www.tutorialspoint.com/digital_communication/digital_communic
ces ation_pulse_code_modulation.htm
https://www.elprocus.com/pulse-code-modulation-and-demodulation/
ASSESSMENT SCHEME
Performance indicators Weightage
Process related (27 marks) 60%
1 Coding ability 20%
2 Debugging ability 30%
3 Follow ethical practices 10%
Product related (18 marks) 40%
1 Relevance of output of the problem definition. 20%
2 Timely Submission of report, Answer to sample questions. 20%
Total (37.5 marks) 100%
PRACTICAL SIGNIFICANCE
Implementing logic gates using MATLAB Simulink allows for the simulation and
analysis of complex digital systems, enabling engineers to design and verify intricate circuits
efficiently. It provides a visual representation of logic operations, aiding in the understanding
and debugging of circuits before physical implementation. MATLAB Simulink's integration
with other MATLAB functionalities enables seamless exploration and optimization of logic
gate configurations, streamlining the design process. Ultimately, utilizing Simulink for logic
gates fosters rapid prototyping and enhances the reliability of digital systems by fine-tuning
designs in a controlled virtual environment..
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
The mix of inputs applied across a logic gate determines its output. Logic gates use
Boolean algebra to execute logical processes. Logic gates are found in nearly every digital
gadget we use on a regular basis.
Truth
Gate Description Table Logic Symbol Timing diagram
A B Y
The output is active
high if any one of 0 0 0
the input is in 0 1 1
OR
active high state, 1 0 1
Mathematically, Q 1 1 1
=A+B
The output is active
high only if both 0 0 0
the inputs are in 0 1 0
AND
active high state, 1 0 0
Mathematically, Q 1 1 1
= A:B
In this gate the
output is opposite
0 1
NOT to the input state,
1 0
Mathematically,
𝑄 = 𝐴̅
The output
is active high
only if both 0 0 1
the inputs are 0 1 0
NOR
in active low 1 0 0
state, 1 1 0
Mathematically,
𝑄 = 𝐴 ̅̅̅̅̅̅̅̅̅
+ 𝐵
The output is active
high only if any 0 0 1
one of the input is 0 1 1
NAND
in active low state, 1 0 1
Mathematically 1 1 0
𝑄 = 𝐴 ̅̅̅̅̅̅
.𝐵
RESOURCES REQUIRED
PROCEDURE
1. To start Simulink, you must start the MATLAB first
2. Now open the Simulink, by clicking on Simulink Icon
3. To create a new model, click the New Model button on the Library Browser’s toolbar.
4. To create the model, you need to drag and drop required blocks into the model from
the following Simulink block libraries:
Sources library (the Sine Wave block)
Logical operations
5. Construct the model as shown in figure with blocks and links to connect them
6. Set constant block with 0 or 1 as per the truth table of the gates for giving the digital
input.
7. Set logic operator blocks as NOT, AND, OR, NAND, NOR, XOR and XNOR.
8. Set display from the sink block to observe the digital output.
9. Set constant blocks A=0, B=0 and observe the output of all gates.
10. Set constant blocks A=0, B=1 and observe the output of all gates.
11. Set constant blocks A=1, B=0 and observe the output of all gates.
12. Set constant blocks A=1, B=1 and observe the output of all gates.
OUTPUT
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Implement a circuit that involves cascading logic gates (e.g., AND followed by NOT)
to perform a specific logical operation. Validate its correctness with varied inputs.
2. Design identical logic circuits using both Simulink blocks and fundamental gates
(AND, OR, NOT). Compare their performances in terms of simulation time,
complexity, and accuracy.
PRACTICAL RELATED QUESTIONS
1. Explain the significance of Boolean algebra in the design and analysis of logic gates.
2. Demonstrate how you would construct a XOR gate using basic logic gates.
3. Explain the concept of a universal gate and its importance in digital circuit design.
REFERENCES
ASSESSMENT SCHEME
Performance indicators Weightage
Process related (27 marks) 60%
1 Coding ability 20%
2 Debugging ability 30%
3 Follow ethical practices 10%
Product related (18 marks) 40%
1 Relevance of output of the problem definition. 20%
2 Timely Submission of report, Answer to sample questions. 20%
Total (37.5 marks) 100%
PRACTICAL SIGNIFICANCE
Full adders and full subtractors are fundamental building blocks in digital circuits,
crucial for arithmetic operations in computers. In MATLAB Simulink, implementing a full
adder allows for efficient addition of multiple bits, essential for complex calculations in
processors and mathematical operations in digital systems. Conversely, utilizing a full
subtractor enables subtraction functionalities, crucial in applications like data processing and
signal manipulation. Simulink's simulation capabilities allow for the verification and testing
of these crucial components, ensuring their accuracy and reliability in various computational
tasks.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Full Subtractor
A full subtractor is used for performing multibit subtraction where the borrow from
the previous bit position is available. This circuit has three inputs A (minuend), B
(subtrahend) and C (borrow from previous stage) and two outputs Difference (D) and Borrow
(b).
A B C D b
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
RESOURCES REQUIRED
PROCEDURE
1. To start Simulink, you must start the MATLAB first
2. Now open the Simulink, by clicking on Simulink Icon
3. To create a new model, click the New Model button on the Library Browser’s toolbar.
4. To create the model, you need to drag and drop required blocks into the model from
the following Simulink block libraries:
Sources library (the Sine Wave block)
Sinks library (the Scope block).
Commonly used blocks
Logical operations block
5. Construct the model as shown in figure with blocks and links to connect them.
6. Set constant block with 0 or 1 as per the truth table of the circuit of full adder and
verify the truth table from the output shown in the display.
7. Set constant block with 0 or 1 as per the truth table of the circuit of full adder and
verify the truth table from the output shown in the display.
Full adder
Full subtractor
OUTPUT
Full Adder
A B Cin S C
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Full Subtractor
A B C d b
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
REFERENCES
ASSESSMENT SCHEME
Performance indicators Weightage
Process related (27 marks) 60%
1 Coding ability 20%
2 Debugging ability 30%
3 Follow ethical practices 10%
Product related (18 marks) 40%
1 Relevance of output of the problem definition. 20%
2 Timely Submission of report, Answer to sample questions. 20%
Total (37.5 marks) 100%
PRACTICAL SIGNIFICANCE
The 4:1 multiplexer holds practical significance in data routing by selecting one of
four input lines based on a two-bit control signal, allowing for efficient data handling in
various applications like digital communication systems. In MATLAB Simulink,
implementing this multiplexer enables the simulation and analysis of complex systems,
showcasing its role in signal processing and control. Conversely, the 1:4 multiplexer operates
by selecting one of four outputs based on a single select input, facilitating tasks such as data
demultiplexing and control signal generation in digital circuits, which can also be effectively
modelled and studied within MATLAB Simulink for system design and analysis purposes.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
4:1 Multiplexer
A 4-to-1 multiplexer consists of four data inputs D0 through D3, two input select lines
S1 through S0 and a single output line Y. Depending on the select lines combinations,
multiplexer decodes the inputs.
Fig 19.1 shows the block diagram of a 4:1 multiplexer with Enable input pin which
enable or disable the multiplexer. Since the number data bits given to the MUX are four then
2 bits (22=4) are needed to select one of the four data bits.
Fig 19.1 (a) Block diagram of mux (b) Logical diagram of mux
The truth table for a 4-to-1 multiplexer is given below with eight combinations of inputs so as
to generate each output corresponds to input.
Demultiplexer
A Demultiplexer is a data distributor read as DEMUX. It is opposite to multiplexer or
MUX. It is a process of taking information from one input and transmitting over one of many
outputs.
1:4 Demultiplexer
The block diagram of a 1: 4 Demux having only one data input I and four outputs. It
has two select lines S0, S1 which are used as the control signals. There is a strobe input E
which is active low. The data bit at input I is transferred to one of the eight outputs depending
upon the states of the select lines.
Fig 19.2 (a) Block diagram of demux (b) Logical diagram of demux
RESOURCES REQUIRED
PROCEDURE
1. To start Simulink, you must start the MATLAB first
2. Now open the Simulink, by clicking on Simulink Icon
3. To create a new model, click the New Model button on the Library Browser’s toolbar.
4. To create the model, you need to drag and drop required blocks into the model from
the following Simulink block libraries:
Sources library (the Sine Wave block)
Sinks library (the Scope block).
Logical design block
5. Construct the model as shown in figure with blocks and links to connect them.
6. Select the switches to switch between 0 and 1 to set the value of input(Ds) and select
lines(S0, S1).
7. Verify the truth table from the output obtained in the display.
4:1 Multiplexer
1:4 Demultiplexer
OUTPUT
4:1 Multiplexer
1:4 Demultiplexer
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
PROBLEM STATEMENT – TO BE SOLVED BY STUDENT
1. Create a Simulink model of a 4:1 multiplexer using two 2:1 multiplexers.
2. Create a Simulink model of a 8:1 multiplexer using basic gates.
demultiplexer?
2. What are the key advantages of using a multiplexer in digital circuits? Provide at least
three advantages.
3. Discuss the practical applications of multiplexers and demultiplexers in real-world
scenarios or industries.
4. How does a multiplexer differ from a decoder? Discuss their functionalities and
provide examples where each would be more suitable.
REFERENCES
Sl. Text
Autho
No Book/ Publication
r
. Website
https://youtu.be/FGWsievcnEw
Web https://www.gyaanibuddy.com/assignments/assignment-detail/41-
multiplexer-1-4-de-multiplexer/
1 referenc
https://www.tutorialspoint.com/digital_circuits/digital_circuits_demul
es tiplexers.htm
https://www.electronicshub.org/multiplexer-and-demultiplexer/
ASSESSMENT SCHEME
Performance indicators Weightage
Process related (27 marks) 60%
1 Coding ability 20%
2 Debugging ability 30%
3 Follow ethical practices 10%
Product related (18 marks) 40%
1 Relevance of output of the problem definition. 20%
2 Timely Submission of report, Answer to sample questions. 20%
Total (37.5 marks) 100%
PRACTICAL SIGNIFICANCE
Implementing flip-flops using MATLAB holds practical significance in digital circuit
design and analysis. Firstly, MATLAB provides a platform for simulating and verifying flip-
flop behavior, aiding engineers in understanding and optimizing sequential logic circuits.
Secondly, it facilitates the exploration of different flip-flop configurations and their impact on
system performance, allowing for efficient design iterations. Thirdly, MATLAB enables the
visualization of timing diagrams and waveforms, aiding in the identification and resolution of
potential timing issues in flip-flop-based designs. Lastly, the use of MATLAB in flip-flop
implementation accelerates the development process, reducing prototyping time and
contributing to the overall efficiency of digital system design.
RELEVANT PROGRAM OUTCOMES(POS)
PO1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools
and appropriate technique to conduct standard tests and measurements.
PO7. Lifelong Learning: Ability to analyse individual needs and engage in updating in the
context of technological changes.
COMPETENCY AND PRACTICAL SKILLS
This practical is expected to develop the following skills for the industry-identified
competency: ‘Use MATLAB for implementing various problems in engineering.”
PRACTICAL OUTCOME
Develop a model of D, T and JK Flipflop.
THEORY
JK Flipflop
The JK flip flop is one of the most used flip flops in digital circuits. The JK flip flop is a
universal flip flop having two inputs 'J' and 'K'. The only difference between JK flip flop and
SR flip flop is that when both inputs of SR flip flop is set to 1, the circuit produces the invalid
states as outputs, but in case of JK flip flop, there are no invalid states even if both 'J' and 'K'
flip flops are set to 1.
Fig 20.1 (a) JK flip flop block diagram (b) JK flip flop using NAND
When both of the inputs of JK flip flop are set to 1 and clock input is also pulse "High" then
from the SET state to a RESET state, the circuit will be toggled. The JK flip flop work as a T-
type toggle flip flop when both of its inputs are set to 1.
The JK flip flop is an improved clocked SR flip flop. But it still suffers from the "race"
problem. This problem occurs when the state of the output Q is changed before the clock
input's timing pulse has time to go "Off". We have to keep short timing plus period (T) for
avoiding this period. Fig 20.2 Truth table for JK flip flop.
D Flip Flop
T flipflop
RESOURCES REQUIRED
PROCEDURE
1. To start Simulink, you must start the MATLAB first
2. Now open the Simulink, by clicking on Simulink Icon
3. To create a new model, click the New Model button on the Library Browser’s toolbar.
4. To create the model, you need to drag and drop required blocks into the model from
the following Simulink block libraries:
Sources library (the Sine Wave block)
Sinks library (the Scope block).
Logical design block
5. Construct the model as shown in figure with blocks and links to connect them.
6. Select the switches to switch between 0 and 1 to set the value of inputs.
7. Verify the truth table from the output obtained in the display.
OUTPUT
JK flip flop
J K Qn Qn+1
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
D flip flop
D Qn Qn+1
0 0 0
0 1 0
1 0 1
1 1 1
T flip flop
T Qn Qn+1
0 0 0
0 1 1
1 0 1
1 1 0
RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
INTERPRETATION OF RESULTS
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
CONCLUSION
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
REFERENCES
Sl. Text
Autho
No Book/ Publication
r
. Website
Web https://www.geeksforgeeks.org/flip-flop-types-their-conversion-and-
applications/
1 referenc
https://www.tutorialspoint.com/digital_circuits/digital_circuits_flip_f
es lops.htm
ASSESSMENT SCHEME
Performance indicators Weightage
Process related (27 marks) 60%
1 Coding ability 20%
2 Debugging ability 30%
3 Follow ethical practices 10%
Product related (18 marks) 40%
1 Relevance of output of the problem definition. 20%
2 Timely Submission of report, Answer to sample questions. 20%
Total (37.5 marks) 100%