Introduction to ODEs in Matlab. Jeremy L. Marzuola Charles Talbot Benjamin Wilson

Size: px
Start display at page:

Download "Introduction to ODEs in Matlab. Jeremy L. Marzuola Charles Talbot Benjamin Wilson"

Transcription

1 Introduction to ODEs in Matlab Jeremy L. Marzuola Charles Talbot Benjamin Wilson address: Department of Mathematics, UNC-Chapel Hill, CB#3250 Phillips Hall, Chapel Hill, NC USA address: Department of Mathematics, UNC-Chapel Hill, CB#3250 Phillips Hall, Chapel Hill, NC USA address: Department of Mathematics, UNC-Chapel Hill, CB#3250 Phillips Hall, Chapel Hill, NC USA

2 Abstract. An Introduction to ODEs using Matlab developed to enhance modeling and computational skills in the First Course in Differential Equations at the University of North Carolina.

3 Dedication This book is dedicated to Ingrid and Virginia, whose sleeplessness during the night assisted in writing many a chapter. Also, special thanks to Moshe Feldman, Dylan Gooch, Julia Sampson, Aric Wheeler, Yaoxuan Xia, Zhongcheng Xiao and Xiaohan Yi for being willing to stick with the course in its first iteration, pointing out where things could be clarified in early versions of the problem sets and working so hard in the Fall of 2014 to get as much from the first Lab course as possible. The Environmental Engineering worksheet was co-developed with Marc Alperin from Marine Sciences at UNC and we are grateful that he participated and created such an interesting model application. Special thanks to Katie Newhall and Greg Forest for looking over early versions and giving helpful comments. This course was also taken on as part of JLM s NSF Career Grant DMS

4

5

6 Contents Chapter 1. Introduction 1 Chapter 2. Week Introduction to Matlab 3 2. Worksheet 1 3 Chapter 3. Week Variables, Matrices, Vectors 5 2. Worksheet 2 5 Chapter 4. Week Solving Linear Systems in Matlab, Introduction to Functions in Matlab 7 2. Worksheet 7 Chapter 5. Week Functions, Slope Fields, Converting Higher Order Differential Equations to Systems of First Order Differential Equations 9 2. Worksheet 9 Chapter 6. Week Discussion Topics Worksheet 11 Chapter 7. Week Discussion Topics Worksheet 15 Chapter 8. Week Discussion Topics Worksheet 19 Chapter 9. Week Discussion Topics Worksheet 23 Chapter 10. Week Discussion Topics Worksheet 25 Chapter 11. Week Discussion Topics Worksheet 27 vii

7 viii CONTENTS Chapter 12. Week Discussion Topics Worksheet 29 Chapter 13. Week Discussion Topics Worksheet 31 Chapter 14. Week Discussion Topics Worksheet 35 Chapter 15. Week Discussion Topics Worksheet 39

8 CHAPTER 1 Introduction The goal for this class will be to learn how to approximate solutions to equations (or systems of equations) of the form y = f(x, y), y(0) = 0. (1) Many solutions can be found by looking at an equation such as this by integrating it out and using the initial condition y(x) = y(0) + x 0 f(z, y(z))dz. (2) This looks like we have not gained much, but as we will see, with a little linear algebra we will see that we have gained quite a lot. To approximate solutions of this form, we will learn some basic algorithms and implement them in Matlab. Throughout, you are welcome work on implementing similar codes in other languages that are good for computation, such as Fortran, Python or C++ if you are interested. 1

9

10 CHAPTER 2 Week 1 1. Introduction to Matlab 2. Worksheet 1 1. Download Matlab!! Play with the help function to learn some of its key features. 2. Check out the tutorials from [?] to get a sense of some of the implicit Matlab capabilities. 3

11

12 CHAPTER 3 Week 2 1. Variables, Matrices, Vectors Introduction to variables and allocation in Matlab, Matrices, Vectors 2. Worksheet 2 1. Scalar variables in Matlab. (use implicit Matlab components like e, exp, 1i, sqrt, real, conj, log). a. Create x = b. Create y = c. Create z = e iπ/4. d. Evaluate and display ( x + y 1/4 ) π. e. Evaluate and display log(z z). 2. Vector variables in Matlab. (use implicit Matlab components like linspace,.,., 1i, pi, plot). Do not simply type all numbers into a vector in the editor. a. Create the row vector x =.1[ ]. b. Create and display the 5 1 column vector y = c. Create and display the 1 9 row vector z = [ e iπ e i3π/4 e iπ/2 e iπ/4 e 0 e iπ/4 e iπ/2 e i3π/4 e iπ]. d. Create the vector with pointwise components b = 1 2π e x/2. e. Plot b versus x. 3. Matrices. Make the following matrix variables in Matlab (use implicit Matlab components like linspace, ones, zeros, diag, rand, floor, ceil). Do not simply type all numbers into a matrix in the editor a. Create and display M 1 =....., a 5 5 matrix of all 1 s

13 6 3. WEEK 2 b. Create and display M 2 =....., a matrix with non-zero entries only on the diagonal. [ ] c. Create and display M 3 = d. Create and display M 4, a 2 2 matrix with random values between 2 and 2. e. Create and display M 5, the 4 4 matrix [ ] M M 5 = 3 M 4 M 4

14 CHAPTER 4 Week 3 1. Solving Linear Systems in Matlab, Introduction to Functions in Matlab Matrices, Vectors, Gaussian Elimination, Solving Linear Systems in Matlab, Introduction to Functions in Matlab 2. Worksheet 1. Systems of equations. We will see how to use Matlab to solve the following linear system of equations. 5x 1 + 2x 2 + 3x 3 = 0 x 1 2x 2 + x 3 = 2 x 1 + x 2 x 3 = 1 In Matlab, use the operation A\b with A = the coefficient matrix and b = the right hand side. Create and display the solution vector x 1 x = x 2. x 3 By hand, verify that the output solves the system of equations (you do not need to turn this in). 2. Solve the following linear systems of equations. Display the unique solution if one exists. If no solution exists display the phrase No solution exists and display the least squares solution. If more than one solution exists display the phrase Infinitely many solutions. (Use implicit Matlab components like \, lsqr, rref). You do not need to use an if statement. 7

15 8 4. WEEK 3 a. b. c. 5x 1 + 2x 2 + 3x 3 = 1 x 1 2x 2 + x 3 = 2 x 1 + x 2 x 3 = 1 x 1 + 2x 2 = 1 2x 1 4x 2 = 2 5x 1 + 2x 2 + 3x 3 = 1 x 1 2x 2 + x 3 = 2 4x 1 + 4x 2 + 2x 3 = 1 3. Functions. Write the following functions. (Each should be in its own file. Use implicit Matlab components like exp, sqrt, log, tanh, factorial, abs). a. f 1 (x) = x 2 e x2. b. f 2 (x) = tanh(x) 1+x 2. c. f 3 (x) = x x3 3!. d. For g = 1.0, L = 1.0, 1 e. f 5 (x) =. x log x 2 [ f 4 (t, v, h) = v g L sin(h) ]. 4. Perform the following tasks using the functions from problem 3. a. Evaluate and display f 1 (1). b. Evaluate and display f 2 (0). c. Evaluate and display f 3 (2). d. Evaluate and display f 4 (1, 2, π). e. Plot the curve y = f 5 (x) on the set x [2, 10]. Make the curve a red, dashed line, label the axes x and f 5 (x), and title the plot Week 3 Plot.

16 CHAPTER 5 Week 4 1. Functions, Slope Fields, Converting Higher Order Differential Equations to Systems of First Order Differential Equations Making functions in Matlab, Plotting slope fields in Matlab, Solving first order differential equations, converting second order differential equations into a system of first order differential equations 2. Worksheet 1. Anonymous functions. Create anonymous Matlab functions for the given maps. a. Write the function g 1 assuming one inputs the components of the input vector (x 1, x 2, x 3 ). g 1 : R 3 R 3 such that g 1 x 1 x 2 x 3 = sin(x 1 x 2 ) x 3 e 2x1 x x x 2 3. Evaluate and display g 1 (1, 1, 2). b. Write the function g 1 assuming one inputs a vector x R 3. such that g 2 ( x) = g 2 : R 3 R 3 sin(x 1 x 2 ) x 3 e 2x1 x x x 2 3. Create and display the vector x = (1, 1, 2). Evaluate and display g 2 ( x). 2. Write the functions g 1 and g 2 from question 1 in their own separate function files g1.m and g2.m and submit them with your assignment. 3. Direction fields. Solve the following differential equation by hand. dy dx = 2y. 9

17 10 5. WEEK 4 a. Use Matlab to make a direction field for the given differential equation. Let x [ 3, 3] and y [ 3, 3]. (Use Matlab components like meshgrid and quiver). b. On the same plot as your direction field plot three solution curves for the initial conditions y(0) = 1, y(0) = 0, and y(0) = 1. Label the plots. (Use Matlab components like hold on, plot, axis, and legend). 4. Complete the same exercises as problem 3 for the differential equation dy dx = x + y. 5. Built-in ODE solvers. Matlab ODE solvers allow one to solve equations of the form y = f(t, y), y(t 0 ) = y 0 (3) by giving the function f(t, y) as input. Even though Equation 3 only shows a first order equation, these methods can still be used to solve higher order equations if they are entered correctly by allowing y and f to both be column vectors instead of scalars. Convert the second order equation y + y + y 2 = sin(t) into a first order system of ODEs and create the Matlab function that inputs y as a 2-vector and outputs f(t, y) as a 2-vector. Call this function myweek4function and submit it with your assignment. Your function should accept inputs t and y ( y will be a two variable column vector) and output f(t, y), a column vector representing y.

18 CHAPTER 6 Week 5 1. Discussion Topics Numerical integration, Plotting in Matlab, Matlab ODE Solvers 2. Worksheet 1. Numerical integration using Riemann sums. Recall the following functions from Homework 2: f 1 (x) = x 2 e x2. f 2 (x) = tanh(x) 1+x 2. f 3 (x) = x x3 3!. 1 f 5 (x) =. x log x 2 a. Using a right Riemann sum with subintervals of equal size, approximate (use implicit Matlab components linspace and sum). f 1 (x)dx (4) b. Using a left Riemann sum with subintervals of equal size, approximate (4). 2. Numerical integration. Numerically integrate and display your solutions (if one exists) to the following (use implicit Matlab components like quad, trapz, integral): a. f 1 (x) from x = 10 to 10. Compare this to your answers from question 1. b. f 2 f 3 from x = 0 to 2; c. Investigate the integral of (f 5 (x)) 2 from x = 0 to 1; d. f 5 (x) from x = 0 to 1; 11

19 12 6. WEEK 5 3. Fitting polynomials to data. Make the following plots in Matlab (use implicit Matlab components like polyfit, polyval, plot): a. A cubic polynomial approximation to sin x on the interval from 0 to 2π. b. A quartic polynomial approximation to sin x on the interval from 0 to 2π. c. A cubic polynomial approximation to sin x on the interval from 0 to 3π. d. A quartic polynomial approximation to sin x on the interval from 0 to 3π. Plot parts a and b on the same plot with a graph of the curve y = sin x. Do the same thing for parts c and d. (What happens with part c?)

20 2. WORKSHEET Logistic growth model. A population grows according the the logistic model given by the equation dy = 10 (1 y)(y 2), t 0. (5) dt a. Graph a direction field plot of the logistic population growth model in Eq. (5) for t [0, 2] and y [0, 2.5] (use implicit Matlab commands like quiver and meshgrid). b. Use Matlab to the solve the logistic population model for the given initial conditions. Graph the solution curves on the same plot as your direction field. (Use implicit Matlab command ode45). (i) y(0) = 0.9; (ii) y(0) = 1 (iii) y(0) = 1.1; (iv) y(0) = 2; (v) y(0) = 2.1.

21

22 CHAPTER 7 Week 6 1. Discussion Topics Determinants, Eigenvalues, Eigenvectors and For Loops in Matlab 2. Worksheet 1. If/then statements and for loops. The determinant of the 2 2 matrix [ ] a b A = c d is the quantity det(a) := ad bc. A matrix is invertible if and only if it has a nonzero determinant. A matrix that is not invertible is called singular. a. Using a for loop and if/elseif/else statements, write a Matlab function called invertiblepowers(a,n) that takes in a matrix A and a positive integer n. The function should first check if the matrix is 2 2. If it is not, then print Matrix has the wrong dimensions. Then it should check if n is a positive integer. If it is not print n is not a positive integer (a good way to test this is by checking if floor(n)=ceil(n)). If A is a 2 2 matrix and n is a positive integer, then calculate the determinant of the first n powers of A: det(a), det(a 2 ),..., det(a n ) (do not use the implicit Matlab component det), and use these values to determine if A k is invertible for k = 1, 2,..., n. For each k let a k = det(a k ). Have your program print out either det(a k ) = a k so A k is invertible if a k 0, or det(a k ) = 0 so A k is singular if a k = 0 (just display the letter A as opposed to the actual name of the matrix). (You may use the Matlab components if, elseif, else, for, isequal, size, or, disp, and fprintf) b. Run your function and display the results for the following matrices and numbers, n: [ ] (i) A =, n = 4; [ ] 1 2 (ii) A =, n = 1.5; 4 5 [ ] 1 2 (iii) A =, n = 3;

23 16 7. WEEK 6 (iv) A = [ ], n = Write a function called invertiblemat(a) that computes and displays the determinants of the matrix A. Use an if/then statement to print out either the term invertible or singular based upon the outcome. Run the function on the following matrices. (use implicit Matlab components like det, if, then, end, disp): a. b. c. M 4 I for M 2 = M 3 = M 4 = [ ] Second order equation. Recall the differential equation from homework 3 y + y + y 2 = sin(t). (6) Use ode45 and the function you created, myhw3odefunc, to find the solution to Eq. (6) with the initial conditions y(0) = 1, y (0) = 2. Plot your solution curve on the interval t [0, 5]. 4. Systems of First Order Linear Equations. A homogenous linear system of differential equation with constant coefficients can be written in the form d x = A x (7) dt where x(t) is an n 1 solution vector and A is a constant matrix. When n = 2 we can draw a visualization in the x 1 x 2 -plane called the phase plane. We evaluate A x at many points x and plot the resulting vectors (similar to a slope field). A plot that includes many trajectories is called a phase portrait. Write a function called directionfield(a) that creates a phase portrait for the system in Eq. (8) given a 2 2 matrix A. Run the program on the following matrices. (Let x 1 and x 2 each be in the interval [ 2.5, 2.5]. Use implicit Matlab components meshgrid and quiver.) a. A = [ ]

24 2. WORKSHEET 17 b. c. d. [ ] 1 2 A = 2 1 [ ] 1 0 A = 4 2 A = [ ]

25

26 CHAPTER 8 Week 7 1. Discussion Topics More on Matlab ODE Solvers and Newton s Method 2. Worksheet 1. Eigenvalues and Eigenvectors. λ C is called an eigenvalue of the n n matrix A if there is some (nonzero) vector v C n such that Av = λv. In this case, v is called an eigenvector of A associated with the eigenvalue λ. If there are n linear independent eigenvectors for A then they form a basis of C n. Write a function called eigenbasis(a) that prints out the eigenvalues of the matrix A with corresponding eigenvectors. Then print out whether or not the eigenvectors of A form a basis for the space C n. Run the function on each of the matrices below. (use implicit Matlab components like eig, disp, rank, if, then, end). Hint: If the rank of an n n matrix is less than n then its columns are not linearly independent and therefore do not form a basis of C n. a. b. c. M 2 = M 3 = M 4 = [ ] Phase portrait. In Homework 5 you wrote a function to make the direction field for the 2 2 homogeneous system of first order differential equations d x = A x. (8) dt Use the function you made, directionfield(a), to make a direction field for the following matrices with x 1 and x 2 in the interval [ 2.5, 2.5]. Then create a function 19

27 20 8. WEEK 7 phaseportrait(a,tmin,tmax,x1init,x2init) which uses ode45 to draw solution curves to Equation (8) in the x 1 x 2 -plane. This is known as a phase portrait of the system. The function should take a 2 2 matrix, A, minimum and maximum t values, and initial conditions for x 1 (t) and x 2 (t). Your function should also plot the initial condition point. Use this function to create a phase portrait on the same plot as your direction fields for each matrix with the given initial conditions. Letting t go from 0 to 20 should suffice for these example. a. [ ] 1 2 A = 4 1 x 1 (0) x 2 (0) i ii iii iv b. [ 1 2 A = 2 1 ] x 1 (0) x 2 (0) i ii iii iv c. A = [ ] x 1 (0) x 2 (0) i ii iii iv d. A = [ ]

28 2. WORKSHEET 21 x 1 (0) x 2 (0) i ii iii iv Pendulum. A simple physical problem that leads to a nonlinear, second order differential equation is the oscillating pendulum. The angle θ that an oscillating pendulum of length L makes with the vertical direction (see Figure 1) satisfies the equation d 2 θ dt 2 + g sin θ = 0. (9) L Figure 1. An oscillating pendulum a. Recall the function [ ] v f 4 (t, v, h) = g L sin(h) from homework 2. Use ode45 or ode15s and the function f 4 to solve the pendulum equation, Eq. (9), for g = L = 1.0 and θ(0) = 0.1, θ (0) = 0. (Why do we use f 4 to solve this ODE?) Plot your solution curve on t [0, 30]. b. What happens if g = 1.0 and L = 5.0? In other words, what happens to a really long pendulum? Use Matlab to solve the pendulum equation with these parameters and the same initial conditions as part a. You may want to alter f 4 to include the parameters g and L or make a new function. c. What happens if g = 0.17 and L = 1.0? In other words, what happens if you put a pendulum on the moon? Use Matlab to solve the pendulum equation with these parameters and the same initial conditions as part a. d. If θ is small then sin θ θ so Eq. (9) can be approximated by the linear equation d 2 θ dt 2 + g θ = 0. (10) L Use Matlab to solve the linearized pendulum equation with the same initial conditions as part a. You may want to create a function similar to f4. Plot the solution curve and compare it to the curve in part a.

29 22 8. WEEK 7 Use subplot to put all four graphs of the solution curves in the same figure. Label the plots and arrange them in a 2 2 matrix with graphs pertaining to each part in the following spots: a b d c e. Create a phase diagram (plot of θ vs θ) for the pendulum equation with g = L = 1.0. Plot this graph in a separate figure. Bonus: What is the relationship between the eigenvalues of a matrix A and the behavior of the direction field for Equation (8) near the point (0, 0)? Send your observations in your with your assignment. Hint: The four parts of question 2 all behave in distinct ways near (0, 0).

30 CHAPTER 9 Week 8 Writing your own ODE solvers 1. Discussion Topics 2. Worksheet 1. Euler s method. (Forward or explicit) Euler s method is a simple way to approximate a solution to a differential equation of the form y = f(t, y), y(t 0 ) = y 0 (11) for a discrete set of points, y n. Suppose we want to approximate a solution to Eq. (24) over the interval t 0 < t < T. The steps in Euler s method are to first divide the interval into N equal sections. Then t n = t 0 + nh for n = 0, 1,..., N and h = (T t 0 )/N. The values of y n are then found recursively with the formula y 0 = y(t 0 ), y n+1 = y n + hf(t n, y n ). a. Use a for loop construction to write your own ODE solver for the following differential equation y = y 3 + 2t, y(0) = 0 (use implicit Matlab components like for, end) over the interval t = 0 to t = 1 implementing 50 uniform time steps of (explicit or forward) Euler s Method. Display the values t 0, t 25, t 50, y 0, y 25, and y 50. b. Solve the same equation using ode15s with a relative error tolerance of 1e 10 letting Matlab set the number of time steps. (Use the implicit Matlab commands odeset and RelTol.) c. Solve the given equation using ode45 with the default error tolerance. d. Plot your approximations of y(t) from parts a, b, and c on the same plot. 2. Write the function [t,y]=eulers(f,t0,y0,t,n) to run Euler s method in order to approximate a solution to Eq. (24). Each input variable is defined as they are in question 1 (t0=t 0 and y0=y 0 ). The outputs, t and y should be 1 (N + 1) 23

31 24 9. WEEK 8 vectors with t(n) = t n and y(n) = y n. Use your function to graph approximate solutions to the equation y = y 3 + 2t, y(0) = 0 the following values of N on the same plot. a. N = 10; b. N = 20; c. N = 40; d. N = 50; e. N = 100; f. N = 1000; 3. The Hermite Equation. The equation y 2xy + 2λy = 0, λ R (12) is known as the Hermite equation. It is an important equation in mathematical physics. When λ is a nonnegative integer, n, the solution to Eq. (12) is a polynomial, H n (x), of degree n called the nth Hermite polynomial. a. Use a Matlab ODE solver to find solutions to the Hermite equation for λ = 0, 1, 2, 3 with the following initial conditions over the interval x [ 1.8, 1.8]. You may want to make a function to help solve this second order differential equation similar to myhw3odefunc. n y(0) y (0) Recall how to use an ODE solver backwards and forwards when the initial conditions are not given at the beginning of your interval. Plot H n (x), x [ 1.8, 1.8] and y [ 10, 10], for n = 0, 1, 2, 3 on the same graph. (You may want to use the implicit Matlab commands ode45 or ode15s to find solutions and wrev to help plot each piece correctly). b. Use polyfit and your solutions in part a to find H n (x) for n = 0, 1, 2, 3. Round each coefficient to the nearest integer and display each polynomial. (Use the Matlab components round and poly2sym).

32 CHAPTER 10 Week 9 1. Discussion Topics Approximation of ODEs, Special Functions 2. Worksheet 1. Slope Field. In Homework 3 you plotted direction fields for first order differential equations. Write a function slopefield(f,tmin,tmax,ymin,ymax,tstep,ystep) to plot a direction field for the first order ODE y = f(t, y) for t [tmin, tmax] and y [ymin, ymax] with uniform steps in the t and y direction of size tstep and ystep. Your arrows should all be unit length. Use implicit Matlab components meshgrid and quiver. Run slopefield for the following differential equations and given inputs. Then run the function Eulers that you created in Homework 7 for the given initial condition with 1000 uniform steps and graph the approximate solution on the same graph as the slope field for each part. a. y = 5 3 y, t [0, 4], y [0, 4], tstep= 0.1, ystep= 0.1, y(0) = 1; b. y = (4 ty)/(1 + y 2 ), t [0, 4], y [ 4, 4], tstep= 0.15, ystep= 0.2, y(0) = 2; 2. Implicit Euler s method. Backward (or implicit) Euler s method is similar to forward Euler s method but the recursive formula is slightly different making it an implicit method. We would like to approximate a solution to the equation y = f(t, y), y(t 0 ) = y 0 (13) over the interval t 0 t T. To calculate y n using backward Euler, we use the formula y 0 = y(t 0 ), y n+1 = y n + hf(t n+1, y n+1 ). where t n and h are the same as they were on homework 6. This is an implicit method because y n+1 appears on both sides of the equation. We must use algebra or some numerical method (Newton s method) to find y n+1. a. Run the function Eulers to approximate a solution to the differential equation y = t 2 y, y(0) = 2. (14) 25

33 WEEK 9 over the interval t = 0 to t = 2 implementing 100 uniform time steps. Plot the solution curve. b. Now write an ODE solver for Eq. (14) over the interval t = 0 to t = 2 implementing 100 uniform time steps of backward Euler s method. c. Solve the Eq. (14) by hand and plot your approximations from parts a and b along with the exact solution. 3. Newton s Method. A standard numerical method for finding solutions to the equation f(x) = 0 is known as Newton s method. Suppose f : [a, b] R is differentiable and its derivative is given by f. To approximate a root of f we first guess a root x 0. We then recursively approximate the root using the equation x n+1 = x n f(x n) f (x n ). (15) The method will usually converge assuming x 0 is close enough to the root and f (x 0 ) 0. Write a function root=newtonsmethod(f,df,x0,n) to perform N iterations of Newton s method given the functions f and df = f and an initial guess x0 for a root of f. Use your function for the following exercises and display the results in a long format (use the Matlab command format). a. Perform 1000 iterations of Newton s method to find a root of f(x) = x 2 2 with x 0 = 1. b. Perform 1000 iterations of Newton s method to find a root of f(x) = sin x with x 0 = 3. c. Perform 1000 iterations of Newton s method to find a solution to the equation of x 2 = x + 1 with x 0 = 2. d. Perform 1000 iterations of Newton s method to find a solution to the equation of log(x 2 ) = 2 with x 0 = 2. Bonus: Name the four constants you approximated in Question 3. Display the names or symbols of the constants.

34 CHAPTER 11 Week Discussion Topics Stability and Instability in ODE algorithms 2. Worksheet 1. Newton s second law. Suppose an object of mass m (in kg) is falling in the atmosphere near sea level. Let x(t) represent the distance of the object from the ground (in meters) where x = 0 is the ground level and x < 0 means the object is above the ground (this assumption is made so the direction of positive velocity, dx/dt, is downward). Assuming a constant acceleration due to gravity is 9.8 m/s 2 and a drag coefficient of the object is γ kg/s, by Newton s second law of motion, the mathematical model of the object falling is given by m d2 x dt 2 + γ dx = 9.8m. (16) dt a. Rewrite the function [tout,yout]=eulers(f,t0,y0,t,n) from Homework 7 to run Euler s method for any order differential equation that can be written as a system of first order differential equations of the form y (t) = f(t, y), y(t 0 ) = y 0. (17) The function should run N iterations of Euler s method. tout should be an (N + 1) 1 column vector such that tout(n + 1) = t n. For an order k differential equation, yout should be an (N + 1) k matrix where yout(n + 1, k) = y n (k 1) (t n ) (an approximation to the (k 1)st derivative of y at t n ). b. Run your new Eulers function to solve Eq. (16) for an object of mass 1 kg and a drag coefficients 0.2 kg/s dropped from a height of 10 m (so x(0) = 10 and x (0) = 0). Plot the approximation found using step of Euler s method for t [0, 2.5]. c. Display the time at which the object hits the ground. (Find the first value of tout such that xout(tout) < 1e 2. Use implicit Matlab commands abs and find.) d. Repeat parts b and c for the same object thrown upwards from a height of 1 m at a velocity of 10 m/s. Graph the approximation over the same interval on the same plot as the graph for part b. Plot the line x = 0 to represent the ground. 27

35 WEEK Wronskian and Abel s theorem. a. Use your function from Question 1 to compute solutions to y (t) + sin(t)y (t) + cos(t)y(t) = 0 (18) first for y 1 (0) = 1 and y 1(0) = 0, then for y 2 (0) = 1 and y 2(0) = 1 on the interval t [0, 2π] using 1000 iterations of Euler s method. Graph your solutions on the same plot. b. Compute the function [ ] y1 (t) y W (t) = det 2 (t) y 1(t) y 2(t) (19) at the values of t you approximated in part a. W (t) is called the Wronskian of y 1 and y 2. c. Approximate the ODE z (t) + sin(t)z(t) = 0, z(0) = 1 (20) on the interval [0, 2π] using 1000 iterations with your Euler s method function. d. Graph W (t) and z(t) on [0, 2π] on the same plot. This is a numerical verification of Abel s Theorem. 3. a. Plot the function f(x) = e x 10 cos(x) on the interval from 0 to 4. Find the integer x 0 in this interval such that f(x 0 ) 0. b. Use 10 iterations of the Newton s method function you created in Homework 7 using the x 0 you found in part a. c. Plot with x-marks the differences of the iterates ( x 1 x 0, x 2 x 1,..., x 10 x 9 ). On the same figure plot with circles the points f(x n ) for n = 1,..., 10.

36 CHAPTER 12 Week Discussion Topics Implementing Newton s Method in Algorithms and RK4, Lotka- Volterra Model 2. Worksheet 1. Gamma function. The gamma function is denoted by Γ(p) and is defined by the integral Γ(p + 1) = The integral converges as x for all p. 0 e x x p dx. (21) a. Evaluate and display Γ(n) for n = 1, 2,..., 10; (use the implicit Matlab command integral). b. Evaluate and display n! for n = 0, 1,..., 9; (use the implicit Matlab command factorial). If p is a positive integer, n, it can be shown that Γ(n + 1) = n!. Since Γ(p) is also defined when p is not an integer, this function provides an extension of the factorial function to non-integral values of the independent variable (check that Γ(1/2) = π). Matlab has an implicit command gamma for the gamma function. You may use this command in the next question. 2. Airy s Equation. The solution to Airy s equation, y xy = 0, (22) is known as the Airy function. The Airy s equation was designed to model light moving through a caustic (such as diffraction that forms a rainbow for instance). a. Use an ODE solver of your choice to plot a special fundamental solution to Airy s equation with initial conditions 1 y(0) = 3 2/3 Γ(2/3), 1 y (0) = 3 1/3 Γ(1/3) over the interval x [ 10, 10]. Notice that the plot of the solution is oscillatory for x < 0 and exponentially decaying for x > 0 (you will need to adjust your error tolerances to see the correct behavior). 29

37 WEEK 11 b. Compare your function to the implicit Matlab function airy on the same interval using a plot (note, the Airy function in Matlab will have a tiny imaginary component, so you will need to take the real part using real). 3. Bessel Equation of Order 0. The Bessel equation of order 0, x 2 y + xy + x 2 y = 0, (23) is related to modes of oscillation on discs and many other physical examples. The solutions to this equation define the Bessel functions J 0 (x) and Y 0 (x). a. Use an ODE solver of your choice to solve the Bessel equation with initial conditions y(0) = 1 and y (0) = 0 over the interval x [ 10, 10]. Since the coefficients are singular near x = 0, we will need to replace the initial conditions. To approximate a solution for x > 0 use y(0.01) = 1 and y (0.01) = For x < 0 use y( 0.01) = 1 and y ( 0.01) = b. Use an ODE solver of your choice to solve the Bessel equation with initial conditions y(0) = 0 and y (0) = 1 over the interval x [ 10, 10]. As is part a, we will need to replace the initial conditions. To approximate a solution for x > 0 use y(0.01) = 3 and y (0.01) = 64. For x < 0 use y( 0.01) = 3 and y ( 0.01) = 64. c. Plot your solution functions and compare them to plots of the implicit Matlab functions besselj and bessely. (Use 0 for the order of the Bessel functions of the first and second kind).

38 CHAPTER 13 Week Discussion Topics Multi-Step Methods and Crank-Nicholson, Lorenz Equations, Optics 2. Worksheet 1. Early convergence tests. The use of a numerical procedure, such as Euler s method, on an initial value problem raises questions of convergence. That is, as we decrease the step size h, (or increase the number of iterations, N) do the values of the numerical approximation y n approach that corresponding values of the actual solution? Assuming this is true, we want to use step sizes that are small enough to ensure accurate approximations, but not too small to slow down calculations too much. a. Recall the system of differential equations from problem 2a from Homework 10 x (t) = u(t) y (t) = v(t) u (t) = x x 2 + y 2 v (t) = y x 2 + y 2 with initial value (x, y, u, v)(0) = (1, 0, 0, 1). This initial value problem has an exact solution (x, y, u, v)(t) = (cos t, sin t, sin t, cos t). Use your function Eulers from Homework 9 to solve the initial value problem for N = 100, 200, 300, 400, 500, and 1000 over the time interval [0, 4π]. Using subplots in the formation shown below, graph your approximate solutions for (x(t), y(t)) for each N. On each plot also graph the exact solution (x(t), y(t)). N = 100 N = 200 N = 300 N = 400 N = 500 N = 1000 b. Make a 1 6 vector of the maximum error for each N in part a. error N = max{ x n cos t n, y n sin t n, u n + sin t n, v n cos t n }. 31

39 WEEK 12 Plot the maximum error as a function of N. (Use the implicit Matlab command max.) c. Use tic and toc to find the time taken per step of each method. You will have to alter your Eulers code to do this. Display the total time elapsed and the average time per step for each N. 2. The Runge-Kutta Method. Another explicit numerical method to solve the initial value problem y = f(t, y), y(t 0 ) = y 0 (24) is called the Runge-Kutta method. The Runge-Kutta formula involves a weighted average of values of f(t, y) at different points in the interval t n t t n+1. It is given by ( ) kn1 + 2k n2 + 2k n3 + k n4 y n+1 = y n + h (25) 6 where k n1 = f(t n, y n ) k n2 = f(t n h, y n hk n1) k n3 = f(t n h, y n hk n2) k n4 = f(t n + h, y n + hk n3 ). The sum (k n1 + 2k n2 + 2k n3 + k n4 )/6 can be interpreted as an average slope. a. Write a function [tout,yout]=rungekutta(f,t0,t,y0,n) to run the Runge- Kutta method to approximate values of the solution to to Eq. (24). b. Use the function you wrote in a to approximate a solution to the initial value problem y = 2t + e ty, y(0) = 1 on the interval t [0, 2] for N = 100, 200, 300, 500, and Graph your solutions on the same plot. 3. Comparison of methods. Consider the initial value problem y = 3 + t y, y(0) = 1. Find solutions over the interval t [0, 2] to this differential equation in the following ways: a. Find the exact solution (using paper and pencil). b. Approximate with forward Euler s method with N = 100 and N = c. Approximate with backward Euler s method with N = 100 and N = 1000.

40 2. WORKSHEET 33 d. Approximate with the Runge-Kutta method with N = 100 and N = Graph the solutions on two figures, one for each value of N (put the graph of the exact solution on both plots). In the command window, display y(2) for each solution. (You should display seven values of y(2): the exact value and two for each method corresponding to the two values of N). Also display the total time it takes to run each method. (Use tic and toc.)

41

42 CHAPTER 14 Week Discussion Topics Hamiltonians, Newton s Method in higher dimensions, RK Schemes 2. Worksheet 1. Improved Euler formula. Consider the initial value problem y = f(t, y), y(t 0 ) = y 0 (26) and let y = ϕ(t) denote its solution. By integrating the equation ϕ (t) = f(t, ϕ(t)) from t n to t n+1, we obtain tn+1 tn+1 ϕ (t) dt = f(t, ϕ(t)) dt, t n t n or tn+1 ϕ(t n+1 ) = ϕ(t n ) + f(t, ϕ(t)) dt. (27) t n The integral in Eq. (27) is represented geometrically by the area under the curve in Figure 1 over the interval t [t n, t n+1 ]. If we approximate this area with the area of the gray square then Eq. (27) becomes ϕ(t n+1 ) = ϕ(t n ) + (t n+1 t n )f(t n, ϕ(t n )). By replacing ϕ(t n ) by y n and t n+1 t n by h this gives y n+1 = y n + hf(t n, y n ). (28) We recognize Eq. (28) as the formula used in forward Euler s method. This visualization allows us to see why our approximation to the solution using Euler s method improves as h gets closer to zero since a smaller h causes the area of the approximating rectangles to be closer the exact area under the curve f(t, ϕ(t)). If we approximate the integral in Eq. (27) by the area of the rectangle shown in Figure 2 then Eq. (27) becomes y n+1 = y n + hf(t n+1, y n+1 ). (29) We recognize Eq. (29) as the formula used in forward Euler s method. A better approximate formula can be obtained if we approximate the integral in Eq. (27) by the area of the trapezoid shown in Figure 3. Then, Eq. (27) becomes y n+1 = y n + h 2 (f(t n, y n ) + f(t n+1, y n+1 )). (30) 35

43 WEEK 13 y y = f(t, ϕ(t)) f(t n, ϕ(t n )) t n t n+1 t Figure 1. Geometric representation of forward Euler s method. y f(t n, ϕ(t n+1 )) y = f(t, ϕ(t)) t n t n+1 t Figure 2. Geometric representation of backward Euler s method. Eq. 30 is an implicit formula because it has y n+1 on both sides of the equation. We can make it explicit by using Euler s formula and replacing y n+1 on the right hand side by the right hand side of Eq. 28. This gives y n+1 = y n + h 2 (f(t n, y n ) + f(t n+1, y n + hf(t n, y n ))). (31) Eq. (31) is known as the improved Euler formula, the Huen formula, or the explicit trapezoidal rule. a. Write a function [tout,yout]=improvedeulers(f,t0,t,y0,n) to run the improved Euler s method to approximate values of the solution to Eq. (26). b. In Homework 12 you approximated solutions to the initial value problem y = 3 + t y y(0) = 1 (32) on the interval t [0, 2] using forward Euler s method, backward Euler s method, and the Runge-Kutta method for N = 100 and N = 1000 iterations. Approximate solutions with the improved Euler s method for N = 100 and N = Graph the solutions on two figures and include the exact solution on both plots. Display the approximate value of y(2) for each N and the

44 2. WORKSHEET 37 y y = f(t, ϕ(t)) f(t n, ϕ(t n+1 )) f(t n, ϕ(t n )) t n t n+1 t Figure 3. Geometric representation of improved Euler s method. exact value of y(2) in the command window. Compare these approximations with those from Homework Order of accuracy. Suppose we are numerically approximating a solution to y = f(t, y), y(t 0 ) = y 0 and we assume our computer can execute all computations exactly, i.e., it can retain infinitely many digits at each step. The difference E n between the solution y = ϕ(t) and the numerical approximation y n at the point t = t n is given by E n = ϕ(t n ) y n. The error E n is known as the global truncation error. A numerical solution to a differential equation is said to be kth-order accurate and the method used to obtain such a solution is said to be a kth order method if E n is no greater than a constant times h k. In other words, for some constant C, E n Ch k. (33) Recall, for an approximation over the interval t [t 0, T ] using numerical method with N iterations, Consider the initial value problem h = T t 0 N. y = t 2 y, y(0) = 1. (34) a. For each of the following methods, approximate the solution to Eq. (34) over the interval t [0, 1] for the following values of h: h = 0.05, 0.02, 0.01, 0.005, 0.002, 0.001, , , For each method, graph the nine approximate solutions and the exact solution (which you should find by hand). You should end up with a different figure for each method containing ten curves. i. Forward Euler s method.

45 WEEK 13 ii. Improved Euler s method. iii. Runge-Kutta method. b. For each method above, and each h, find the maximum of the absolute value of the global truncation error, E n. For each method, you should get nine points, one for each h. In a separate figure for each method, plot these points versus h. Bonus (1 point): What is the order of each of the methods used in Question 2? Send me your answers in the with your assignment. (Hint: try fitting polynomial curves of different orders to the graphs in part b until you have what appears to be a best fit curve). c. Using tic and toc find the total time it takes to run each method in part a for each value of h. You should alter your functions for each method to include the computation time as an additional output argument. Make a table for each method displaying the maximum global truncation error and computation time for each h. (You should end up with three tables each with nine rows, one for each h, and three columns displaying h, the maximum global truncation error, and the computation time).

46 CHAPTER 15 Week Discussion Topics Stable and Unstable Equilibrium Points, Linearization 2. Worksheet 1. Predator-Prey Equations. Predator-prey equations (also known as Lotka- Volterra equations) are a pair of first order, non-linear differential equations used to model the dynamics of a biological situation in which one species (the predator) preys on another species (the prey). Denote by x and y the populations of prey and predator, respectively, at time t. The populations change through time according to the equations x (t) = x(a αy) (35) y (t) = y( c + γx). (36) The constants a, c, α, and γ are all positive. a is the growth rate of the prey, c is the death rate of the predator, and α and γ are measures of the effect of the interaction between the two species. Notice that if x = 0 then y = cy so the predator population decreases and eventually dies out. Similarly, if y = 0 then x = ax so the prey population grows exponentially. We can modify the predator-prey equations to the following x (t) = x(a 1 a 2 x αy) (37) y (t) = y(c 1 c 2 y + γx). (38) In this modified system, if y = 0 then x = x(a 1 a 2 x) and if x = 0 then y = y(c 1 c 2 y) so the growth in each population is logistic instead of exponential. a. Consider the predator-prey equations 39

47 WEEK 14 x (t) = x(3 x 2y) y (t) = y(2 y x). Create a direction field for the system with x [0, 4] and y [0, 4]. b. Recall, a critical point of a system of differential equations is a point (x, y) at which the right hand sides of the equations in the given system are simultaneously 0. The predator-prey equations in this problem have four critical points, one of which is (1, 1). Find the other three and plot all four critical points on the same graph as the direction field. c. Use the Runge-Kutta method to solve the system over the time interval t [0, 10] with the following initial conditions: i. (x, y)(0) = (0, 0.1); ii. (x, y)(0) = (0.1, 0); iii. (x, y)(0) = (0.1, 0.1); iv. (x, y)(0) = (0.1, 0.2); v. (x, y)(0) = (0.1, 0.3); vi. (x, y)(0) = (3.5, 1); vii. (x, y)(0) = (3.5, 2); viii. (x, y)(0) = (3.5, 3); ix. (x, y)(0) = (3.5, 4). Plot all the approximate solutions on the same graph as the direction field and critical points. You may have to modify your Runge-Kutta function from Homework 12 so it can solve a system of equations. 2. Adams Method. In every numerical procedure we have discussed so far the approximation of y n = y(t n ) relies only on the value of y n 1. In this method, we will see that the approximation of y n use the values of y n 1 and y n 2. Methods that use information at more than the last approximated point are referred to as multistep methods. The Adams-Bashforth formula is a multistep method designed around being accurate for polynomials of a chosen order. For a constant step size h, the second

48 2. WORKSHEET 41 order Adams-Bashforth formula is given by y n+1 = y n hf(t n, y n ) 1 2 hf(t n 1, y n 1 ). (39) Use this Adams-Bashforth algorithm to solve the Lorenz equations x = y x y = x(1 z) y z = xy z (x, y, z)(0) = (1, 1, 0). on time scale [0, 15]. Plot the three dimensional solution curve. Hint: approximate y 1 with a step of explicit Euler s method. The Lorenz equations were first studied as a model in meteorology and other applications of fluid dynamics. They concern the motion of a layer of fluid, such as the earth s atmosphere, that is warmer at the bottom than at the top. 3. Crank-Nicolson method. The Crank-Nicolson method is an implicit numerical method for solving ordinary differential equations that implements the midpoint rule. The algorithm is y n+1 = y n h(f(t n+1, y n+1 ) + f(t n, y n )). (40) Use the Crank-Nicolson method to solve the differential equation y = 100y + 100t + 1, y(0) = 1 (41) for 0 t 1 and the following values of h: i. h = 1/10 ii. h = 1/30 iii. h = 1/40 iv. h = 1/60 Plot each approximation as well as the exact solution on the same graph. 4. Stability. The concept of stability is associated with the possibility that small errors that are introduced in the course of a numerical method will disappear as the procedure continues. Instability occurs if small errors tend to increase, perhaps unbounded. If we are investigating an initial value problem numerically, we may introduce instabilities that were not part of the original problem. In other words, the errors in our method cause the approximation of the solution to greatly differ from the exact solution and to possibly increase unbounded. Avoidance of such instabilities may require us to place restrictions on the step size h. Solve Eq. (41) using each of the following methods for the four values of h given in Problem 3.

49 WEEK 14 a. Forward Euler s method b. Backward Euler s method c. Improved Euler s method d. Runge-Kutta method e. Adams method f. Crank-Nicolson method (already done in Problem 3) Create a different plot for each value of h that contains all approximations and the exact solution. Notice some of the approximations are unstable. This problem is called stiff because a much smaller step size, h, is required for stability than for accuracy. The backwards differentiation formulas are the most popular for dealing with stiff problems.

Graded Project #1. Part 1. Explicit Runge Kutta methods. Goals Differential Equations FMN130 Gustaf Söderlind and Carmen Arévalo

Graded Project #1. Part 1. Explicit Runge Kutta methods. Goals Differential Equations FMN130 Gustaf Söderlind and Carmen Arévalo 2008-11-07 Graded Project #1 Differential Equations FMN130 Gustaf Söderlind and Carmen Arévalo This homework is due to be handed in on Wednesday 12 November 2008 before 13:00 in the post box of the numerical

More information

AIMS Exercise Set # 1

AIMS Exercise Set # 1 AIMS Exercise Set #. Determine the form of the single precision floating point arithmetic used in the computers at AIMS. What is the largest number that can be accurately represented? What is the smallest

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for solving higher order ODEs and

More information

Intro to ODEs in Matlab. Jeremy L. Marzuola Charles Talbot Ben Wilson

Intro to ODEs in Matlab. Jeremy L. Marzuola Charles Talbot Ben Wilson Intro to ODEs in Matlab Jeremy L. Marzuola Charles Talbot Ben Wilson E-mail address: marzuola@math.unc.edu Department of Mathematics, UNC-Chapel Hill, CB#3250 Phillips Hall, Chapel Hill, NC 27599 USA E-mail

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MAT 75 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP. Use MATLAB solvers for solving higher order ODEs and systems

More information

Math 128A Spring 2003 Week 12 Solutions

Math 128A Spring 2003 Week 12 Solutions Math 128A Spring 2003 Week 12 Solutions Burden & Faires 5.9: 1b, 2b, 3, 5, 6, 7 Burden & Faires 5.10: 4, 5, 8 Burden & Faires 5.11: 1c, 2, 5, 6, 8 Burden & Faires 5.9. Higher-Order Equations and Systems

More information

Math 308 Week 8 Solutions

Math 308 Week 8 Solutions Math 38 Week 8 Solutions There is a solution manual to Chapter 4 online: www.pearsoncustom.com/tamu math/. This online solutions manual contains solutions to some of the suggested problems. Here are solutions

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MATLAB sessions: Laboratory 4 MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for

More information

APPM 2360: Final Exam 10:30am 1:00pm, May 6, 2015.

APPM 2360: Final Exam 10:30am 1:00pm, May 6, 2015. APPM 23: Final Exam :3am :pm, May, 25. ON THE FRONT OF YOUR BLUEBOOK write: ) your name, 2) your student ID number, 3) lecture section, 4) your instructor s name, and 5) a grading table for eight questions.

More information

Fourth Order RK-Method

Fourth Order RK-Method Fourth Order RK-Method The most commonly used method is Runge-Kutta fourth order method. The fourth order RK-method is y i+1 = y i + 1 6 (k 1 + 2k 2 + 2k 3 + k 4 ), Ordinary Differential Equations (ODE)

More information

CS520: numerical ODEs (Ch.2)

CS520: numerical ODEs (Ch.2) .. CS520: numerical ODEs (Ch.2) Uri Ascher Department of Computer Science University of British Columbia ascher@cs.ubc.ca people.cs.ubc.ca/ ascher/520.html Uri Ascher (UBC) CPSC 520: ODEs (Ch. 2) Fall

More information

Initial value problems for ordinary differential equations

Initial value problems for ordinary differential equations AMSC/CMSC 660 Scientific Computing I Fall 2008 UNIT 5: Numerical Solution of Ordinary Differential Equations Part 1 Dianne P. O Leary c 2008 The Plan Initial value problems (ivps) for ordinary differential

More information

Ordinary Differential Equations

Ordinary Differential Equations CHAPTER 8 Ordinary Differential Equations 8.1. Introduction My section 8.1 will cover the material in sections 8.1 and 8.2 in the book. Read the book sections on your own. I don t like the order of things

More information

Understand the existence and uniqueness theorems and what they tell you about solutions to initial value problems.

Understand the existence and uniqueness theorems and what they tell you about solutions to initial value problems. Review Outline To review for the final, look over the following outline and look at problems from the book and on the old exam s and exam reviews to find problems about each of the following topics.. Basics

More information

Ordinary differential equations - Initial value problems

Ordinary differential equations - Initial value problems Education has produced a vast population able to read but unable to distinguish what is worth reading. G.M. TREVELYAN Chapter 6 Ordinary differential equations - Initial value problems In this chapter

More information

Multistep Methods for IVPs. t 0 < t < T

Multistep Methods for IVPs. t 0 < t < T Multistep Methods for IVPs We are still considering the IVP dy dt = f(t,y) t 0 < t < T y(t 0 ) = y 0 So far we have looked at Euler s method, which was a first order method and Runge Kutta (RK) methods

More information

1 The pendulum equation

1 The pendulum equation Math 270 Honors ODE I Fall, 2008 Class notes # 5 A longer than usual homework assignment is at the end. The pendulum equation We now come to a particularly important example, the equation for an oscillating

More information

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit V Solution of

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit V Solution of Scientific Computing with Case Studies SIAM Press, 2009 http://www.cs.umd.edu/users/oleary/sccswebpage Lecture Notes for Unit V Solution of Differential Equations Part 1 Dianne P. O Leary c 2008 1 The

More information

Solving Differential Equations: First Steps

Solving Differential Equations: First Steps 30 ORDINARY DIFFERENTIAL EQUATIONS 3 Solving Differential Equations Solving Differential Equations: First Steps Now we start answering the question which is the theme of this book given a differential

More information

June 2011 PURDUE UNIVERSITY Study Guide for the Credit Exam in (MA 262) Linear Algebra and Differential Equations

June 2011 PURDUE UNIVERSITY Study Guide for the Credit Exam in (MA 262) Linear Algebra and Differential Equations June 20 PURDUE UNIVERSITY Study Guide for the Credit Exam in (MA 262) Linear Algebra and Differential Equations The topics covered in this exam can be found in An introduction to differential equations

More information

Chapter 1, Section 1.2, Example 9 (page 13) and Exercise 29 (page 15). Use the Uniqueness Tool. Select the option ẋ = x

Chapter 1, Section 1.2, Example 9 (page 13) and Exercise 29 (page 15). Use the Uniqueness Tool. Select the option ẋ = x Use of Tools from Interactive Differential Equations with the texts Fundamentals of Differential Equations, 5th edition and Fundamentals of Differential Equations and Boundary Value Problems, 3rd edition

More information

Physics 584 Computational Methods

Physics 584 Computational Methods Physics 584 Computational Methods Introduction to Matlab and Numerical Solutions to Ordinary Differential Equations Ryan Ogliore April 18 th, 2016 Lecture Outline Introduction to Matlab Numerical Solutions

More information

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b)

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b) Numerical Methods - PROBLEMS. The Taylor series, about the origin, for log( + x) is x x2 2 + x3 3 x4 4 + Find an upper bound on the magnitude of the truncation error on the interval x.5 when log( + x)

More information

Worksheet 8 Sample Solutions

Worksheet 8 Sample Solutions Technische Universität München WS 2016/17 Lehrstuhl für Informatik V Scientific Computing Univ.-Prof. Dr. M. Bader 19.12.2016/21.12.2016 M.Sc. S. Seckler, M.Sc. D. Jarema Worksheet 8 Sample Solutions Ordinary

More information

Lab 5: Nonlinear Systems

Lab 5: Nonlinear Systems Lab 5: Nonlinear Systems Goals In this lab you will use the pplane6 program to study two nonlinear systems by direct numerical simulation. The first model, from population biology, displays interesting

More information

Mon Jan Improved acceleration models: linear and quadratic drag forces. Announcements: Warm-up Exercise:

Mon Jan Improved acceleration models: linear and quadratic drag forces. Announcements: Warm-up Exercise: Math 2250-004 Week 4 notes We will not necessarily finish the material from a given day's notes on that day. We may also add or subtract some material as the week progresses, but these notes represent

More information

u n 2 4 u n 36 u n 1, n 1.

u n 2 4 u n 36 u n 1, n 1. Exercise 1 Let (u n ) be the sequence defined by Set v n = u n 1 x+ u n and f (x) = 4 x. 1. Solve the equations f (x) = 1 and f (x) =. u 0 = 0, n Z +, u n+1 = u n + 4 u n.. Prove that if u n < 1, then

More information

Solution. Your sketch should show both x and y axes marked from 5 to 5 and circles of radius 1, 3, and 5 centered at the origin.

Solution. Your sketch should show both x and y axes marked from 5 to 5 and circles of radius 1, 3, and 5 centered at the origin. Solutions of the Sample Problems for the First In-Class Exam Math 246, Fall 208, Professor David Levermore () (a) Sketch the graph that would be produced by the following Matlab command. fplot(@(t) 2/t,

More information

Eigenvalues and Eigenvectors, More Direction Fields and Systems of ODEs

Eigenvalues and Eigenvectors, More Direction Fields and Systems of ODEs Eigenvalues and Eigenvectors, More Direction Fields and Systems of ODEs First let us speak a bit about eigenvalues. Defn. An eigenvalue λ of an nxn matrix A means a scalar (perhaps a complex number) such

More information

Why are Discrete Maps Sufficient?

Why are Discrete Maps Sufficient? Why are Discrete Maps Sufficient? Why do dynamical systems specialists study maps of the form x n+ 1 = f ( xn), (time is discrete) when much of the world around us evolves continuously, and is thus well

More information

Nonlinear Autonomous Systems of Differential

Nonlinear Autonomous Systems of Differential Chapter 4 Nonlinear Autonomous Systems of Differential Equations 4.0 The Phase Plane: Linear Systems 4.0.1 Introduction Consider a system of the form x = A(x), (4.0.1) where A is independent of t. Such

More information

Bindel, Fall 2011 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 18. HW 7 is posted, and will be due in class on 4/25.

Bindel, Fall 2011 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 18. HW 7 is posted, and will be due in class on 4/25. Logistics Week 12: Monday, Apr 18 HW 6 is due at 11:59 tonight. HW 7 is posted, and will be due in class on 4/25. The prelim is graded. An analysis and rubric are on CMS. Problem du jour For implicit methods

More information

Boyce/DiPrima/Meade 11 th ed, Ch 1.1: Basic Mathematical Models; Direction Fields

Boyce/DiPrima/Meade 11 th ed, Ch 1.1: Basic Mathematical Models; Direction Fields Boyce/DiPrima/Meade 11 th ed, Ch 1.1: Basic Mathematical Models; Direction Fields Elementary Differential Equations and Boundary Value Problems, 11 th edition, by William E. Boyce, Richard C. DiPrima,

More information

Solutions of the Sample Problems for the First In-Class Exam Math 246, Fall 2017, Professor David Levermore

Solutions of the Sample Problems for the First In-Class Exam Math 246, Fall 2017, Professor David Levermore Solutions of the Sample Problems for the First In-Class Exam Math 246, Fall 207, Professor David Levermore () (a) Give the integral being evaluated by the following Matlab command. int( x/(+xˆ4), x,0,inf)

More information

ODE Homework 1. Due Wed. 19 August 2009; At the beginning of the class

ODE Homework 1. Due Wed. 19 August 2009; At the beginning of the class ODE Homework Due Wed. 9 August 2009; At the beginning of the class. (a) Solve Lẏ + Ry = E sin(ωt) with y(0) = k () L, R, E, ω are positive constants. (b) What is the limit of the solution as ω 0? (c) Is

More information

Differential Equations FMNN10 Graded Project #1 c G Söderlind 2017

Differential Equations FMNN10 Graded Project #1 c G Söderlind 2017 Differential Equations FMNN10 Graded Project #1 c G Söderlind 2017 Published 2017-10-30. Instruction in computer lab 2017-11-02/08/09. Project report due date: Monday 2017-11-13 at 10:00. Goals. The goal

More information

MTH 452/552 Homework 3

MTH 452/552 Homework 3 MTH 452/552 Homework 3 Do either 1 or 2. 1. (40 points) [Use of ode113 and ode45] This problem can be solved by a modifying the m-files odesample.m and odesampletest.m available from the author s webpage.

More information

Homework and Computer Problems for Math*2130 (W17).

Homework and Computer Problems for Math*2130 (W17). Homework and Computer Problems for Math*2130 (W17). MARCUS R. GARVIE 1 December 21, 2016 1 Department of Mathematics & Statistics, University of Guelph NOTES: These questions are a bare minimum. You should

More information

Math 1060 Linear Algebra Homework Exercises 1 1. Find the complete solutions (if any!) to each of the following systems of simultaneous equations:

Math 1060 Linear Algebra Homework Exercises 1 1. Find the complete solutions (if any!) to each of the following systems of simultaneous equations: Homework Exercises 1 1 Find the complete solutions (if any!) to each of the following systems of simultaneous equations: (i) x 4y + 3z = 2 3x 11y + 13z = 3 2x 9y + 2z = 7 x 2y + 6z = 2 (ii) x 4y + 3z =

More information

INTRODUCTION TO COMPUTER METHODS FOR O.D.E.

INTRODUCTION TO COMPUTER METHODS FOR O.D.E. INTRODUCTION TO COMPUTER METHODS FOR O.D.E. 0. Introduction. The goal of this handout is to introduce some of the ideas behind the basic computer algorithms to approximate solutions to differential equations.

More information

AM205: Assignment 3 (due 5 PM, October 20)

AM205: Assignment 3 (due 5 PM, October 20) AM25: Assignment 3 (due 5 PM, October 2) For this assignment, first complete problems 1, 2, 3, and 4, and then complete either problem 5 (on theory) or problem 6 (on an application). If you submit answers

More information

Lecture 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations Lecture 8: Calculus and Differential Equations Dr. Mohammed Hawa Electrical Engineering Department University of Jordan EE201: Computer Applications. See Textbook Chapter 9. Numerical Methods MATLAB provides

More information

Lecture 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations Lecture 8: Calculus and Differential Equations Dr. Mohammed Hawa Electrical Engineering Department University of Jordan EE21: Computer Applications. See Textbook Chapter 9. Numerical Methods MATLAB provides

More information

MATH 215/255 Solutions to Additional Practice Problems April dy dt

MATH 215/255 Solutions to Additional Practice Problems April dy dt . For the nonlinear system MATH 5/55 Solutions to Additional Practice Problems April 08 dx dt = x( x y, dy dt = y(.5 y x, x 0, y 0, (a Show that if x(0 > 0 and y(0 = 0, then the solution (x(t, y(t of the

More information

21 Linear State-Space Representations

21 Linear State-Space Representations ME 132, Spring 25, UC Berkeley, A Packard 187 21 Linear State-Space Representations First, let s describe the most general type of dynamic system that we will consider/encounter in this class Systems may

More information

Math 266: Ordinary Differential Equations

Math 266: Ordinary Differential Equations Math 266: Ordinary Differential Equations Long Jin Purdue University, Spring 2018 Basic information Lectures: MWF 8:30-9:20(111)/9:30-10:20(121), UNIV 103 Instructor: Long Jin (long249@purdue.edu) Office

More information

Numerical Methods for Initial Value Problems; Harmonic Oscillators

Numerical Methods for Initial Value Problems; Harmonic Oscillators 1 Numerical Methods for Initial Value Problems; Harmonic Oscillators Lab Objective: Implement several basic numerical methods for initial value problems (IVPs), and use them to study harmonic oscillators.

More information

Applied Linear Algebra in Geoscience Using MATLAB

Applied Linear Algebra in Geoscience Using MATLAB Applied Linear Algebra in Geoscience Using MATLAB Contents Getting Started Creating Arrays Mathematical Operations with Arrays Using Script Files and Managing Data Two-Dimensional Plots Programming in

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 9 Initial Value Problems for Ordinary Differential Equations Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign

More information

Systems of Linear ODEs

Systems of Linear ODEs P a g e 1 Systems of Linear ODEs Systems of ordinary differential equations can be solved in much the same way as discrete dynamical systems if the differential equations are linear. We will focus here

More information

NUMERICAL SOLUTION OF ODE IVPs. Overview

NUMERICAL SOLUTION OF ODE IVPs. Overview NUMERICAL SOLUTION OF ODE IVPs 1 Quick review of direction fields Overview 2 A reminder about and 3 Important test: Is the ODE initial value problem? 4 Fundamental concepts: Euler s Method 5 Fundamental

More information

Modeling and Experimentation: Compound Pendulum

Modeling and Experimentation: Compound Pendulum Modeling and Experimentation: Compound Pendulum Prof. R.G. Longoria Department of Mechanical Engineering The University of Texas at Austin Fall 2014 Overview This lab focuses on developing a mathematical

More information

Part IB Numerical Analysis

Part IB Numerical Analysis Part IB Numerical Analysis Definitions Based on lectures by G. Moore Notes taken by Dexter Chua Lent 206 These notes are not endorsed by the lecturers, and I have modified them (often significantly) after

More information

MATH 4B Differential Equations, Fall 2016 Final Exam Study Guide

MATH 4B Differential Equations, Fall 2016 Final Exam Study Guide MATH 4B Differential Equations, Fall 2016 Final Exam Study Guide GENERAL INFORMATION AND FINAL EXAM RULES The exam will have a duration of 3 hours. No extra time will be given. Failing to submit your solutions

More information

Mathematical Models. MATH 365 Ordinary Differential Equations. J. Robert Buchanan. Spring Department of Mathematics

Mathematical Models. MATH 365 Ordinary Differential Equations. J. Robert Buchanan. Spring Department of Mathematics Mathematical Models MATH 365 Ordinary Differential Equations J. Robert Buchanan Department of Mathematics Spring 2018 Ordinary Differential Equations The topic of ordinary differential equations (ODEs)

More information

January 18, 2008 Steve Gu. Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,

January 18, 2008 Steve Gu. Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB, Introduction to MATLAB January 18, 2008 Steve Gu Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB, Part I: Basics MATLAB Environment Getting Help Variables Vectors, Matrices, and

More information

Computer lab for MAN460

Computer lab for MAN460 Computer lab for MAN460 (version 20th April 2006, corrected 20 May) Prerequisites Matlab is rather user friendly, and to do the first exercises, it is enough to write an m-file consisting of two lines,

More information

Mathematical Models. MATH 365 Ordinary Differential Equations. J. Robert Buchanan. Fall Department of Mathematics

Mathematical Models. MATH 365 Ordinary Differential Equations. J. Robert Buchanan. Fall Department of Mathematics Mathematical Models MATH 365 Ordinary Differential Equations J. Robert Buchanan Department of Mathematics Fall 2018 Ordinary Differential Equations The topic of ordinary differential equations (ODEs) is

More information

NUMERICAL METHODS. lor CHEMICAL ENGINEERS. Using Excel', VBA, and MATLAB* VICTOR J. LAW. CRC Press. Taylor & Francis Group

NUMERICAL METHODS. lor CHEMICAL ENGINEERS. Using Excel', VBA, and MATLAB* VICTOR J. LAW. CRC Press. Taylor & Francis Group NUMERICAL METHODS lor CHEMICAL ENGINEERS Using Excel', VBA, and MATLAB* VICTOR J. LAW CRC Press Taylor & Francis Group Boca Raton London New York CRC Press is an imprint of the Taylor & Francis Croup,

More information

Solutions to Final Exam Sample Problems, Math 246, Spring 2011

Solutions to Final Exam Sample Problems, Math 246, Spring 2011 Solutions to Final Exam Sample Problems, Math 246, Spring 2 () Consider the differential equation dy dt = (9 y2 )y 2 (a) Identify its equilibrium (stationary) points and classify their stability (b) Sketch

More information

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9 Lecture Notes to Accompany Scientific Computing An Introductory Survey Second Edition by Michael T. Heath Chapter 9 Initial Value Problems for Ordinary Differential Equations Copyright c 2001. Reproduction

More information

MATH 251 Week 6 Not collected, however you are encouraged to approach all problems to prepare for exam

MATH 251 Week 6 Not collected, however you are encouraged to approach all problems to prepare for exam MATH 51 Week 6 Not collected, however you are encouraged to approach all problems to prepare for exam A collection of previous exams could be found at the coordinator s web: http://www.math.psu.edu/tseng/class/m51samples.html

More information

First In-Class Exam Solutions Math 246, Professor David Levermore Thursday, 20 September 2018

First In-Class Exam Solutions Math 246, Professor David Levermore Thursday, 20 September 2018 First In-Class Exam Solutions Math 246, Professor David Levermore Thursday, 20 September 208 () [6] In the absence of predators the population of mosquitoes in a certain area would increase at a rate proportional

More information

20D - Homework Assignment 5

20D - Homework Assignment 5 Brian Bowers TA for Hui Sun MATH D Homework Assignment 5 November 8, 3 D - Homework Assignment 5 First, I present the list of all matrix row operations. We use combinations of these steps to row reduce

More information

Math 56 Homework 1 Michael Downs. ne n 10 + ne n (1)

Math 56 Homework 1 Michael Downs. ne n 10 + ne n (1) . Problem (a) Yes. The following equation: ne n + ne n () holds for all n R but, since we re only concerned with the asymptotic behavior as n, let us only consider n >. Dividing both sides by n( + ne n

More information

MS 3011 Exercises. December 11, 2013

MS 3011 Exercises. December 11, 2013 MS 3011 Exercises December 11, 2013 The exercises are divided into (A) easy (B) medium and (C) hard. If you are particularly interested I also have some projects at the end which will deepen your understanding

More information

Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations

Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations Ramses van Zon SciNet HPC Consortium November 25, 2014 Ramses van Zon (SciNet HPC Consortium)Research

More information

Differential Equations Spring 2007 Assignments

Differential Equations Spring 2007 Assignments Differential Equations Spring 2007 Assignments Homework 1, due 1/10/7 Read the first two chapters of the book up to the end of section 2.4. Prepare for the first quiz on Friday 10th January (material up

More information

Math Ordinary Differential Equations

Math Ordinary Differential Equations Math 411 - Ordinary Differential Equations Review Notes - 1 1 - Basic Theory A first order ordinary differential equation has the form x = f(t, x) (11) Here x = dx/dt Given an initial data x(t 0 ) = x

More information

Numerical Methods - Initial Value Problems for ODEs

Numerical Methods - Initial Value Problems for ODEs Numerical Methods - Initial Value Problems for ODEs Y. K. Goh Universiti Tunku Abdul Rahman 2013 Y. K. Goh (UTAR) Numerical Methods - Initial Value Problems for ODEs 2013 1 / 43 Outline 1 Initial Value

More information

Math 504 (Fall 2011) 1. (*) Consider the matrices

Math 504 (Fall 2011) 1. (*) Consider the matrices Math 504 (Fall 2011) Instructor: Emre Mengi Study Guide for Weeks 11-14 This homework concerns the following topics. Basic definitions and facts about eigenvalues and eigenvectors (Trefethen&Bau, Lecture

More information

Old Math 330 Exams. David M. McClendon. Department of Mathematics Ferris State University

Old Math 330 Exams. David M. McClendon. Department of Mathematics Ferris State University Old Math 330 Exams David M. McClendon Department of Mathematics Ferris State University Last updated to include exams from Fall 07 Contents Contents General information about these exams 3 Exams from Fall

More information

CDS 101 Precourse Phase Plane Analysis and Stability

CDS 101 Precourse Phase Plane Analysis and Stability CDS 101 Precourse Phase Plane Analysis and Stability Melvin Leok Control and Dynamical Systems California Institute of Technology Pasadena, CA, 26 September, 2002. mleok@cds.caltech.edu http://www.cds.caltech.edu/

More information

HOMEWORK 3: Phase portraits for Mathmatical Models, Analysis and Simulation, Fall 2010 Report due Mon Oct 4, Maximum score 7.0 pts.

HOMEWORK 3: Phase portraits for Mathmatical Models, Analysis and Simulation, Fall 2010 Report due Mon Oct 4, Maximum score 7.0 pts. HOMEWORK 3: Phase portraits for Mathmatical Models, Analysis and Simulation, Fall 2010 Report due Mon Oct 4, 2010. Maximum score 7.0 pts. Three problems are to be solved in this homework assignment. The

More information

Math 122L. Additional Homework Problems. Prepared by Sarah Schott

Math 122L. Additional Homework Problems. Prepared by Sarah Schott Math 22L Additional Homework Problems Prepared by Sarah Schott Contents Review of AP AB Differentiation Topics 4 L Hopital s Rule and Relative Rates of Growth 6 Riemann Sums 7 Definition of the Definite

More information

Computational Techniques Prof. Dr. Niket Kaisare Department of Chemical Engineering Indian Institute of Technology, Madras

Computational Techniques Prof. Dr. Niket Kaisare Department of Chemical Engineering Indian Institute of Technology, Madras Computational Techniques Prof. Dr. Niket Kaisare Department of Chemical Engineering Indian Institute of Technology, Madras Module No. # 07 Lecture No. # 05 Ordinary Differential Equations (Refer Slide

More information

Numerical Differential Equations: IVP

Numerical Differential Equations: IVP Chapter 11 Numerical Differential Equations: IVP **** 4/16/13 EC (Incomplete) 11.1 Initial Value Problem for Ordinary Differential Equations We consider the problem of numerically solving a differential

More information

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations An Overly Simplified and Brief Review of Differential Equation Solution Methods We will be dealing with initial or boundary value problems. A typical initial value problem has the form y y 0 y(0) 1 A typical

More information

Numerical Methods for the Solution of Differential Equations

Numerical Methods for the Solution of Differential Equations Numerical Methods for the Solution of Differential Equations Markus Grasmair Vienna, winter term 2011 2012 Analytical Solutions of Ordinary Differential Equations 1. Find the general solution of the differential

More information

Math 251 December 14, 2005 Answer Key to Final Exam. 1 18pt 2 16pt 3 12pt 4 14pt 5 12pt 6 14pt 7 14pt 8 16pt 9 20pt 10 14pt Total 150pt

Math 251 December 14, 2005 Answer Key to Final Exam. 1 18pt 2 16pt 3 12pt 4 14pt 5 12pt 6 14pt 7 14pt 8 16pt 9 20pt 10 14pt Total 150pt Name Section Math 51 December 14, 5 Answer Key to Final Exam There are 1 questions on this exam. Many of them have multiple parts. The point value of each question is indicated either at the beginning

More information

Section 9.3 Phase Plane Portraits (for Planar Systems)

Section 9.3 Phase Plane Portraits (for Planar Systems) Section 9.3 Phase Plane Portraits (for Planar Systems) Key Terms: Equilibrium point of planer system yꞌ = Ay o Equilibrium solution Exponential solutions o Half-line solutions Unstable solution Stable

More information

MB4018 Differential equations

MB4018 Differential equations MB4018 Differential equations Part II http://www.staff.ul.ie/natalia/mb4018.html Prof. Natalia Kopteva Spring 2015 MB4018 (Spring 2015) Differential equations Part II 0 / 69 Section 1 Second-Order Linear

More information

Polytechnic Institute of NYU MA 2132 Final Practice Answers Fall 2012

Polytechnic Institute of NYU MA 2132 Final Practice Answers Fall 2012 Polytechnic Institute of NYU MA Final Practice Answers Fall Studying from past or sample exams is NOT recommended. If you do, it should be only AFTER you know how to do all of the homework and worksheet

More information

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations ECE257 Numerical Methods and Scientific Computing Ordinary Differential Equations Today s s class: Stiffness Multistep Methods Stiff Equations Stiffness occurs in a problem where two or more independent

More information

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1 Lectures - Week 11 General First Order ODEs & Numerical Methods for IVPs In general, nonlinear problems are much more difficult to solve than linear ones. Unfortunately many phenomena exhibit nonlinear

More information

Solution: In standard form (i.e. y + P (t)y = Q(t)) we have y t y = cos(t)

Solution: In standard form (i.e. y + P (t)y = Q(t)) we have y t y = cos(t) Math 380 Practice Final Solutions This is longer than the actual exam, which will be 8 to 0 questions (some might be multiple choice). You are allowed up to two sheets of notes (both sides) and a calculator,

More information

Chapter 6 - Ordinary Differential Equations

Chapter 6 - Ordinary Differential Equations Chapter 6 - Ordinary Differential Equations 7.1 Solving Initial-Value Problems In this chapter, we will be interested in the solution of ordinary differential equations. Ordinary differential equations

More information

Review for Exam 2 Ben Wang and Mark Styczynski

Review for Exam 2 Ben Wang and Mark Styczynski Review for Exam Ben Wang and Mark Styczynski This is a rough approximation of what we went over in the review session. This is actually more detailed in portions than what we went over. Also, please note

More information

Exam in TMA4215 December 7th 2012

Exam in TMA4215 December 7th 2012 Norwegian University of Science and Technology Department of Mathematical Sciences Page of 9 Contact during the exam: Elena Celledoni, tlf. 7359354, cell phone 48238584 Exam in TMA425 December 7th 22 Allowed

More information

Numerical solution of ODEs

Numerical solution of ODEs Péter Nagy, Csaba Hős 2015. H-1111, Budapest, Műegyetem rkp. 3. D building. 3 rd floor Tel: 00 36 1 463 16 80 Fax: 00 36 1 463 30 91 www.hds.bme.hu Table of contents Homework Introduction to Matlab programming

More information

Lecture 4: Numerical solution of ordinary differential equations

Lecture 4: Numerical solution of ordinary differential equations Lecture 4: Numerical solution of ordinary differential equations Department of Mathematics, ETH Zürich General explicit one-step method: Consistency; Stability; Convergence. High-order methods: Taylor

More information

Elementary Differential Equations

Elementary Differential Equations Elementary Differential Equations George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 310 George Voutsadakis (LSSU) Differential Equations January 2014 1 /

More information

Chapter 4: First-order differential equations. Similarity and Transport Phenomena in Fluid Dynamics Christophe Ancey

Chapter 4: First-order differential equations. Similarity and Transport Phenomena in Fluid Dynamics Christophe Ancey Chapter 4: First-order differential equations Similarity and Transport Phenomena in Fluid Dynamics Christophe Ancey Chapter 4: First-order differential equations Phase portrait Singular point Separatrix

More information

Math 331 Homework Assignment Chapter 7 Page 1 of 9

Math 331 Homework Assignment Chapter 7 Page 1 of 9 Math Homework Assignment Chapter 7 Page of 9 Instructions: Please make sure to demonstrate every step in your calculations. Return your answers including this homework sheet back to the instructor as a

More information

CHAPTER 5: Linear Multistep Methods

CHAPTER 5: Linear Multistep Methods CHAPTER 5: Linear Multistep Methods Multistep: use information from many steps Higher order possible with fewer function evaluations than with RK. Convenient error estimates. Changing stepsize or order

More information

Numerical Methods for Ordinary Differential Equations

Numerical Methods for Ordinary Differential Equations CHAPTER 1 Numerical Methods for Ordinary Differential Equations In this chapter we discuss numerical method for ODE. We will discuss the two basic methods, Euler s Method and Runge-Kutta Method. 1. Numerical

More information

Problem set 7 Math 207A, Fall 2011 Solutions

Problem set 7 Math 207A, Fall 2011 Solutions Problem set 7 Math 207A, Fall 2011 s 1. Classify the equilibrium (x, y) = (0, 0) of the system x t = x, y t = y + x 2. Is the equilibrium hyperbolic? Find an equation for the trajectories in (x, y)- phase

More information

Math 215/255 Final Exam (Dec 2005)

Math 215/255 Final Exam (Dec 2005) Exam (Dec 2005) Last Student #: First name: Signature: Circle your section #: Burggraf=0, Peterson=02, Khadra=03, Burghelea=04, Li=05 I have read and understood the instructions below: Please sign: Instructions:.

More information

Chapter 4. Systems of ODEs. Phase Plane. Qualitative Methods

Chapter 4. Systems of ODEs. Phase Plane. Qualitative Methods Chapter 4 Systems of ODEs. Phase Plane. Qualitative Methods Contents 4.0 Basics of Matrices and Vectors 4.1 Systems of ODEs as Models 4.2 Basic Theory of Systems of ODEs 4.3 Constant-Coefficient Systems.

More information

Section 2.1 Differential Equation and Solutions

Section 2.1 Differential Equation and Solutions Section 2.1 Differential Equation and Solutions Key Terms: Ordinary Differential Equation (ODE) Independent Variable Order of a DE Partial Differential Equation (PDE) Normal Form Solution General Solution

More information