Top Banner
The Class — Overview The Class... Introduction Application Math 541 - Numerical Analysis Lecture Notes – Introduction to Numerical Analysis Joseph M. Mahaffy, h[email protected]i Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research Center San Diego State University San Diego, CA 92182-7720 http://jmahaffy.sdsu.edu Spring 2018 Joseph M. Mahaffy, h[email protected]i Lecture Notes – Introduction to Numerical Ana — (1/21)
21

Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

Mar 10, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Math 541 - Numerical AnalysisLecture Notes – Introduction to Numerical Analysis

Joseph M. Mahaffy,〈[email protected]

Department of Mathematics and StatisticsDynamical Systems Group

Computational Sciences Research Center

San Diego State UniversitySan Diego, CA 92182-7720

http://jmahaffy.sdsu.edu

Spring 2018

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (1/21)

Page 2: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Outline

1 The Class — OverviewContact Information, Office HoursText & TopicsOther Numerical Analysis CoursesGradingExpectations and Procedures

2 The Class...MatLabFormal Prerequisites

3 IntroductionThe What? Why? and How?

4 ApplicationAnalysis

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (2/21)

Page 3: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Contact Information, Office HoursText & TopicsOther Numerical Analysis CoursesGradingExpectations and Procedures

Contact Information

Professor Joseph Mahaffy

Office GMCS-593

Email [email protected]

Web http://jmahaffy.sdsu.edu

Phone (619)594-3743

Office Hours MW: 12:00-13:50 in MLCand by appointment

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (3/21)

Page 4: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Contact Information, Office HoursText & TopicsOther Numerical Analysis CoursesGradingExpectations and Procedures

Basic Information: Text/Topics

Text:Cleve Moler: Numerical Computing in Matlab

1 Mathematical Preliminaries – Taylor’s series

2 MatLab Basics

3 Error Analysis

4 Zeros of Functions

5 Numerical Integration – Quadrature

6 Numerical Linear Algebra

7 Interpolation – Splines

8 Least Squares

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (4/21)

Page 5: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Contact Information, Office HoursText & TopicsOther Numerical Analysis CoursesGradingExpectations and Procedures

Other Numerical Analysis Courses

Math 542: Numerical Solutions of DifferentialEquations

Initial-Value Problems for ODEsBoundary Value Problems for ODEs

Math 543: Numerical Matrix Analysis

Iterative Techniques in Matrix AlgebraApproximating Eigenvalues

Math 693A: Advanced Numerical Analysis (NumericalOptimization)

Numerical Solution of Nonlinear Systems of Equations

Math 693B: Advanced Numerical Analysis (Numericsfor PDEs)

Numerical Solution of PDEs

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (5/21)

Page 6: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Contact Information, Office HoursText & TopicsOther Numerical Analysis CoursesGradingExpectations and Procedures

Basic Information: Grading

Approximate GradingHomework, including WeBWorK∗ 45%Lab Report+ 5%Exams and Final× 50%

∗ Both theoretical and implementation (programming) —MatLab will be the primary programming language.

+ Formal Lab Reports will be written on several appliedproblems.

× Likely to be 2 Midterms and Final with part being Take-home. Final: Monday, May 7, 10:30 – 12:30.

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (6/21)

Page 7: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Contact Information, Office HoursText & TopicsOther Numerical Analysis CoursesGradingExpectations and Procedures

Expectations and Procedures, I

Most class attendance is OPTIONAL — Homework andannouncements will be posted on the class web page.If/when you attend class:

Please be on time.

Please pay attention.

Please turn off mobile phones.

Please be courteous to other students and the instructor.

Abide by university statutes, and all applicable local, state,and federal laws.

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (7/21)

Page 8: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Contact Information, Office HoursText & TopicsOther Numerical Analysis CoursesGradingExpectations and Procedures

Expectations and Procedures, II

Please, turn in assignments on time. (The instructorreserves the right not to accept late assignments.)The instructor will make special arrangements for studentswith documented learning disabilities and will try to makeaccommodations for other unforeseen circumstances, e.g.illness, personal/family crises, etc. in a way that is fair toall students enrolled in the class. Please contact theinstructor EARLY regarding special circumstances.

Students are expected and encouraged to ask questionsin class!Students are expected and encouraged to to make use ofoffice hours! If you cannot make it to the scheduled officehours: contact the instructor to schedule an appointment!

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (8/21)

Page 9: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Contact Information, Office HoursText & TopicsOther Numerical Analysis CoursesGradingExpectations and Procedures

Expectations and Procedures, III

Missed midterm exams: Don’t miss exams! The instructorreserves the right to schedule make-up exams, make suchexams oral presentation, and/or base the grade solely onother work (including the final exam).

Missed final exam: Don’t miss the final! Contact theinstructor ASAP or a grade of incomplete or F will beassigned.

Academic honesty: Submit your own work. Anycheating will be reported to University authorities and aZERO will be given for that HW assignment or Exam.

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (9/21)

Page 10: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

MatLabFormal Prerequisites

MatLab

Students can obtain MatLab from ROHAN AcademicComputing.

Google SDSU MatLab or access http://www-rohan.sdsu.edu/∼download/matlab.html.

MatLab and Maple can also be accessed in theComputer Labs GMCS 421, 422, and 425.

You may also want to consider buying the student versionof MatLab: http://www.mathworks.com/

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (10/21)

Page 11: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

MatLabFormal Prerequisites

Math 541: Formal Prerequisites

Math 254 or Math 342A or AE 280

These courses all have sections on basic Linear Algebraand assume knowledge of Calculus (especially Taylor’sTheorem)

CS 107 or Math 242

These courses introduce basic Computer Programming

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (11/21)

Page 12: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

The What? Why? and How?

Math 541: Introduction — What we will learn

1 Numerical tools for problem solving

2 How to translate mathematical problems into MatLab code

3 Error and convergence analysis

Computational mathematics has errorsMust understand sources of errors and improvement ofalgorithms

4 How to implement Calculus on computers: Solve f(x) = 0,Integration, ...

5 Use MatLab to solve problems in Linear Algebra

6 Work with data: Fitting with splines and least squares best fits

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (12/21)

Page 13: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

The What? Why? and How?

Math 541: Introduction — Why???

Q: Why are numerical methods needed?

A: To accurately approximate the solutions of problems that cannotbe solved exactly.

Q: What kind of applications can benefit from numerical studies?

A: Engineering, physics, chemistry, computer, biological and socialsciences.

Image processing / computer vision, computer graphics (render-ing, animation), climate modeling, weather predictions, “virtual”crash-testing of cars, medical imaging (CT = Computed Tomogra-phy), AIDS research (virus decay vs. medication), financial math...

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (13/21)

Page 14: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

The What? Why? and How?

Math 541: Introduction — Computing Efficiency

Numerical tools for problem solving:

Computers are getting faster, but the computer’s speed isonly one (a big one for sure!) part of the overallperformance for a computation...

Computing speed depends on FLOPS (floating-pointoperations or number of additions and multiplications) andmemory accesses. These are largely questions ofcomputer architecture and won’t be examined in this coursemuch.

Numerical Algorithms are the center of this course, andtheir efficiency affects performance.

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (14/21)

Page 15: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Analysis

Research Problem from my Work

Genetic Control by Repression

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (15/21)

Page 16: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Analysis

Model for Conrol by Repression

x1(t) is the concentration of mRNA

x2(t) is the concentration of the tryptophan (endproduct)

Endproduct inhibition or a negative feedbacksystem can result in oscillatory behavior

System of first order delay differential equations (DDE):

dx1(t)

dt=

a1

1 + kxn2 (t−R)− b1x1(t)

dx2(t)

dt= a2x1(t)− b2x2(t)

Solve numerically, such as MatLab’s dde23.m delaydifferential equation solver

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (16/21)

Page 17: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Analysis

Simulation of Repression Model

With a1 = 2, a2 = b1 = b2 = 1, n = 4, and R = 2, the model issimulated using MatLab’s dde23.m

0 2 4 6 8 10 12 14 16 18 201

1.1

1.2

1.3

1.4

1.5

1.6

1.7

1.8

t

Represion Model

mRNATryptophan

Math 542 studies the Runge-Kutta-Felberg method for numericallyintegrating ordinary differential equations, a related method

MatLab code available from Website.

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (17/21)

Page 18: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Analysis

Equilibrium Analysis

Qualitative analysis of a differential equation begins by findingall equilibria

Equilibria solve the derivatives equal to zero

a11 + kx̄n2

− b1x̄1 = 0

a2x̄1 − b2x̄2 = 0

This is a system of nonlinear equations equal to zero

This easily reduces to a nonlinear scalar equation,

a11 + kx̄n2

− b1b2a2

x̄2 = 0 with x̄1 =b2a2x̄2

This course numerically solves f(x) = 0

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (18/21)

Page 19: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Analysis

Characteristic Equation

The characteristic equation is used to study the local (linear)behavior near an equilibrium.

The characteristic equation for a DDE is found like ODEs (Math537), but the result is an exponential polynomial with an infinitenumber of solutions:∣∣∣∣ −b1 − λ f ′(x̄2)e−λR

a2 −b2 − λ

∣∣∣∣ = 0

This produces:

(λ+ b1)(λ+ b2)− a2f ′(x̄2)e−λR = 0

Need to find complex solutions to this equation

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (19/21)

Page 20: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Analysis

Characteristic Equation–Finding Eigenvalues

The numerical simulation showed damped oscillations, whichsuggests that all eigenvalues have negative real part.

The characteristic equation is studied by letting λ = µ+ iν,which gives

(µ+ iν+ b1)(µ+ iν+ b2)−a2f ′(x̄2)e−µR(cos(νR)− i sin(νR)) = 0

This is solved numerically by simultaneously finding the real andimaginary parts equal to zero

Solving two nonlinear equations in two unknowns uses vectorand matrix methods to extend our technique for solving f(x) = 0

We may get to these algorithms in this class, but they certainlyappear in Math 693A

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (20/21)

Page 21: Math 541 - Numerical Analysis - Lecture Notes Introduction to … · 2018-01-16 · MatLab Formal Prerequisites Math 541: Formal Prerequisites Math 254 or Math 342A or AE 280 These

The Class — OverviewThe Class...

IntroductionApplication

Analysis

Characteristic Equation–Numerical Eigenvalues

This course examines some of the basics behind the packages forsolving these problems

MatLab allows users to examine the coding algorithm, soknowledge from this course helps you better choose amongdifferent packages.

We employed Maple’s fsolve routine, and the first three pairs ofeigenvalues with the largest imaginary parts are found:

λ1,2 = −0.19423± 0.98036i

λ3,4 = −0.55573± 3.9550i

λ5,6 = −0.68084± 7.07985i

These eigenvalues show the damped oscillatory behavior andindicate the intervals between maxima are about 2π time units.

Maple code available from Website.

Joseph M. Mahaffy, 〈[email protected]〉Lecture Notes – Introduction to Numerical Analysis— (21/21)