Back to Prof. Calhoun's Homepage

Scientific Computing with Matlab (Math 365)


In this course, we will learn how to use Matlab to solve problems in science and engineernig using computational methods. We learn basic numerical methods, including solving linear systems, interpolation, quadrature rules, and solving ordinary differential equations. We also learn about visualizing output using Matlab graphing tools, programming concepts, and how to develop numerically efficient codes. This course does not assume any prior programming knowledge, although if you don't have any programming experience, you will find this course to be challenging intially.

Send me an e-mail

Please send me an e-mail at donnacalhoun@boisestate.edu so that I can compile an e-mail list for the class. At the very least, include a subject header that says "Math 365". You may leave the message area blank, if you wish, or send me a short note about what you hope to get out of this course.


Basic course information

Instructor Prof. Donna Calhoun
Time Monday/Wednesday 12:00-1:15 (Sec 001) and 1:30-2:45 (Section 002)
Place MG136 (Math Computing Lab)
Office Hours Monday 3PM-4:30PM or by appointment
Prerequesites Math 333 or Math 301

Return to top of page


Recommended and suggested textbooks

Return to top of page


Lectures

Below are the slides from lecture material that I can make available online.

Week #1 (Jan. 11)
Monday --  Introduction to Scientific Computing; Arithmetic expressions
Lecture slides :
Introduction to the Scientific Computing  (pdf)
Using Matlab as a Scientific Calculator  (pdf)
In class lab :
Arithmetic expressions and elementary functions
Wednesday --  Assigning Variables; Tips for doing Homework #0
Videos :

Tips on homework #0
In class lab :
Assigning variables and creating anonymous function handles
1d plotting in Matlab

Week #2 (Jan. 18)
Monday --  Martin Luther King Day (no class)
Videos :

Matlab as a graphing calculator (Part III)
Wednesday --  One dimensional arrays in Matlab
Codes written or demonstrated in class :
triangle_demo.m
triangle.png
Videos :

One dimensional arrays

Arithmetic expressions involving arrays
In class lab :
One dimensional arrays
The for-loop and vectorization

Week #3 (1/25)
Monday --  1d Arrays - continued
In class lab :
The 'dot' operator : Arithmetic expressions involving arrays
Wednesday --  Quiz #1; 1d arrays (continued)

Week #4 (Feb. 1)
Monday --  Two dimensional arrays; Simple linear systems
In class lab :
Two dimensional arrays
Wednesday --  Solving linear systems; A circuit problem
Lecture slides :
Numerical Linear Algebra in Science and Engineering  (pdf)
Introduction to Linear Algebra  (pdf)
In class lab :
Introduction to matrices and linear algebra
In class lab :
Solving linear systems

Week #5 (Feb. 8)
Monday --  Gaussian Elimination and the cost of a linear solve
Lecture slides :
The cost of Gaussian Elimination  (pdf)
Wednesday --  Floating point arithmetic
Some useful or interesting links
Excellent (and entertaining) discussion of IEEE binary arithmetic (Numerical Computing with IEEE Floating Point Arithmetic)
In class lab :
Floating point arithmetic

Week #6 (Feb. 15)
Monday --  President's Birthday (no class)
Wednesday --  Floating point arithmetic (cont); Polynomial interpolation
Codes written or demonstrated in class :
convert2bin.m

Week #7 (Feb. 22)
Monday --  Vandermonde Matrix System
Lecture slides :
Vandermonde matrix system  (pdf)
In class lab :
Vandermonde Matrix System for polynomial interpolation
Wednesday --  Vectors norms and numerical conditioning
Lecture slides :
Numerical conditioning of linear systems  (pdf)

Week #8 (Feb. 29)
Monday --  Lagrange polynomial interpolation
Lecture slides :
Lagrange polynomial interpolation  (pdf)
Videos :

Polynomial interpolation and Lagrange Polynomials
In class lab :
Lagrange Polynomials
Wednesday --  The Barycentric Formula
Lecture slides :
The Barycentric Formula  (pdf)
Videos :

The Barycentric formula

Week #9 (Mar. 7)
Monday --  Curve fitting
Lecture slides :
Fitting curves to data  (pdf)
Wednesday --  Linear regression and least squares fitting
Lecture slides :
Linear regression (linear least squares)  (pdf)

Week #10 (Mar. 14)
Monday --  Piecewise polynomial interpolation
Lecture slides :
Piecewise Polynomial Interpolation  (pdf)
Codes written or demonstrated in class :
linear_pp_demo1.m
linear_pp_demo2.m
In class lab :
Piecewise polynomial interpolation
Wednesday --  Splines, continued.
Lecture slides :
Geometry of curves and motion  (pdf)
Codes written or demonstrated in class :
make_cubic_pp.m

Week #11 (Mar. 28)
Monday --  Geometry of curves and motion (cont.)
Wednesday --  Newton's method and Fractals

Week #12 (Apr. 4)
Monday --  Root-finding using Brent's Algorithm; fzero
Codes written or demonstrated in class :
bisect_demo.m
secant_demo.m
newton_demo.m
Wednesday --  Quiz #3; Minimization
Codes written or demonstrated in class :
mickey_xy.dat

Week #13 (Apr. 11)
Monday --  No class; Read section 6.2 on quadrature rules
Wednesday --  Quadrature Rules

Week #14 (Apr. 18)
Monday --  Quadrature rules (cont.)
Wednesday --  Solving differential equations using ODE45
Codes written or demonstrated in class :
greenhouse_demo.m
ode_demo2.m

Week #15 (Apr. 25)
Monday --  Solving differential equations
Wednesday --  Solving ordinary differential equations

Return to top of page


Homework assignments

Homework projects are officially due on the Wednesday due date at 5PM, but will be accepted until Friday 5PM, without a late penalty. A penalty of 10% will be incurred for every two days your homework is beyond the final Friday deadline. You'll turn in your homeworks in your assigned Dropbox folders. Please read the Homework Tips before turning in your homework!

Homework #0

Due Jan. 18

Assignment :
hmwk0.pdf
Other resources :
hmwk0_sample.pdf  -- Use this as an example of how to format your homework
hmwk0.m  -- This is a template to get you started.
heights.dat
write_file.m  -- Use this file when ever you are asked to write your solutions to a file.
Comments : Your goal with this assignment is to reproduce the solutions given in hmwk0_sample.pdf. To learn more about the Matlab Publish command, do a 'help publish' in Matlab.

Homework #1

Due Jan. 27

Assignment :
hmwk1.pdf
Other resources :
hmwk1_template.m
o1.dat
o2.dat
o3.dat
o4.dat
o5.dat
write_file.m  -- Write out solutions in the homework with this file
WA-NES-J1M4_Okanogan_Complex_8-23-2015_2333.kml  -- Open this file in Google Earth to see the perimeter of the Okanogan Complex fire
Updates to homework :
 --  (1/24) Added homework template file 'hmwk1_template.m'
 --  (1/25) Added "Construct anonymous function T(x,a)" to problem 1b
 --  (1/27) Fixed homework template file. Problem numbers are now correct.
Some useful or interesting links
You can download more fire perimeter files from this site. (Look for the small Google Earth icon, near the right side bar for perimeter files from different days.) (InciWeb - Incident Information System)
Comments : For these problems, you will write output files using the script "write_file"

Homework #2

Due Feb. 10

Assignment :
hmwk2.pdf
Other resources :
Chapter2-part.pdf  -- Section from Chapter 2 of Strang's Linear Algebra and its Applications
Updates to homework :
 --  (2/3) Problem #2 : Removed factor of 1/2 in model of flame

Homework #3

Due Feb. 24

Assignment :
hmwk3.pdf
Other resources :
H2Odensity.dat
Updates to homework :
 --  (2/20) Problem #3 : Clarify problem; You should create two separate plots
 --  (2/20) Problem #4 : Changed problem 4; You will see the original problem on the next homework!
 --  (2/22) Prob. #2 : Added plot.

Homework #4

Due Mar. 9

Assignment :
hmwk4.pdf

Homework #5

Due April 6th

Assignment :
hmwk5.pdf
Other resources :
dq1.dat
dq2.dat
rollercoaster.dat
snow.dat
fractals.m
Some useful or interesting links
An article about the history of the inverse square function in computer graphics and video games (Origin of Quake3's Fast InvSqrt())
A nice description of how Julia sets are generated (Julia Jewels: An exploration of Julia sets)
Wikipedia entry on generating Newton Fractals (Newton Fractals)

Homework #6

Due Apr. 27

Assignment :
hmwk6.pdf
Other resources :
plot_shapes.m
plot_msh.m
msh.region
Updates to homework :
 --  (4/18) Modified problem #3 slightly - only find 3 extrema, not four. Fixed typo in problem 4.

Return to top of page


Matlab Tutorials

An online tutorial for this course, including all of the in-class labs can be found at the link below

Matlab Tutorial

Return to top of page


Final Project

In lieu of a final, you will have a final project due, on the day of our scheduled exam.

Other resources :
final_project.pdf  -- Final project description

You can find the Final Exam calendar here.

Return to top of page


Grading policy

Homework projects will count for 75% of your final grade, quizzes will count towards 10% of your grade, and the final project will be 15% of your final grade. All homeworks will be equally weighted.

Return to top of page