# ENGR 11: PROGRAMMING & PROBLEM-SOLVING IN MATLAB

## Foothill College Course Outline of Record

Foothill College Course Outline of Record
Units: 5
Hours: 4 lecture, 3 laboratory per week (84 total per quarter)
Prerequisite: MATH 1B or 1BH.
Advisory: Demonstrated proficiency in English by placement via multiple measures OR through an equivalent placement process OR completion of ESLL 125 & ESLL 249.
Degree & Credit Status: Degree-Applicable Credit Course
Foothill GE: Non-GE
Transferable: CSU/UC
Repeatability: Not Repeatable

## Student Learning Outcomes

• Students who successfully complete this course should be able to write programs using Matlab to implement problem solving algorithms.
• Students who successfully complete this course should be able to demonstrate knowledge and skills about numerical methods.

## Description

This course utilizes the MATLAB environment to provide students with a working knowledge of computer-based problem-solving methods relevant to science and engineering. It introduces the fundamentals of procedural and object-oriented programming, numerical analysis, and data structures. Examples and assignments in the course are drawn from practical applications in engineering, physics, and mathematics.

## Course Objectives

The student will be able to:
A. recall and apply basic computer environment and basic algorithm flows.
B. describe types of error caused by computations.
C. use basic numerical methods to find roots of equations.
D. do basic manipulations on matrices and solve systems of equations using matrices.
E. sort a list of data.
F. fit selected models to dataset.
G. numerically differentiate and integrate.
H. solve basic ordinary differential equations numerically.
I. apply different methods to solve simple optimization problems.
J. simulate random variables.
K. apply a top-down design methodology to develop computer algorithms.
L. create, test, and debug sequential MATLAB programs, as well as programs that use object-oriented techniques, in order to achieve computational objectives.

## Course Content

A. Basics
1. Overview of computer systems and the MATLAB environment
2. Floating point formats
3. Variables, expressions, and order of operation
4. Elementary functions
5. Pseudo-code, flowcharts, and documentation
6. Formatted input and output
7. Selection programming structures (IF, ELSE)
8. Repetition programming structures (FOR, WHILE)
9. User-defined functions
B. Modeling, Computers, and Error Analysis
1. Mathematical modeling and engineering problem solving
2. Programming and software
3. Precision and accuracy
a. Approximations and round-off errors
b. Absolute and relative error
c. Truncation errors
d. Significant digits
C. Roots of Equations
1. Bisection methods
a. Bracketing a root
b. Accuracy and speed
2. Fixed-point theorem
a. Fixed point of a function
b. Geometry of a fixed point iteration
c. Linear convergence and stopping criteria
3. Newton's Method
4. Plotting
D. Linear Algebraic Equations
1. Matrix algebra
2. Gaussian elimination
a. Operation count
3. LU decomposition and matrix inversion
a. Matrix form of Gaussian elimination
b. Back substitution
c. Complexity
E. Sorting
1. Bubble sort
2. Straight Insertion and Shell's Method
3. Quicksort and heapsort
F. Curve Fitting
1. Least-squares regression
a. Inconsistent system
b. Fitting models to data
c. Conditioning of least square
2. Cubic spline interpolation
a. Properties of splines
b. End point conditions
3. Taylor polynomials
a. Error analysis
4. Fast Fourier transform
a. Orthogonality and interpolation
b. Least square fitting with trigonometric functions
5. Error analysis
6. Plotting
G. Numerical Differentiation and Integration
1. Differentiation
a. Forward divided-difference formulae
b. Centered divided-difference formulae
c. Backward divided-difference formulae
2. Integration
a. Newton-Cotes integration formulas
b. Trapezoidal rule
c. Simpson's rule
3. Error analysis
H. Ordinary Differential Equations
1. Theory of initial-value problems
a. Euler's Method
b. Runge-Kutta Methods
c. Stability region
2. Theory of boundary-value problems
a. Linear Shooting Methods
b. Finite Difference Method
3. Higher Order ODE
a. Solve as system
4. Error analysis
I. Optimization (Optional)
1. Linear programming
2. Simplex Method
3. Duality Method
J. Random Numbers and Applications
1. Random digits and random numbers
2. Pseudorandom numbers
3. Monte Carlos Method
4. Brownian motion
5. Applications of random walks

## Lab Content

A. Finding Roots of Equations, Linear Programming (Optimization)
1. Designing an algorithm to find roots
2. Implementing the plan using MATLAB
3. Including comments in the program
4. Checking for reasonableness
5. Debugging the program
B. Solving Linear Algebraic Equations
1. Designing an algorithm to solve linear algebraic equations
2. Implementing the plan using MATLAB
3. Including comments in the program
4. Checking for reasonableness
5. Debugging the program
C. Curve Fitting
1. Designing an algorithm for curve fitting
2. Implementing the plan using MATLAB
3. Including comments in the program
4. Checking for reasonableness
5. Debugging the program
D. Numerical Integration and Differentiation
1. Designing an algorithm for integration and differentiation
2. Implementing the plan using MATLAB
3. Including comments in the program
4. Checking for reasonableness
5. Debugging the program
E. Solving Ordinary Differential Equations
1. Designing an algorithm for solving ordinary differential equations
2. Implementing the plan using MATLAB
3. Including comments in the program
4. Checking for reasonableness
5. Debugging the program

## Special Facilities and/or Equipment

A. A graphing calculator (e.g., TI-83 or TI-84) is recommended, but not required.
B. A lecture room with computers.
C. Projector equipment and instructor computer.
D. MATLAB software.

## Method(s) of Evaluation

Methods of Evaluation may include but are not limited to the following:

A. Midterm(s)
B. Quizzes
C. Project/oral presentation and written report
D. Homework assignments
E. Lab assignments
F. One comprehensive final exam

## Method(s) of Instruction

Methods of Instruction may include but are not limited to the following:

A. Lecture
B. Laboratory
C. Demonstration

## Representative Text(s) and Other Materials

Attaway, S. MATLAB: A Practical Introduction to Programming and Problem Solving. 5th ed. Waltham, MA: Butterworth-Heinamann, 2018.
Chapman, S. MATLAB Programming for Engineers. 6th ed. Cengage, 2019.
Gilat, A. MATLAB: An Introduction with Applications. 6th ed. Wiley, 2016.
Hahn B., and D. Valentine. Essential MALTAB for Engineers and Scientists. 7th ed. Academic Press, 2019.

## Types and/or Examples of Required Reading, Writing, and Outside of Class Assignments

A. Required reading from sections of the textbook
B. Written homework from the textbook
C. Written reports on laboratory assignments
D. Written and oral report on project

## Discipline(s)

Engineering, Mathematics