0% found this document useful (0 votes)
71 views

Matlab Basic and Application To Smart Grid: Dr. Atma Ram Gupta Gunjesh Tahiliani (2014306) Rohit Ray (32014315)

MATLAB is a software program used for technical computing. It can be used for tasks like data analysis, algorithm development, modeling and simulation. The document discusses some basic MATLAB commands and applications in analyzing smart grid systems, including load flow analysis, FFT analysis, computing transmission line parameters, and measuring states and outputs of models. MATLAB allows importing and exporting data, performing calculations, and generating plots and graphs to understand power networks.

Uploaded by

Rohit Roy
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Matlab Basic and Application To Smart Grid: Dr. Atma Ram Gupta Gunjesh Tahiliani (2014306) Rohit Ray (32014315)

MATLAB is a software program used for technical computing. It can be used for tasks like data analysis, algorithm development, modeling and simulation. The document discusses some basic MATLAB commands and applications in analyzing smart grid systems, including load flow analysis, FFT analysis, computing transmission line parameters, and measuring states and outputs of models. MATLAB allows importing and exporting data, performing calculations, and generating plots and graphs to understand power networks.

Uploaded by

Rohit Roy
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26

MATLAB Basic And

Application To Smart
Grid

Dr. Atma Ram Gupta

Gunjesh Tahiliani (2014306)


Rohit Ray(32014315)
Introduction
• MATLAB is a computer program that combines computation and visualization power to understand
network

• MATLAB Stands for MATrix LABoratory.

• The MATLAB allows


• manage variables
• import and export data
• perform calculations
• generate plots
• develop and manage files for use with MATLAB.
• Advantages of MATLAB
• Ease of use
• Platform independence
• Predefined functions
• Plotting

• Disadvantages of MATLAB
• Can be slow
• Commercial software
Typical uses
• Math and computation

• Algorithm development

• Modeling, simulation, and prototyping

• Data analysis, exploration, and visualization

• Scientific and engineering graphics


Display Windows
• Command Window: Enter all commands here

• Workspace Window: Shows the list of variable used

• Command History Window: Shows the command history

• Current Directory Window: Displays current working directory

• Graphic (Figure) Window


• Displays plots and graphs
• Created in response to graphics commands.

• M-file editor/debugger window


• Create and edit scripts of commands called M-files.
Types of Files
1. M-Files
2. MAT-Files
3. MEX-Files

Two kinds of M-files:

Scripts, which do not accept input arguments or return output arguments.


They operate on data in the workspace.

Functions, which can accept input arguments and return output arguments.
Internal variables are local to the function.
Commands

• General Commands
• Clock :Provides clock time and data as a vector
• Date :Provides data as a string
• Ver :Gives the version of MATLAB installed

• Workspace Commands
• Who :Lists the variables currently in the worksapce
• Whos :Same as who but ges more information sach as type and size
etc
• What :Lists .m, .mat and .mex files on the disk
• Clear :To clear workspace variables
• Clc :To clear command windows
• Clf :To clear current figure window
Basic Commands

 % used to denote a comment


 ; suppresses display of value (when placed at end of a statement)
 ... continues the statement on next line
 eps machine epsilon
 clear all – clear workspace vars.
 close all – close all figures
 clc – clear screen
 clf – clear figure
Matrix Addressing

 v = [-2 3 0 4.5 -1.5]; % length 5 row vector.

 v = v’; % transposes v.

 v(1); % first element of v.

 v(2:4); % entries 2-4 of v.

 v([3,5]); % returns entries 3 & 5.

 v=[4:-1:2]; % same as v=[4 3 2];

 a=1:3; b=2:3; c=[a b];  c = [1 2 3 2 3];


 x = linspace(-pi,pi,10); % creates 10 linearly-spaced elements from –pi to pi.

 logspace is similar.

 A = [1 2 3; 4 5 6]; % creates 2x3 matrix

 A(1,2) % the element in row 1, column 2.

 A(:,2) % the second column.

 A(2,:) % the second row.

 length(v) % determine length of vector.

 size(A) % determine size of matrix.

 rank(A) % determine rank of matrix


Matrix Operations

• Addition +
• Subtraction -
• Multiplicatio x
n ^
• Power `
• Transpose \
• Left Division /
• Right
division
For loops

 x = 0;
for i=1:2:5 % start at 1, increment by 2
x = x+i; % end with 5.
end

This computes x = 0+1+3+5=9.


While loops

 x=7;
while (x > = 0)
x = x-2;
end;

This computes x = 7-2-2-2-2 = -1.


If statements

 if (x == 3)
disp(‘The value of x is 3.’);
elseif (x == 5)
disp(‘The value of x is 5.’);
else
disp(‘The value of x is not 3 or 5.’);
end;
Application of MATLAB in

Smart Grid
Load-Flow Analyzer

The Load-Flow Analyzer app performs a load-flow, or power-flow, analysis for a


three-phase AC electrical power transmission system

MATLAB Command Window: To prepare to perform a power-flow analysis on the


current model, which is the open model that you most recently interacted with, enter
ee_loadFlowApp.

 The Load-Flow Analyzer app allows you to:


 Run a load-flow analysis.
 Highlight and update load-flow input block parameter values for busbar, load flow
source, synchronous machine, induction machine, and three-phase load blocks.
 Change the bus type of load flow source, synchronous machine, and induction
machine blocks.
 The app generates two tables.
 One of the tables contains data for the network nodes, as represented by
busbar, load flow source, synchronous machine, induction machine, and
three-phase load blocks.
 The other table contains data for the network connections, as represented by
transmission line and transformer blocks
FFT Analyzer
 The FFT Analyzer app allows you to perform Fourier analysis of simulation
data and provides access to all the simulation data that are defined as
structure-with-time variables in your workspace.
 The app displays the spectrum as a bar graph or as a list in percentages
relative to a base value or to the DC component of the signal.
Power Line Parameters

 Power Line Parameters app provides a tool to compute the RLC line


parameters of the Distributed Parameters Line and PI Section Line blocks and
the frequency-dependent parameters of a Distributed Parameters Line block.

 MATLAB command prompt: Enter powerLineParameters


Specify Decoupling Lines

 Replace selected Distributed Parameters Line blocks with Decoupling


Line blocks

 MATLAB command prompt: Enter DecouplingLineReplace(model name)


Measurements and States Analyzer

 The Measurements and States Analyzer app computes the initial states and


steady-state values of the inductor currents and capacitor voltages (electrical
state variables), and the steady-state voltages and currents of measurement
blocks, sources, and nonlinear blocks in a model.

 MATLAB command prompt: Enter powerStates(‘name of model')


Libraries for smart grid
Blocks in MATLAB
Thank You!!!

You might also like