ENGINEERING PROJECT

Matlab/Simulink Program

11:47 PM

APPLICATION PROGRAMMING INTERFACE (API)

Posted by Shahrul

M-File

M-files are normal text files written in MATLAB programming language. The file is called an M-file because of its file extension of ‘.m’ . It allows the user to write a series of codes into a file and execute them with a single command. The file can be created using the MATLAB editor or another text editor. There are two types of M-files, script files and function files, which will be discussed in the following section.

Scripts File

The scripts files are the simplest kind of M-file which contains a set of valid MATLAB commands. The file does not have any input or output arguments and any variables that they create remain in the workspace, to be used in subsequent computations. It can be executed by typing the name of the script file excluding the file extension. It has the same effect of typing all the individual commands stored in the script file at the command line. Script files work on global variables. Therefore it can operate on existing data in the workspace, or they can create new data on which to operate.

Functions Files

Functions are M- files that can accept input arguments and return output arguments. The name of the M-file and of the function should be the same. Functions operate on variables within their own workspace, separate from the workspace you access at the MATLAB command prompt.

Electric machines play an important role in industry as well as our day to day life. They are used to generate electrical power in power plants and provide mechanical work in industries. They are also an indispensable part of our daily lives. Electric machines are very important pieces of equipment in our everyday lives. The DC machine is considered to be basic electric machines.

The aim of this final year project is to introduce students to the modeling of power components and to use computer simulation as a tool for conducting transient and control studies. Simulation can be very helpful in gaining insights to the dynamic behavior and interactions that are often not readily apparent from reading theory. Simulation is often chosen by engineers to study transient and control performance or to test conceptual designs.

MATLAB/SIMULINK is used because of the short learning curve that most students require to start using it, its wide distribution, and its general purpose of nature. This will demonstrate the advantages of using MATLAB for analyzing power system steady-state behavior and its capabilities for simulating transients in power systems and power electronics, including control system dynamic behavior