We begin exploring Euler s method by looking at direction fields. Consider the direction field below.

Similar documents
Section 2.1 Differential Equation and Solutions

Chapter 2: First Order DE 2.4 Linear vs. Nonlinear DEs

2.1 Differential Equations and Solutions. Blerina Xhabli

Numerical method for approximating the solution of an IVP. Euler Algorithm (the simplest approximation method)

Chapter 1: Introduction

Numerical method for approximating the solution of an IVP. Euler Algorithm (the simplest approximation method)

Introduction to Initial Value Problems

Solutions to Homework 3

Section 7.4 Runge-Kutta Methods

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

Summer 2017 Session 1 Math 2410Q (Section 10) Elementary Differential Equations M-Th 4:45pm-7:00pm

Math Homework 3 Solutions. (1 y sin x) dx + (cos x) dy = 0. = sin x =

DON T PANIC! If you get stuck, take a deep breath and go on to the next question. Come back to the question you left if you have time at the end.

Chapter 4. A simple method for solving first order equations numerically

Numerical methods for solving ODEs

2.2 Separable Equations

Parametric Equations, Function Composition and the Chain Rule: A Worksheet

Math Applied Differential Equations

Lecture 31. Basic Theory of First Order Linear Systems

On linear and non-linear equations. (Sect. 1.6).

Topic 2-2: Derivatives of Vector Functions. Textbook: Section 13.2, 13.4

Question Details Secant Formula 1 [ ]

DIFFERENTIAL EQUATIONS

Homogeneous Equations with Constant Coefficients

Polytechnic Institute of NYU MA 2132 Final Practice Answers Fall 2012

Linear Variable coefficient equations (Sect. 1.2) Review: Linear constant coefficient equations

Simulink Tutorial 1 CPE562

Question Details Secant Formula 1 [ ]

On linear and non-linear equations.(sect. 2.4).

Lecture 2. Classification of Differential Equations and Method of Integrating Factors

As in the previous problem, the height of a object thrown straight up is given by

Chapter 2 Notes, Kohler & Johnson 2e

Ordinary Differential Equations I

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

Euler s Method (BC Only)

. For each initial condition y(0) = y 0, there exists a. unique solution. In fact, given any point (x, y), there is a unique curve through this point,

Calculus I Homework: The Tangent and Velocity Problems Page 1

Math Week 1 notes

Calculus II Practice Test Questions for Chapter , 9.6, Page 1 of 9

INTRODUCTION TO COMPUTER METHODS FOR O.D.E.

Additional Homework Problems

Question Details Secant Formula 1 [ ]

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

1.2. Direction Fields: Graphical Representation of the ODE and its Solution Let us consider a first order differential equation of the form dy

Math 308 Week 8 Solutions

Ordinary Differential Equations I

2. A Motivational Example: Consider the second-order homogeneous linear DE: y y 2y = 0

Series Solutions Near an Ordinary Point

Solution: (a) Before opening the parachute, the differential equation is given by: dv dt. = v. v(0) = 0

9.2 Euler s Method. (1) t k = a + kh for k = 0, 1,..., M where h = b a. The value h is called the step size. We now proceed to solve approximately

Functions of Several Variables

Homework Solutions: , plus Substitutions

Solutions of Math 53 Midterm Exam I

Linear Filters and Convolution. Ahmed Ashraf

y x arctan x arctan x x dx 2 ln by first expressing the integral as an iterated integral. f t dt dz dy 1 2 y x x t 2 f t dt F 2 Gm d 1 d 1 sr 2 d 2

Chapter 9b: Numerical Methods for Calculus and Differential Equations. Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers

problem score possible Total 60

Name Class. 5. Find the particular solution to given the general solution y C cos x and the. x 2 y

Ex. Find the derivative. Do not leave negative exponents or complex fractions in your answers.

DIFFERENTIATION RULES

First Order ODEs, Part II

Name: Solutions Final Exam

Linear Variable coefficient equations (Sect. 2.1) Review: Linear constant coefficient equations

Ordinary Differential Equations I

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

Euler s Method, Taylor Series Method, Runge Kutta Methods, Multi-Step Methods and Stability.

APPM 2360: Midterm exam 1 February 15, 2017

dy dt = ty, y(0) = 3. (1)

µ = e R p(t)dt where C is an arbitrary constant. In the presence of an initial value condition

Ordinary Differential Equations (ODEs)

Lecture Notes in Mathematics. Arkansas Tech University Department of Mathematics

APPLICATIONS OF FD APPROXIMATIONS FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS

Math 252 Fall 2002 Supplement on Euler s Method

10.3 Parametric Equations. 1 Math 1432 Dr. Almus

Calculus and Parametric Equations

Section 4.7: Variable-Coefficient Equations

Linear Independence and the Wronskian

MATH 200 WEEK 5 - WEDNESDAY DIRECTIONAL DERIVATIVE

1 Antiderivatives graphically and numerically

Midterm 1 Review. Distance = (x 1 x 0 ) 2 + (y 1 y 0 ) 2.

Solution Manual for: Numerical Computing with MATLAB by Cleve B. Moler

The Princeton Review AP Calculus BC Practice Test 2

Parametric Curves. Calculus 2 Lia Vas

(1 + 2y)y = x. ( x. The right-hand side is a standard integral, so in the end we have the implicit solution. y(x) + y 2 (x) = x2 2 +C.

Unit 5 Applications of Antidifferentiation

MTH 452/552 Homework 3

Math Lab 10: Differential Equations and Direction Fields Complete before class Wed. Feb. 28; Due noon Thu. Mar. 1 in class

ETNA Kent State University

2.7 Implicit Differentiation and Related Rates Math 125

Math53: Ordinary Differential Equations Autumn 2004

dx dx x sec tan d 1 4 tan 2 2 csc d 2 ln 2 x 2 5x 6 C 2 ln 2 ln x ln x 3 x 2 C Now, suppose you had observed that x 3

Systems of Ordinary Differential Equations

Solving systems of ODEs with Matlab

Section 6.4 DEs with Discontinuous Forcing Functions

Multistep Methods for IVPs. t 0 < t < T

The Euler Method for the Initial Value Problem

University of Alberta ENGM 541: Modeling and Simulation of Engineering Systems Laboratory #5

dy dt = 1 y t 1 +t 2 y dy = 1 +t 2 dt 1 2 y2 = 1 2 ln(1 +t2 ) +C, y = ln(1 +t 2 ) + 9.

PREMUR Seminar Week 2 Discussions - Polynomial Division, Gröbner Bases, First Applications

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

Transcription:

Emma Reid- MA 66, Lesson 9 (SU 17) Euler s Method (.7) So far in this course, we have seen some very special types of first order ODEs. We ve seen methods to solve linear, separable, homogeneous, Bernoulli, and exact equations. Some of these methods don t even guarantee us an explicit solution, but rather give us a solution implicitly. These are very special types of first order ODEs. Given an arbitrary IVP, while we can employ the existence and uniqueness theorem to show that a solution (or even possibly a unique solution) exists, we may not be able to find a formula for such a solution - even implicitly! This is where numerical methods come into play. Numerical methods are techniques which can be used to approximate solutions to IVPs numerically without ever expressly finding an equation representing the solution. While it is often handy to find actual equations representing solutions, in the real world (physics, engineering, biology, chemistry, etc.), we usually only need an approximation which is accurate to several decimal places. Today, we are covering a particular technique developed by Swiss mathematician Leonhard Euler (1707-1783), which we call Euler s Method. Other techniques exist, but will not be discussed in this course. We begin exploring Euler s method by looking at direction fields. Consider the direction field below. We can imagine approximating solutions by a sort of connect the dots type method, where we connect the small tangent line segments. You probably already imagined doing things like this when we studied direction fields in lesson 1! And this is the basic idea behind Euler s Method: We approximate solutions by using small line segments based on the slope. 1

Euler s Method Given an IVP dy dt = f (t, y), y (t 0) = y 0, we take small steps, creating tangent lines along the way: We begin by taking f (t 0, y 0 ). This is a slope for a tangent line to the actual solution. We have a slope and a point, so we can form the line y tangent = y 0 + f (t 0, y 0 ) (t t 0 ). Then, given any fixed value t = s, we can approximate y (s) by looking at y tangent (s). Of course, this approximation is only good when s is very close to t 0. This tangent line will likely get quite far off from the function as t moves away from t 0. As such, we break up our process into small tangent line segments. We are given time t 0 and solution value y 0. Choose another time t 1. We can form the line y tangent = y 0 + f (t 0, y 0 ) (t t 0 ). We can then approximate y (t 1 ) by taking y 1 = y 0 + f (t 0, y 0 ) (t 1 t 0 ). This gives us a point (t 1, y 1 ) on this initial tangent line. We can then find the value of the slope field at this point (t 1, y 1 ), and make another tangent line from this point to a point at t, etc. Repeating this process, we obtain the equation y n+1 = y n + f(t n, y n ) (t n+1 t n ) for any n 0. Often, we will make our process very regular, and increment t-values by a constant, which we will call h. This simplifies the above formula to y(t n+1 ) y n+1 = y n + f(t n, y n ) h Overall, this is what this process looks like, geometrically speaking: The smaller that h is, the more accurate our approximations will be. But, for smaller h, the amount and difficulty of our computations grow.

Example 1. Use Euler s method with step size h = 1/ to approximate y () for the initial value problem dy = y + sin (πt), y (0) = dt We start by noticing t 0 = 0 and y 0 =. Then t 1 = t 0 + h = 0 + 1 = 1 y = y(t 1 ) y 1 = y 0 + f (t 0, y 0 ) h = + ( + sin (0)) = 3 Then t = t 1 + h = 1 + 1 = 1 y(1) = y(t ) y = y 1 + f (t 1, y 1 ) h ( ( π )) = 3 + 3 + sin = 4 Then t 3 = t + h = 1 + 1 = 3 Then t 4 = t 3 + h = 3 + 1 = ( ) 3 y = y(t 3 ) y 3 = y + f (t, y ) h = 4 + ( 4 + sin (π)) = 6 y() = y(t 4 ) y 4 = y 3 + f (t 3, y 3 ) h ( = 6 + 6 + sin = 19 = 9.5 ( )) 3π Our goal was to approximate y (), so we are done. y() 9.5. 3

As we can see this process is quite tedious. You will be able to use MATLAB for your homework, but you should still understand and be able to compute simple calculations using Euler s method by hand. The information to use MATLAB for Euler s method can be found on the Numerical Methods document on the course webpage. All ITaP computers come equipped with eul.m when using MATLAB version r014a x64. Basic procedure: Create a new.m file. In the code, make sure the following is typed in, but make sure to edit the parts between and (do not include or in the actual text). function W= function name (t,y) W= insert y here ; Then save the.m file as function name.m Next, go to the command line in MATLAB and type: [t,y]=eul( function name,[initial t value, final t value],initial y value, step size); Now, to display the approximation for y at each of the t-values, type into the command line: [t,y] Example. Use Euler s method with step size h = 0.1 to approximate y (4) for the initial value problem dy dt = 4 ty 1 + y, y (0) = 1 We start in MATLAB by creating a new function.m file. We enter the following information into MATLAB: function W=fcn(t,y) W=(4-t*y)/(1+yˆ); You then save the file as fcn.m Returning to the MATLAB prompt, you type in the following command: [t,y]=eul( fcn,[0,4],1,0.1); Typing in the command [t,y] will then give you the values. 4

Example 3. (THIS IS PART OF YOUR HOMEWORK). Assume we are working with the differential equation y = 1 t + y. Using the Euler formula, show that y k = (1 + h) y k 1 + h ht k 1, for k = 1,,... We begin with the fact that the Euler formula is y n = y n 1 + f n 1 (t n t n 1 ) Recall that f n 1 = f (t n 1, y n 1 ) = 1 t n 1 + y n 1 in this case. Thus, y k = y k 1 + (1 t k 1 + y k 1 ) (t k t k 1 ) = y k 1 + t k t k 1 t k + y k 1 t k t k 1 + t k 1 y k 1 t k 1 = y k 1 + y k 1 t k y k 1 t k 1 + t k t k 1 t k 1 t k + t k 1 = (1 + t k t k 1 ) y k 1 + (t k t k 1 ) (t k t k 1 ) t k 1 = (1 + h) y k 1 + h ht k 1 For this problem, even though you don t have to do part (c), you should use the results of part (c) when doing part (d). 5