- 134 Views
- Uploaded on
- Presentation posted in: General

MA2213 Lecture 10

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

MA2213 Lecture 10

ODE

Topics

Importance p. 367-368

Introduction to the theory p. 368-373

Analytic solutions p. 368-372

Existence of solutions p. 372

Direction fields p. 376-379

Numerical methods

Forward Euler p. 383

Richardson’s extrapolation formula p. 391

Systems of equations p. 432

Two point boundary value problems p. 442

Importance

“Differential equations are among the most

important mathematical tools used in producing

models of physical and biological sciences, and

engineering.” They can be classified into:

Ordinary :

have 1 independent variable

Partial :

have > 1 independent variable

wave equation

heat equation

Analytic Solutions

Integration

Integrating Factors

Separation of Variables

Existence of Solutions

Theorem 8.1.3 (page 372) Let

and

be continuous functions of

and

at all points

in some neighborhood of

Then there is a unique function

satisfying

defined on some interval

Example 8.1.4 (p. 372) The initial value problem

admits the solution

Direction Fields

At any point (x,y) on the graph of a solution of the

the slope is

equation

Direction fields illustrate these slopes.

Example 8.1.8 (page 376) Consider

The slope at (x,y) is y (independent of x).

[x,y] = meshgrid(-2:0.5:2,-2:0.5:2);

dx = ones(9); % Generates a mesh of 1’s

dy = y; quiver(x,y,dx,dy);

xlabel('x coordinate axis')

ylabel(y coordinate axis')

title(' direction field v = [1 y]^T ')

Direction Field

Solution Curves

The solutions of

are

hold on

x = -2:0.01:1;;

y1 = exp(x);

y2=-exp(x);

plot(x,y1,x,y2)

hold off

Direction Field with Two Solution Curves

Let

be the solution of the initial value problem

Numerical methods will give an approximate solution at

a discrete set of nodes

For simplicity we choose evenly spaced nodes

Taylor’s approximation

gives the forward Euler method for approximations

Let

be the solution of the initial value problem

For nodes

forward Euler method gives approximations

so

Let

be the solution of the initial value problem

For nodes

the exact solution is

and the numerical approximation equals

therefore we have the error

It can be shown, using an analysis similar to the one on

the preceding page, that the numerical solution obtained

using the forward Euler method with step size satisfies

therefore, the approximation using step size satisfies

These two estimates can be combined to give

which has a much smaller error than

This process can be extended as in slides 36,40 Lect 7.

The general form of a system of two first-order

differential equations is (page 432)

This system can be simply represented using vectors

For the system of two equations in slide 3

and the solution of the initial value problem is

Y0 = [1;0];

h = 0.001;

N = round(1000*2*pi);

x0 = 0;

Y(:,1) = Y0; x(1) = x0;

for n = 1:N

x(n+1) = x(n)+h;

f = [-Y(2,n);Y(1,n)];

Y(:,n+1) = Y(:,n) + h*f;

end

figure(1); plot(x,Y(1,:),x,Y(2,:)); grid;

title(‘approximate solution’)

figure(2); plot(x,Y(1,:)-cos(x),x,Y(2,:)-sin(x)); grid;

title(‘error’)

A second-order linear boundary value problem (p. 442)

can be discretized. We choose

nodes

let

to obtain linear equations for

1. The logistic equation

was proposed as a model for population growth

by Peirre Verhulst in 1838. Draw its direction fields

and solution curves for Y(0) = .5K and Y(0)=1.5K.

2. Implement the forward Euler method to compute the two solutions above. Use plots and tables to show how Richardson extrapolation decreases the errors.

3. Study the Lotka-Volterra predator-prey model on page 433 and then do problem 9 on page 441. Extra Credit: Use the secant method to compute the smallest x > 0 so that Y(x) = Y(0)where Y is the solution in part (b).

4. Write the MATLAB Program on page 445, study pages 446-448, and do problem 7 on page 449.

(Extrapolated means Richardson extrapolated)