You are on page 1of 20

Computer Programming for Engineers

Trust The Computer.


The Computer is Your Friend.
Computer Credo,
from the computer game Paranoia
ENCMP
100 Computers –

are everywhere

2
Introduction ©2011 by ECE, UofA
ENCMP
100 Computers – Obvious Places
• Personal computers, hand calculators, Personal Data
Assistants (PDAs), smart phones, game systems
used by us to perform variety of tasks related to work and
entertainment

• Mainframe computers:
used by large organizations to host the centralized databases and
enterprise software

• Transaction computers:
used by on-line banks, stock markets, air reservation systems,
lottery networks, etc.

• Embedded computers:
used – almost everywhere – to control systems without necessarily
interacting directly with humans through a conventional keyboard
and/or display
3
Introduction ©2011 by ECE, UofA
ENCMP
100 Computers – not-so Obvious Places
• Appliances (TV & DVD, microwave, washer & dryer …)
• Communications equipment, cell phones
• Navigation systems (e.g., Global Positioning System)
• Cars, trucks, trains, aircrafts, submersibles, spacecrafts
• Medical equipment, measurement & monitoring devices
• Factories, production lines, machinery
• Just about every modern engineering system is
controlled by one or more embedded computers and/or
computers with conventional user interfaces (BMW 740i
sedan has over 100 computers).

4
Introduction ©2011 by ECE, UofA
ENCMP
100 Computers – Applications and Benefits

• Faster and larger-scale numerical computation; large-


scale information collection, storage, processing, and
distribution; accurate modeling and simulation of
systems
• Programmable control of machines and systems to
achieve increased flexibility and higher efficiency
• High-speed Internet; enhanced education; employment
at a distance and telecommuting; digital publishing,
multimedia, and entertainment; altered and (hopefully)
enhanced social interaction; enhanced communication
and trade among cultures

5
Introduction ©2011 by ECE, UofA
ENCMP
100 Computers – Hardware & Software

• Hardware refers to the tangible enclosures, power


supplies, cooling system, wiring, electronics, etc. that
make up a computer.

• Software refers to the program data that is stored in the


memory of a computer. Programs are made up of
instructions and (possibly) embedded constant data.

6
Introduction ©2011 by ECE, UofA
ENCMP
100 Programming Languages

• It is possible for humans to write a program using the


computer's "native" binary machine language in binary
(0's and 1's) format. However, this is almost always
impractical because humans make too many errors
and are not productive producing long sequences of
0's and 1's.
• Computer programming languages are textual
notations that allow programs to be expressed in a
much more convenient "human-friendly" format.

7
Introduction ©2011 by ECE, UofA
ENCMP
100
Programming Languages
continuous development

• In 1954 John Backus invented the first high-


level programming language, FORTRAN
(FORmula TRANslation) at IBM Corp.
• In 1993, he was awarded the U.S. National
Academy of Engineering's Charles Stark
Draper Prize, the highest prize awarded in
engineering, for the invention of FORTRAN.

• Many different programming languages have been developed


since ‘50s. They satisfy needs of different users, they are also
tuned to variety of applications.
• Some of popular programming languages are: Visual Basic,
C/C++, C#, Java, Ruby, Python.

8
Introduction ©2011 by ECE, UofA
ENCMP
100 Computers – What They Do?

They are useful, omnipresent, are composed of


hardware and software – but what they really do?

1. get data
2. process data
3. output processed data

9
Introduction ©2011 by ECE, UofA
ENCMP
100 ENCMP 100 – Reason

• Computer and computer-based systems are used to:


• analyze and process data of any type and origin
• design, analyze and simulate variety of systems
• control engineering processes

• Computers and computer-based systems …


should do what YOU what them to do

10
Introduction ©2011 by ECE, UofA
ENCMP
100 ENCMP 100 – Goal

• It is important that ALL OF YOU gain an understanding


of the capabilities of computer technology as well as
challenges of software design.
• In your engineering careers you will need to design,
modify or at least use computer programs to perform
variety of tasks.
• Many of you will have careers specialized in computer-
related or -based technologies, or will use computers in
your profession: there is no industry without computers

11
Introduction ©2011 by ECE, UofA
ENCMP
100 ENCMP 100 and MATLAB

• In ENCMP 100 we will be using the MATLAB (MATrix


LABoratory) programming language.

• In the early 1980s Cleve Moler developed a


software system for numerical calculations at
the University of New Mexico.
• In 1984 he co-founded MathWorks Inc. to
commercialize MATLAB (MATrix LABoratory).
• MATLAB's capabilities have been extended to
include a large number of specialized
"toolboxes" as well as the SIMULINK product.

12
Introduction ©2011 by ECE, UofA
ENCMP
100 MATLAB
• MATLAB is a high-level language and interactive
environment that enables you to perform
computationally intensive tasks faster than with
traditional programming languages such as C, C++,
and Fortran. It allows you to quickly validate your
ideas and concepts.
• TOOLBOXES are collections of routines implementing
algorithms for specific technical tasks, for example,
image processing, optimization, statistics,
• SIMULINK is an environment for multi-domain
simulation and Model-Based Design for dynamic and
embedded systems.

13
Introduction ©2011 by ECE, UofA
ENCMP
100 MATLAB

14
Introduction ©2011 by ECE, UofA
ENCMP
100 MATLAB – Applications

• Technical Computing
• Control Systems
• Digital Signal Processing
• Communications Systems
• Image and Video Processing
• Test and Measurement
• Computational Biology
• Computational Finance

and more…

15
Introduction ©2011 by ECE, UofA
ENCMP
100 MATLAB – Testimonials

We get more data than we can possibly sift through. MATLAB is


our workhorse for viewing, sharing, and processing that data.
Skip Essma, Toyota Racing Development

MATLAB is far and away the best development environment with


just the right combination of power and ease of use for engineering
and scientific applications.
Dave Cogdell, Timken Research

More testimonials:
www.mathworks.com/products/matlab/userstories.html?by=industry

16
Introduction ©2011 by ECE, UofA
ENCMP
100 MATLAB – Advantages
• Easy to use: simple interpreted language, similar to
Basic
• Platform independence: supported on many
different compute systems
• Predefined functions: extensive libraries of
functions implementing variety of algorithms
• Device-Independent Plotting: many integral
plotting and imaging commands
• Graphical User Interface: tools for constructing GUI
• MATLAB Compiler: compilation of a MATLAB
program into a stand-alone executable
17
Introduction ©2011 by ECE, UofA
ENCMP
100
MATLAB – Advantages
Example: Data Visualization

Demo:
www.mathworks.com/videos/matlab/visualizing-data.html

18
Introduction ©2011 by ECE, UofA
ENCMP
100 MATLAB – Disadvantages

• It is an interpreted language and therefore can


execute more slowly then compiled languages – can
be mitigated by properly structuring MATLAB
programs, and by the use of a compiler
• A full copy of MATLAB is more expensive than a
conventional C or Fortran compiler

19
Introduction ©2011 by ECE, UofA
ENCMP
100 ENCMP 100 – You will:
• Learn how to apply top-down design methodology to
develop software, and in particular
• Learn about different data types

• Learn how to use different flow control constructs

• Learn how to design and develop your own functions

• Gain familiarity with the capabilities of MATLAB, and


learn how to use MATLAB’s to construct your own
programs starting with data input via data processing to
data visualization

20
Introduction ©2011 by ECE, UofA

You might also like