Uploaded by mishalsayed2000

Exp 2

advertisement
Experiment 2
American International University- Bangladesh
Department of Electrical and Electronic Engineering
EEE1234: Power Systems Analysis Laboratory
Title: Introduction to SIMULINK
Introduction:
SIMULINK is a software package developed by MathWorks Inc. which is one of the most
widely used software in academia and industry for modeling and simulating dynamical
systems. It can be used for modeling linear and nonlinear systems, either in continuous
time frame or sampled time frame or even a hybrid of the two. It provides a very easy
drag-drop type Graphical user interface to build the models in block diagram form. It has
many built-in block-libraries components that you can use to model complex systems. If
these built-in models are not enough for you, SIMULINK allows you to have user defined
blocks as well.
Theory and Methodology:
You can start SIMULINK by simply clicking the simulink icon in the tools bar or by typing
Simulink in front of the MATLAB command prompt >>. This opens up SIMULINK’s library
browser, which should look similar to the one shown in Fig.1. There may be other tool boxes
depending upon the license you have, The plus sign that you see in the right half of the window
indicates that there are more blocks available under the icon clicking on the (+) sign will expand
the library. Now for building up a new model click on. File and select New Model. A blank model
window is opened. Now all you have to do is to select the block in the SIMULINK library browser
and drop it on your model window. Then connect them together and run the simulation.
Fig 1: SIMULINK’s Library Browser
© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB)
1
Software Requirement:

Matlab/ Simulink (2013)
Experimental Procedure:
Let us try to simulate a simple model where we take a sinusoidal input, integrate it and observe
the output. The steps are outlined as below.
1. Click on the Sources in the SIMULINK library browser window.
2. You are able to see various sources that SIMULINK provides. Scroll down and you will see a
Sine Wave sources icon.
3. Click on this sources icon and without releasing the mouse button drag and drop it in your
model window which is currently named as 'untitled'.
4. If you double-click on this source, you will be able to see Block parameters for sine wave
which includes amplitude, frequency, phase, etc. Let not change these parameters right now. So
click on cancel to go back. Similarly click on continuous library icon. You can now see various
built-in blocks such as derivative, integrator, transfer-function, state-space etc. Select integrator
block and drag-drop it in your model window.Now click on sinks and drag-drop scope block into
your model. This is one of the most common blocks used for displaying the values of the
blocks.
7. Now join output of sine-wave source to input of Integrator block. This can ' be done in two
ways. Either you click the left button and drag mouse from output of sine-wave source to input of
Integrator block and leave left button or otherwise click on right button and drag the mouse to
form connection from input of integrator block to output of sine,wave source.
8. Now in the main menu, click on Simulation and click Start. The simulation runs and stops
after the time specified by giving ready prompt at bottom left corner.
9. Now double-click on scope to see the output. Is something wrong? The result is a sine wave of
magnitude 2. Is there something wrong with SIMULINK software?
No, we have in fact forgotten to specify the integration constant!
Integration of sin θ is - cos θ + C. At θ =0, C = - 1. If we do not specify any initial condition for
output of the integrator, simulink assumes it to be 0 and calculates the constant. So it calculates
- cos θ + C = 0 at r = 0 giving C = 1. So the equation for output becomes - cos θ + l. Thus
naturally, it starts from 0 at t = 0 and reaches its peak value of 2 at θ = π, i.e. 3.I4.
10. To rectify this error. double click on Integrator block and in the initial conditions enter - 1
which should be the output of the block at t = 0. Now run the simulation again and see for
yourself that the result is correct.
Simulation:
Compare the simulation results with your calculated data.
Discussion and Conclusion:
Interpret the data/findings and determine the extent to which the experiment was successful
in complying with the goal that was initially set. Discuss any mistake you might have made
while conducting the investigation and describe ways the study could have been improved.
Reference(s):
[1] Kothari, D P, and I J Nagrath. Modern Power System Analysis. 3rd ed. New Delhi: Tata
McGraw-Hill, 2009. Print.
© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB)
2
Download