0% found this document useful (0 votes)
26 views16 pages

Chapter 1

Uploaded by

mohammed rasheed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views16 pages

Chapter 1

Uploaded by

mohammed rasheed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Islamic University in Al-Madinah

Electrical Engineering
Department

Chapter 1

Engr.Arshad Karimbu Vallappil


[email protected]

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
Text Book and Reference Books
Text Book:
Holly Moore, "Matlab for Engineers", 3rd Edition, Pearson, 2012.

Reference Books:
 Stephen J. Chapman, “MATLAB Programming for Engineers”, 5th Edition,
Thomson, 2015.
 Timmy Siauw and Alexandre Bayen, "An Introduction to MATLAB Programming
and Numerical Methods for Engineers”, 1st Edition, Elsevier, 2015.
 William Bober, "Introduction to Numerical and Analytical Methods with MATLAB
for Engineers and Scientists", 1st Edition, CRC Press, 2013.
 William J. Palm III, "Introduction to MATLAB for Engineers", 3rd Edition,
McGraw Hill, 2010.
 David H., “Introduction to MATLAB for Engineers”, Northwestern University
Manual, V.1.2, 2005.
 Alfio Quarteroni, Fausto Saleri, Paola Gervasio, "Scientific Computing with
MATLAB and Octave", 4th Edition, Springer, 2014.
 Todd Young and Martin J. Mohlenkamp, “Introduction to Numerical Methods and
MATLAB Programming for Engineers”, Ohio University, USA, 2014

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
Scientific computing languages

 Mathematics and computation


 Algorithm development
 Modelling, simulation, and prototyping
 Data analysis, exploration, and visualization
 Scientific and engineering graphics
 Application development, including Graphical User Interface building
Examples of scientific computing software which have similar
syntax:
1. MATLAB: non open-source software available for OSX and
Windows.
2. Octave: open-source software available for OSX, Linux and
Windows.
ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-
Canaan & Engr.Arshad
MATLAB
ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-
Canaan & Engr.Arshad
OCTAVE

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
Contents of this Chapter
In this chapter, you should be able to:
 Understand what MATLAB/OCTAVE is and why it
is widely used in engineering and science

 Understand the advantages and limitations of the


student edition of MATLAB.

 Formulate problems by using a structured


problem-solving approach (Solving using an
algorithm)

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
WHAT IS MATLAB/OCTAVE
 MATLAB and OCTAVE are two available, sophisticated
mathematical computation tools, which also include Maple,
Mathematica, and MathCad.

 Each allows you to perform basic mathematical computations.


However, they differ in the way they handle symbolic calculations
and mathematical processes, such as matrix manipulation.

 For example, MATLAB (short for Matrix Laboratory) excels at


computations involving matrices, whereas Maple excels at
symbolic calculations.

 In many engineering classes, the use of programs such as


MATLAB to perform computations is replacing more traditional
computer programming.

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
WHAT IS MATLAB/OCTAVE
 Because MATLAB/OCTAVE is so easy to use, you can perform
many programming tasks with it, but it isn’t always the best tool for
a programming task.
 It excels at numerical calculations especially matrix calculations
and graphics, but you wouldn’t want to use it to write a word-
processing program.
 For large applications, such as operating systems or design
software, C++, JAVA, or FORTRAN would be the programs of
choice. (In fact, MATLAB ® , which is a large application program,
was originally written in FORTRAN and later rewritten in C, a
precursor of C++.)
 Usually, high level programs do not offer easy access to graphing
—an application at which MATLAB excels.
 The primary area of overlap between MATLAB and high-level
programs is “number crunching”—repetitive calculations or the
processing of large quantities of data.

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
WHAT IS MATLAB/OCTAVE
 Both MATLAB and high-level programs are good at processing
numbers. A “number-crunching” program is generally easier to
write in MATLAB, but usually it will execute faster in C++ or
FORTRAN.
 The one exception to this rule is calculations involving matrices.
MATLAB is optimized for matrices. Thus, if a problem can be
formulated with a matrix solution, MATLAB executes substantially
faster than a similar program in a high-level language.
 MATLAB is available in both a professional and a student version.
 The standard installation of the professional version of MATLAB is
capable of solving a wide variety of technical problems.
 Additional capability is available in the form of function toolboxes.
 These toolboxes are purchased separately, and they may or may
not be available to you. You can find a complete list of the
MATLAB product family at The MathWorks web site,
www.mathworks.com .

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
STUDENT EDITION OF MATLAB
 The professional and student editions of MATLAB ® are very
similar. Beginning students probably won’t be able to tell the
difference. Student editions are available for Microsoft Windows,
Mac OSX, and Linux operating systems and can be purchased
from college bookstores or online from MathWorks at
www.mathworks.com .
 MathWorks packages its software in groups called releases, New
versions are released every 6 months. The release number is the
same for both the student and professional edition, but the student
version may lag the professional version by several months. The
student edition of R2011a includes the following features:
• Full MATLAB
• Simulink®, with the ability to build models with up to 1000 blocks
(the professional version allows an unlimited number of blocks)
• Symbolic Math Toolbox
• Control System Toolbox
• Signal Processing Toolbox

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
STUDENT EDITION OF MATLAB
• DSP System Toolbox
• Statistics Toolbox
• Optimization Toolbox
• Image Processing Toolbox
• Software manuals for both MATLAB and Simulink
• A CD containing the full electronic documentation
• A single-user license, limited to students for use in their classwork
(the professional version is licensed either singly or to a group)
 Toolboxes other than those included with the student edition may
be purchase separately. You should be aware that if you are using
a professional installation of MATLAB, all of the toolboxes
available in the student edition may not be available to you.
 The biggest difference you should notice between the professional
and student editions is the command prompt, which is
>>
in the professional version and
EDU>>
in the student edition.
ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-
Canaan & Engr.Arshad
HOW IS MATLAB/OCTAVE USED IN INDUSTRY?
 The ability to use tools such as MATLAB is quickly becoming a
requirement for many engineering positions. A recent job search
on Monster.com found the following advertisement:
“. . . is looking for a System Test Engineer with Avionics experience....
Responsibilities include modification of MATLAB ® scripts,
execution of Simulink® simulations, and analysis of the results
data. Candidate MUST be very familiar with MATLAB ® ,
Simulink®, and C++. . .”
 This ad isn’t unusual. The same search turned up 660 different
companies that specifically required MATLAB skills for entry-level
engineers.
 Widely used in all engineering and science fields, MATLAB is
particularly popular for electrical engineering applications.
 However, it has applications in all the branches of Engineering
including Mechanical, Civil, Industrial, Chemical, Mechatronics,
Manufacturing and list goes on and on….

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
PROBLEM SOLVING IN ENGINEERING AND SCIENCE

 A consistent approach to solving technical problems is important


throughout engineering, science, and computer programming
disciplines.
 Different authors may formulate their problem-solving schemes
differently, but they all have the same basic format:
• State the problem
❍ Drawing a picture is often helpful in this step.
❍ If you do not have a clear understanding of the problem, you are
not likely to be able to solve it.
• Describe the input values (knowns) and the required output
(unknowns).
❍ Be careful to include units as you describe the input and output
values. Sloppy handling of units often leads to wrong answers.
❍ Identify constants you may need in the calculation, such as the
ideal-gas constant and the acceleration due to gravity.
❍ If appropriate, label a sketch with the values you have identified, or
group them into a table.
ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-
Canaan & Engr.Arshad
PROBLEM SOLVING IN ENGINEERING AND SCIENCE

• Develop an algorithm to solve the problem. In computer


applications, this can often be accomplished with a hand example.
You’ll need to
❍ Identify any equations relating the knowns and unknowns.
❍ Work through a simplified version of the problem by hand or with a
calculator.
• Solve the problem. In this book, this step involves creating a MATLAB
solution.
• Test the solution
❍ Do your results make sense physically?
❍ Do they match your sample calculations?
❍ Is your answer really what was asked for?
❍ Graphs are often useful ways to check your calculations for
reasonableness.
• If you consistently use a structured problem solving approach, you’ll
find that “story” problems become much easier to solve.

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
Solution using an m-file script:

Header (important description / comments)


Output window

ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-


Canaan & Engr.Arshad
End of Chapter 1:

‫ﺟﺰاﻛﻢ اﻟﻠﻪ‬
‫ﺧﻴﺮا‬

.. ‫اﻷﺳﺌﻠﺔ‬
.
ENGR 203, by Dr. Mohsin Jamil, updated by Dr. Amer Al-
Canaan & Engr.Arshad

You might also like