200 likes | 385 Views
University Of Khartoum Electrical and Electronic Engineering Control and Instrumentation Departments. Control laboratory 1. Principals of Automatic Control Laboratory. Story time!!. Problem: too many variables!. THUS.
E N D
University Of Khartoum Electrical and Electronic Engineering Control and Instrumentation Departments Control laboratory 1 Principals of Automatic Control Laboratory
Story time!! Problem: too many variables!
THUS.. Automatic (feedback) Control System: an interconnection of components forming a system configuration that will provide a desired system response: Regulate/ servo
MATLAB is relatively easy to learn Why MATLAB? • MATLAB may behave like a calculator or as a programming language • MATLAB is interpreted, errors are easier to fix • Although primarily procedural, MATLAB does have some object-oriented elements
Basics! • Scalar: >>a = 4 • • Vector: >>v = [3 5 1] • >>v(2) = 8 • >>t = [0:0.1:5] • • Matrix: >>m = [1 2 ; 3 4] • >>m(1,2)=0 • More: >>b = 10 / ( sqrt(a) + 3 )
Plots! • x = [0:0.01:2*pi]; • y = cos(x); • plot(x,y)
m. files • Programming in Matlab is done by creating “.m” files. • Useful for storing a sequence of commands or creating new functions. • Call the program by writing the name of the file where it is saved (check the “current directory”) • “%” can be used for commenting.
Scripts and Functions • M-file can contain two types of code : script or function is called Intro MATLAB
Simulink • Simulink: is a graphical, “drag and drop” environment used to model, analyze and simulate dynamic systems using block diagrams. Library of elements
Thank you! You can get this material from: www.taaeaa.blog.com