TopicsThe textbook definitions and theorems

Edwards-Penney 3.1, 3.2, 3.3 (3.0 K, txt, 18 Dec 2013)

Edwards-Penney 3.4, 3.5, 3.6 (4.0 K, txt, 18 Dec 2013)

Numerical Solution of y'=f(x,y)Two problems will be studied. First problem y' = -2xy, y(0)=2 Symbolic solution y = 2 exp(-x^2) Second problem y' = (1/2)(y-1)^2, y(0)=2 Symbolic solution y = (x-4)/(x-2) MAPLE TUTOR for NUMERICAL METHODS # y'=-2xy, y(0)=2, by Euler, Heun, RK4 with(Student[NumericalAnalysis]): InitialValueProblemTutor(diff(y(x),x)=-2*x*y(x),y(0)=2,x=0.5); # The tutor compares exact and numerical solutions. ==> Left off here last Friday, will complete the lecture on MondayExamplesWeb references contain two kinds of examples. The first three are quadrature problems dy/dx=F(x). y'=3x^2-1, y(0)=2, solution y=x^3-x+2 y'=exp(x^2), y(0)=2, solution y=2+int(exp(t^2),t=0..x). y'=2x+1, y(0)=3 with solution y=x^2+x+3. The fourth is of the form dy/dx=f(x,y), which requires a non-quadrature algorithm like Euler, Heun, RK4. y'=1-x-y, y(0)=3, solution y=2-x+exp(-x).WORKED EXAMPLEy'=1-x-y, y(0)=3, solution y=2-x+exp(-x). We will make a dot table by hand and also by machine. The handwritten work for the Euler Method and the Improved Euler Method [Heun's Method] are available:: Handwritten example y'=1-x-y, y(0)=3, Euler and Heun (427.8 K, jpg, 16 Dec 2012) The basic reference isJpeg: Numerical methods (149.7 K, pdf, 26 Jan 2014) Numerical maple and matlab resources for Euler, Heun, RK4 are located in theSlides

Directory Here (0.0 K, 09 Feb 2015)EULER METHODLet f(x,y)=1-x-y, the right side of the differential equation. Use step size h=0.2 from x=0 to x=0.4. The dot table has 3 rows. Table row 1: x0=0, y0=3 Taken from initial condition y(0)=3 Table row 2: x1=0.2, y1=2.6 Compute from x1=x0+h, y1=y0+hf(x0,y0)=3+0.2(1-0-3) Table row 3: x2=0.4, y2=2.24 Compute from x2=x1+h, y2=y1+hf(x1,y1)=2.6+0.2(1-0.2-2.6) MAPLE EULER: [0, 3], [.2, 2.6], [.4, 2.24]HEUN METHODLet f(x,y)=1-x-y, the right side of the differential equation. Use step size h=0.2 from x=0 to x=0.4. The dot table has 3 rows. Table row 1: x0=0, y0=3 Taken from initial condition y(0)=3 Table row 2: x1=0.2, y1=2.62 Compute from x1=x0+h, tmp=y0+hf(x0,y0)=2.6, y1=y0+h(f(x0,y0)+f(x1,tmp))/2=2.62 Table row 3: x2=0.4, y2=2.2724 Compute from x2=x1+h, tmp=y1+hf(x1,y1)=2.62+0.2*(1-0.2-2.62) y2=y1+h(f(x1,y1)+f(x2,tmp))/2=2.2724 MAPLE HEUN: [0, 3], [.2, 2.62], [.4, 2.2724]RK4 METHODLet f(x,y)=1-x-y, the right side of the differential equation. Use step size h=0.2 from x=0 to x=0.4. The dot table has 3 rows. The only Honorable way to solve RK4 problems is with a calculator or computer. A handwritten solution proceeds like this Table row 1: x0=0, y0=3 Taken from initial condition y(0)=3 FIRST DOT = [0,3] Table row 2: x1=0.2, y1=2.618733333 Compute from x1=x0+h, 5 lines of RK4 code: k1=h*f(x0,y0)=0.2*f(0,3)=0.2*(1-0-3)=-0.4 k2=h*f(x0+h/2,y0+k1/2)=0.2*f(0.1,3-0.4)=-0.3800000000 k3=h*f(x0+h/2,y0+k2/2)=0.2*f(0.1,3-0.38)=-0.3820000000 k4=h*f(x0+h,y0+k3)=0.2*f(0.2,3-0.382)=-0.3636000000 y1=y0+(1/6)*(k1+2*k2+2*k3+k4)=2.618733333 0.2 2.618733333 MAPLE RK4: [0, 3], [.2, 2.618733333] Table row 3: x2=0.4, y2=2.270324271 Compute from x2=x1+h, 5 lines of RK4 code MAPLE RK4: [0, 3], [.2, 2.618733333], [.4, 2.270324271]EXACT SOLUTIONWe solve the linear differential equation y'=1-x-y by the integrating factor method to obtain y=2-x+exp(-x). # MAPLE evaluation of y=2-x+exp(-x), the exact solution. F:=x->2-x+exp(-x);[0.0,F(0.0)],[0.2,F(0.2)],[0.4,F(0.4)]; # Answer [[0., 3.], [0.2, 2.618730753], [0.4, 2.270320046]]COMPARISON GRAPHICThe three results for Euler, Heun, RK4 are compared to the exact solution y=2-x+exp(-x) in the: y'=1-x-y Compare Euler-Heun-RK4 (17.8 K, jpg, 10 Dec 2012) The comparison graphic was created with thisGRAPHIC: y'=1-x-y by Euler-Heun-RK4 (1.1 K, txt, 10 Dec 2012)MAPLE TEXT

Third lecture on numerical methods. RK4 details.Theory for RK4 How Simpson's Rule provides RK4, using Predictors and Correctors. Why we don't read the proof of RK4. Numerical project example y'=-2xy, y(0)=2. Handwritten example for y'=1-x-y, y(0)=3 References for numerical methods:: Numerical methods (149.7 K, pdf, 26 Jan 2014)Slides: Numerical methods y'=F(x) and y'=f(x,y) (659.1 K, pdf, 29 Nov 2014)Manuscript: Numerical methods RECT, TRAP, SIMP for y'=F(x) (305.2 K, pdf, 23 Jan 2014)Manuscript: Numerical methods to compute Pi, ln2 and e (205.9 K, pdf, 26 Jan 2014)Manuscript: Jules Verne problem, skydiving, lunar lander (278.2 K, pdf, 01 Jan 2015)Manuscript: Jules Verne problem and escape velocity (124.2 K, pdf, 01 Jan 2015)Slides: Numerical DE in matlab m-file from Professor W. Nesse (3.1 K, m, 28 Jan 2014)Matlab: Ejected baggage nonlinear drag example, numerical DE from Professor Gustafson (0.8 K, mpl, 28 Jan 2014)Maple

How to use maple at home (7.3 K, txt, 05 Dec 2012): Handwritten example y'=1-x-y, y(0)=3, for Euler and Heun methods (427.8 K, jpg, 16 Dec 2012)Jpeg

Linear Algebraic Equations sections 3.1, 3.2Frame sequence defined. Theater 35mm movies project at 30framesper second.

A 35mm filmstrip (7.0 K, jpg, 11 Dec 2012) Streaming video provider NetFlix usesframesto make a filmstrip, each frame an image thumbnail of a DVD cover.

A NetFlix Wii filmstrip (19.5 K, jpg, 11 Dec 2012) Solutions to linear algebra problems can use a similar filmstrip scheme, with the NetFlix DVD cover replaced by an image of a completed solution step, called aframe.

A filmstrip of 3 solution steps, called a frame sequence (68.3 K, pdf, 12 Dec 2012) Aframe sequencerecords the steps needed to solve a system of equations. The steps are determined by a basic set of operations on equations (the Toolkit). Toolkit: combination, swap, multiply Briefly: combo, swap, mult Plane and space geometry: the meaning of simultaneous equations The three possibilities Unique solution No solution Infinitely many solutions Method of eliminationExample: unique solution x=-1, y=1 x + 2y = 1 x - y = -2Example: no solution x + 2y = 1 x + 2y = 2Example: infinitely many solutions, parametric form of a line x=1-2t, y=t x + 2y = 1 0 = 0 References:: Intro Linear Equations, Toolkit, 3 Possibilities, Matrices (237.3 K, pdf, 14 Dec 2012)Slides: Unique solution case (110.1 K, pdf, 13 Dec 2012)Slides: No solution case (79.7 K, pdf, 03 Mar 2012)Slides: Infinitely many solutions case (131.1 K, pdf, 03 Mar 2012)Slides: Linear algebraic equations, no matrices (429.7 K, pdf, 30 Jan 2014) Parameters in the general solution Calculus: Parametric equation of a line or a plane. Differential equations example, problem 3.1-26 y'' -121y = 0, y(0)=44, y'(0)=22 General solution given: y=A exp(11 x) + B exp(-11 x) Substitute y into y(0)=44, y'(0)=22 to obtain a 2x2 system for unknowns A,B that has the unique solution A=23, B=21.ManuscriptPrepare 3.1 problems for next collection.See problem notes section 3.1:: Problem notes S2015 (2.8 K, html, 01 Jan 2015)htmlMore References: Ch3 Page 149+, Exercises 3.1 to 3.6 (869.6 K, pdf, 25 Sep 2003)Transparencies: 3x3 Frame sequence and general solution (315.9 K, jpg, 12 Dec 2012)Transparency

Lecture: 3.1, 3.2, 3.3TopicsFrame sequence Toolkit: combo, swap, multiply [EP 3.2] Plane and space geometry The three possibilities [EP 3.1] Unique solution No solution Infinitely many solutionsDefinitionsLead variable Free variable Signal equation Echelon form [EP 3.2] The last frame test [EP 3.3] The last frame algorithm [EP 3.2] A detailed account of the three possibilities Unique solution == zero free variables No solution == signal equation Infinitely many solutions == one+ free variablesHow to solve a linear systemToolkit: swap, combo, mult Toolkit operations neither create nor destroy solutions! Frame sequence examples Computer algebra systems and error-free frame sequences. How to use maple to make a frame sequence without errors.: Utah Maple Tutorial (2.1 K, html, 30 Jan 2016)HelpSolved ProblemsExample 4 in 3.2A:=Matrix([ [1,-2,3,2, 1], [0, 0,1,0, 2], [0, 0,0,1,-4]]); b:=<10,-3,7>; linalg[linsolve](A,b); x1 - 2x2 + 3x3 + 2x4 + x5 = 10, x3 + 2x5 = -3, x4 - 4x5 = 7 ==> A is upper triangular; system is upper triangular ==> Solve by 3.2 Algorithm Back Substitution. Back-substitution.Warning: The naming convention in the textbook [EP 3.2] differs from a substantial number of references.

Remarks on back-substitution (1.4 K, txt, 13 Dec 2012) Back-Substitution, be it the textbook algorithm or another, should be presented as combo operations in frames. Please avoid isolated, incomplete algebraic gibberish.

A gibberish example (1.2 K, txt, 12 Dec 2012)DEFINITIONTheleading variablein a equation is the first variable, in variable list order, with a nonzero coefficient.DEFINITIONA frame isechelonprovided (1) Each nonzero equation has a leading variable different from all other equations. (2) All variables preceding a leading variable, in variable list order, are absent from all following equations.DEFINITIONIn anEchelon Systemthepivotsare the coefficients of the leading variables, in turn calledpivot variables.MATLAB EXPERTS Back-Substitution ExampleAssume U is an nxm echelon (upper triangular) matrix with nonzero diagonal entries U(i,i). Can you decode the following back substitution algorithm for Ux=b, written in Matlab syntax? n = length(b); x = zeros(n,1); for i=n:-1:1 x(i) = (b(i)-U(i,:)*x)/U(i,i); end NON-EXPERTS. The answer is expressed in terms of dot-products, a COMBO operation.Problem 3.2-24The book's answer is wrong, it should involve k-4. See references on 3 possibilities with symbol k.: 3 possibilities with symbol k (60.0 K, pdf, 31 Jan 2010)Beamer slides: 3 possibilities with symbol k (98.8 K, pdf, 03 Mar 2012)Slides: Examples 11, 12 in Linear algebraic equations no matrices (429.7 K, pdf, 30 Jan 2014)Answer checks should use the online FAQ.Manuscript: Problem notes S2015 (2.8 K, html, 01 Jan 2015)?> In solved problems submitted for grading, please use frames to display the solution, as in lecture examples. Expected is a sequence of augmented matrices. Maple may be used to make the frames. A maple last frame answer check is linalg[rref](A). Browse the Linear Algebra help in the on-line tutorial:html: Utah Maple Tutorial (2.1 K, html, 30 Jan 2016)HelpReferences for this lecture.: Intro Linear Equations, Toolkit, 3 Possibilities, Matrices (237.3 K, pdf, 14 Dec 2012)Slides: Unique solution case (110.1 K, pdf, 13 Dec 2012)Slides: No solution case (79.7 K, pdf, 03 Mar 2012)Slides: Infinitely many solutions case (131.1 K, pdf, 03 Mar 2012)Slides: Linear algebraic equations, no matrices (429.7 K, pdf, 30 Jan 2014)Manuscript

TopicsThe textbook definitions and theorems

Edwards-Penney 3.1, 3.2, 3.3 (3.0 K, txt, 18 Dec 2013)

Edwards-Penney 3.4, 3.5, 3.6 (4.0 K, txt, 18 Dec 2013)Project: Switch from equations to matrices, which is the interface for a computer algebra system [Maple, Mathematica, MuPad, Maxima] or a numerical workbench [Matlab, Scilab, Octave]. Translation of equation models [EP 3.4] Equality of vectors Scalar equations to augmented matrix Augmented matrix to scalar equations Matrix toolkit: Combo, swap and multiply Frame sequences for matrix models. Last frame test for a matrix. The RREF of a matrix. Last frame algorithm for a matrix. Scalar form of the solution. Vector form of the solution.THEOREMSin 3.3 Theorem 1. RREF is unique Theorem 2. Three possibilities Theorem 3. More variables than equations ==> infinitely many Theorem 4. Ax=0 has unique solution x=0 <==> rref(A)=I Vector add and scalar multiply: componentwise Matrix add. Matrix scalar multiply. Matrix multiplication on paper. Stopped here on Friday==> Digital photographs. Matrix add and scalar multiply. Maxwell's RGB separation. Photoshop operations and matrix algebra. How to use maple to make frame sequences. No solution example 3.1-16.: Maple frame sequence, no solution example (42.2 K, pdf, 07 Feb 2012): Maple code, frame sequence with no solution (0.6 K, mpl, 05 Feb 2016)Maple Text: Frame Sequence in maple, Exercise 3.2-14 (3.0 K, txt, 10 Feb 2012) Answer checks should use the online FAQ.Maple Text: Problem notes S2015 (2.8 K, html, 01 Jan 2015) References:html: Linear algebraic equations, no matrices (429.7 K, pdf, 30 Jan 2014)Manuscript: Intro Linear Equations, Toolkit, 3 Possibilities, Matrices (237.3 K, pdf, 14 Dec 2012)Slides: Matrix Equations (292.1 K, pdf, 07 Feb 2012)Manuscript: Matrix add, scalar multiply and matrix multiply (156.7 K, pdf, 03 Mar 2012)Slides: Digital photos, Maxwell's RGB separations, visualization of matrix add (170.2 K, pdf, 03 Mar 2012)Slides: More on digital photos, checkerboard analogy (141.9 K, pdf, 03 Mar 2012)Slides

Lab 4, Numerical methods.Sample Exam: Exam 1 key from S2013. See also S2012, exam 1.

Exams and exam keys for the last 5 years (22.2 K, html, 23 Feb 2015)

TopicsThe textbook definitions and theorems

Edwards-Penney 3.1, 3.2, 3.3 (3.0 K, txt, 18 Dec 2013)

Edwards-Penney 3.4, 3.5, 3.6 (4.0 K, txt, 18 Dec 2013) The three possibilities The Toolkit: combo, swap, mult Frame sequence Last frame test for equations. Reduced echelon system. 1. Each nonzero equation has a leading variable with leading coefficient one. 2. Zero equations are last 3. Lead variables are maintained in variable list order Last frame test for matrices. Row reduced echelon form (RREF). 1. Each nonzero row has a leading one. 2. Zero rows are last 3. Leading ones are in columns of the identity matrix, called pivot columns. These columns match the order of initial columns of the identity matrix, but final columns may be missing. Last frame algorithm 1. Apply the last frame test. Proceed only if the system passes the test. If in matrix form, then convert to a scalar system. 2. Isolate lead variables left. 3. Assign invented symbols (t1, t2, t3, ...) to the free variables. 4. Back-substitute the free variables into step 2. 5. Present the general solution as a list of variable names in variable list order, with only invented symbols on the right.Example1. The unique solution case C:=Matrix([[1,2,1,1],[1,3,1,2],[1,1,2,3]]); x + 2y + z = 1 x + 3y + z = 2 x + y + 2z = 3 Scalar form of the unique solution. Why only lead variables in the last frame? Why no free variables?Example2. The no solution case C:=Matrix([[1,2,1,1],[1,3,1,2],[2,5,2,4]]); x + 2y + z = 1 x + 3y + z = 2 2x + 5y + 2z = 4 We will find a signal equationExample3. The infinitely many solution case C:=Matrix([[1,2,1,1],[1,3,1,2],[2,5,2,3]]); x + 2y + z = 1 x + 3y + z = 2 2x + 5y + 2z = 3 Find the last frame How many free variables? Count is called the RANK. Apply the last frame algorithmExample4. The infinitely many solution case C:=Matrix([[1,2,1,1],[3,6,3,3],[0,0,0,0]]); x + 2y + z = 1 3x + 6y + 3z = 3 0 = 0 Find the last frame How many free variables? Apply the last frame algorithmExample5. The infinitely many solution case C:=Matrix([[0,0,0,0],[0,0,0,0],[0,0,0,0]]); 0 = 0 0 = 0 0 = 0 Find the last frame How many free variables? Apply the last frame algorithm The three possibilities with symbol k. x + ky = 2, (2-k)x + y = 3. Examples with symbols.: Three possibilities, theorems on infinitely many solutions, equations with symbols (129.0 K, pdf, 03 Mar 2012)Slides: 3 possibilities with symbol k (98.8 K, pdf, 03 Mar 2012)Slides: 3 possibilities with symbol k (60.0 K, pdf, 31 Jan 2010) See also Examples 11, 12 in The next reference.Beamer slides: Linear algebraic equations, no matrices (429.7 K, pdf, 30 Jan 2014)Manuscript: Intro Linear Equations, Toolkit, 3 Possibilities, Matrices (237.3 K, pdf, 14 Dec 2012)Slides: Unique solution case (110.1 K, pdf, 13 Dec 2012)Slides: No solution case (79.7 K, pdf, 03 Mar 2012)Slides: Infinitely many solutions case (131.1 K, pdf, 03 Mar 2012)Slides: Matrix Equations (292.1 K, pdf, 07 Feb 2012)Manuscript: Matrix add, scalar multiply and matrix multiply (156.7 K, pdf, 03 Mar 2012)Slides: Digital photos, Maxwell's RGB separations, visualization of matrix add (170.2 K, pdf, 03 Mar 2012)Slides: More on digital photos, checkerboard analogy (141.9 K, pdf, 03 Mar 2012)Slides: Inverse matrix, frame sequence method (97.0 K, pdf, 11 Feb 2015)Slides

Chapters 3 and 4: Last frame algorithm, Elimination, Rank, Nullity (156.3 K, pdf, 20 Dec 2012)Slides: Elementary matrix theorems (154.2 K, pdf, 11 Feb 2015)Slides: Three possibilities, theorems on infinitely many solutions, equations with symbols (129.0 K, pdf, 03 Mar 2012)Slides: Problem notes S2015 (2.8 K, html, 01 Jan 2015)html: Ch3 Page 149+, Exercises 3.1 to 3.6 (869.6 K, pdf, 25 Sep 2003)Transparencies: 3x3 Frame sequence and general solution (315.9 K, jpg, 12 Dec 2012)Transparency: Extra Credit Lab 5, Linear algebra (160.8 K, pdf, 29 Nov 2014)Maple: Vectors and Matrices (426.4 K, pdf, 07 Feb 2012)Manuscript: vector models and vector spaces (144.1 K, pdf, 03 Mar 2012)Slides: Base atom, atom, basis for linear DE (117.6 K, pdf, 03 Mar 2012)Slides: Orthogonality (124.8 K, pdf, 03 Mar 2012)Slides: Partial fraction theory (148.6 K, pdf, 14 Dec 2014)Slides: The pivot theorem and applications (189.2 K, pdf, 03 Mar 2012)Slides: Lawrence Page's pagerank algorithm (0.7 K, txt, 06 Oct 2008)Text: History of telecom companies (1.9 K, txt, 03 Apr 2013)Text: Problem notes S2015 (2.8 K, html, 01 Jan 2015)html