Math Lecture 1251 UNSW
uploaded 1 for 1

© All Rights Reserved

Als PDF, TXT **herunterladen** oder online auf Scribd lesen

26 Aufrufe

Math Lecture 1251 UNSW
uploaded 1 for 1

© All Rights Reserved

Als PDF, TXT **herunterladen** oder online auf Scribd lesen

- Ordinary Differential Equations
- PDE Full Solutions
- SE CSE IT Syllabus SolapurUniversity
- Transient Circuit Analysis
- moyer math - algebra i - gp 03-31-14
- MATH226.1x_Syllabus
- VarCalc
- DE
- MIT18_03SCF11_s1_6text
- Linear First Order ODE
- TC Kinematic
- 9 - formal lesson plan i
- SimuPlot5 Manual
- 7.Partial Differential Equations of Order Two With Variable Coefficients md raisinghnai
- Variational Symmetries of Lagrangians
- Module 4 B
- 2006 an Iterative Method for Solving Nonlinear Functional Equations
- Pressure Swing Adsorption_ Solve Coupled Partial Differential Equation System With ODE-Solver and Method of Lines - MATLAB Answers - MATLAB Central
- Apendice c Matlab
- Solution Manual for Elementary Differential Equations With Boundary Value Problems 2nd Edition by Kohler

Sie sind auf Seite 1von 26

MATH1251 Calculus

Chapter 2: Oridinary Differential Equations

Separable ODEs

First order linear ODEs

Exact ODEs

Substitutions for ODEs

Modelling with first order ODEs

The homogeneous case

The non-homogeneous case

Modelling with second order ODEs

Numerical methods

School of Mathematics and Statistics

The University of New South Wales

Sydney, Australia

Red Centre Room 4061

Email: thanh.tran@unsw.edu.au

General form

Definition 1

An ordinary differential equation or ODE is an equation involving one

independent real variable (e.g. x R), one dependent real variable

(e.g. u : R R) and finitely many of its derivatives. Thus it is of the

form

F (x, u(x), u (x), . . . , u (n) (x)) = 0.

(1)

function with one or more of its derivatives.

When only ordinary derivatives, rather than partial derivatives, are

involved, the equations are called ordinary differential equations

(ODEs).

Example 2

differential equations (PDEs). They are not studied in this course.

u (x) = 2u(x) + 3x

u (x) = u (x) + u 2 (x) + x 3

Notation

Motivation

Rather than

world. Mostly, these models are mathematical models which allow

prediction of future or distant quantities.

we can write

y (x) = y (x) + xy 2 (x) + x 3

differential equations. These were the growth-decay equation,

y = y + xy 2 + x 3

d 2y

dy

+ xy 2 + x 3

=

dx

dx 2

= u + tu 2 + t 3

u

dP

= kP

dt

and the simple harmonic motion equation

structure of the equation. Thus the general form (1) can also be written

as

F (x, y, y , . . . , y (n) ) = 0.

ODEs and IVPs

d 2x

= n2 x.

dt 2

More important equations:

5

Order of an ODE

Definition 3

Black and Scholes equation (1973).

V

1

2V

V

+ 2 S 2 2 + rS

rV = 0

t

2

S

S

Example 4

dy

dx

y + 2xy

2

dy

+y

dx

y + xy

2 3

d y

+ y 5y

dx 2

~2 2

i~ (~x , t) =

t

2m

Nobel Prize for Physics (1933).

= y + x 2,

= 0,

= 0,

= sin y,

= ex .

8

Linear ODEs

Which equations in Example 4 are linear?

Linear first order ODEs can always be solved by using an integrating

factor. This will be discussed in the next section.

Definition 5

An nth order ODE is said to be linear if it is a linear combination of the

first n derivatives of the dependent function

solution may be found if one can solve a certain nth degree

polynomial equation; see Section 3.

d ny

d n2 y

dy

d n1 y

+ an1 (x) n1 + an2 (x) n2 + . . . + a1 (x)

+ a0 (x)y = f (x).

dx n

dx

dx

dx

If f (x) 0 the ODE is homogeneous.

are studied in MATH2130.

10

Solution to an ODE

Implicit solution

Definition 6

Example 8

given equation.

Example 7

Show that y =

y + tan1 y =

x4

2

5x 2 is a solution to y = y + x 3 .

2

x

is a solution to

y =

11

x2

2

x(1 + y 2 )

.

2 + y2

12

Example 10

Solve y = ex given y(0) = 3 and y (0) = 2.

Definition 9

An initial value problem is an ODE of order n together with a set of

values of the solution and its derivatives up to its first (n 1)

derivatives at some fixed point. These values are called the initial

conditions of the IVP. More precisely, an IVP reads as: Find a function

y satisfying

F (x, y, y , . . . , y (n) ) = 0,

y(x0 ) = C0 ,

y (x0 ) = C1 ,

...,

13

14

Example 12

Example 11

1

y = xy

y = x 2 /2 + 1;

y(1) = 2

and y = x 3 ;

namely, y = 1 + cx where c is an arbitrary constant;

Let f (x, y) = xy. Then the slope of the solution curve at the point (1, 2)

is f (1, 2) = 2. The slope of the solution curve at a point (x, y) is f (x, y).

This helps to get an idea how the solution curve looks like near the

point (1, 2). Graph: . . .

15

16

(cont.)

Remarks

There is no universal method for solving ODEs. For some ODEs it

may not even be possible to find an implicit solution. In this case

one has to resort to numerical methods to find an approximate

solution. Two simple numerical methods will be presented in the

last section. More efficient methods are topics of higher year

courses (e.g., MATH2301).

Theorem 13

Assume that f : R2 R is continuous. If on some rectangle S

containing (x0 , y0 ) there is an M > 0 such that

|f (x, y1 ) f (x, y2 )| M|y1 y2 | for all (x, y1 ) S, (x, y2 ) S,

then the IVP

first order ODEs, namely, separable equations, linear equations,

and exact equations.

y = f (x, y)

y(x0 ) = y0

We will also learn how to solve second order ODEs with constant

coefficients.

17

Separable ODEs

18

Letting h(y) = 1/H(y), we can rewrite (2) as

Definition 14

A separable equation has the form

dy

= g(x)H(y),

dx

h(y)

(2)

Example 15

Which of the following equations is separable?

q

dy

= x 1 y2

dx

dy

= ex+y

dx

dy

= ln(xy).

dx

First order ODEs

Separable ODEs

dy

= g(x).

dx

Z

Z

dy

h(y)

dx = g(x) dx

dx

or

Z

Z

h(y) dy = g(x) dx.

Carry out the integrations and try to find an explicit expression of y

as a function of x if possible.

If we have the IVP defined with y(x0 ) = y0 then we obtain

Z y

Z x

h(s) ds =

g(t) dt.

y0

19

x0

Separable ODEs

20

Example 17

Example 16

Solve y = x

Solve

1 y 2.

y =

Separable ODEs

21

Example 19

Solve

dy

+ f (x)y = g(x),

dx

ey

,

x2 + 1

y(0) = 1.

Separable ODEs

22

24

dy

+ 3y = ex .

dx

Solution technique

Calculate the integrating factor: h(x) = e

constant of integration).

f (x) dx

(ignoring the

Multiply the given equation by h(x) and use the product rule for

differentiation for the left-hand side to rewrite the resulting

equation as

d

h(x)y = g(x)h(x).

dx

Integrate both sides. Dont forget the constant of integration!

First order ODEs

23

Example 20

Solve

Example 21

y

dy

+ = x subject to y = 4 when x = 3.

dx

x

Solve x

25

Exact equations

dy

+ (x + 1)y = 2.

dx

If

M=

dy

M(x, y) + N(x, y)

= 0.

dx

d

If the left-hand side can be written as

F (x, y(x)) then the

dx

equation has a solution in implicit form F (x, y) = C.

(3)

and N =

F

,

y

(4)

solution to (3) was F (x, y) = C.

2F

2F

=

. This together with (4) implies

xy

yx

continuous, then

F (x, y) = C,

which defines y implicitly in terms of x. By differentiating with

respect to x we obtain

N

M

=

.

y

x

F

F dy

+

= 0.

x

y dx

Exact ODEs

F

x

26

exists?

any constant C, consider the expression

It turns out that the above condition is also sufficient for F to exist.

27

Exact ODEs

28

Example 23

Solve (2x + y + 1)dx + (2y + x + 1)dy = 0.

Definition 22

An ODE of the form

M(x, y) + N(x, y)

is called exact if

dy

=0

dx

(5)

N

M

=

.

y

x

Note

Equation (5) is also written in the form

M(x, y)dx + N(x, y)dy = 0.

Exact ODEs

29

Exact ODEs

30

(6)

(7)

(8)

Example 24

(9)

Solve

2xy + 3x 2 y 2

dy

.

= 2

dx

x + 2x 3 y + 1

Note

We can first integrate (7) with respect to y (treating x as a constant),

then compute F /x and compare with (6). Note that the constant (cf.

(8)) is C1 (x).

Exact ODEs

31

Exact ODEs

32

(10)

Example 25

Solve

(x 2 y + y 3 )

dy

+ xy 2 + sinh(2x) = 0.

dx

(12)

Exact ODEs

33

Exact ODEs

34

(13)

(14)

Substitutions

(15)

use a change of variables so that the ODE in the new variables is

linear, separable or exact.

y

dy

Equation of the form

=g

dx

x

Setting y(x) = xv(x) will lead to a separable ODE.

Proof: Differentiating y = vx with respect to x and substituting into the

given equation yield

dv

x + v = g(v),

dx

or

dv

g(v) v

=

.

dx

x

This is a separable equation.

Exact ODEs

35

36

Example 26

Solve

dy

+ x 2 + y 2 = 0.

2xy

dx

y

dy

=g

?

dx

x

To check if the ODE

dy

= F (x, y)

dx

y

dy

or not, check whether F is homogeneous of

=g

is of the form

dx

x

degree 0, that is,

F (x, y) = F (x, y)

37

Example 27

Solve

R.

38

Example 28

y y2 + x2

dy

= sin

.

dx

x y2 x2

2xy y = 10x 3 y 5

into a linear equation. Then solve the ODE.

39

40

Example 29

A dead body is discovered by a cleaner in a hotel room at 11am. A

forensic scientist arrives at the scene at 11.30am and records the

temperature of the body at 24.5 C. The body temperature is recorded

again an hour later at 24.0 C. Estimate the time of death given that the

hotel room is at constant temperature 20 C and normal body

temperature is 36.5 C.

between the temperature of an object and its surroundings

dT

= k (T (t) TA )

dt

where

TA is the ambient temperature in C

T (t) is the temperature of object after time t

k is some unknown proportionality constant

This is widely used in forensics.

41

42

Mixing problems

Example 30

Initially 50 grams of salt is dissolved in a tank holding 300 litres of

water. A brine solution is pumped into the tank at a rate of 3 litres/min

and the well-stirred solution is then pumped out at a slower rate of 2

litres/min. If the concentration of the solution entering is 2 grams/litre,

determine the amount of salt in the tank at any time.

43

44

45

46

47

48

Population models

Example 31

A culture initially has x0 bacteria. At t = 1 hour the number of bacteria

is measured to be 32 x0 . If the rate at which bacteria grows is

proportional to the number of bacteria present, determine the time

necessary for the number of bacteria to triple.

MATH1231/1241 Notes

dP

= kP for k > 0 (Malthus 1798);

Exponential growth:

dt

Bounded growth:

y + ay + by = 0

where y = y(x) is an unknown function, a and b are constants.

dP

= k(Pc P);

dt

y + ay + by = f (x)

Logistic growth:

dP

= kP(Pc P) (Verhulst 1838).

dt

f (x) is a given function.

49

50

Lemma 32

If y1 and y2 are two solutions of (HE) then so is Ay1 + By2 where A and

B are constants.

Lemma 33

(HE) has two linearly independent solutions, and every solution is a

linear combination of these solutions.

Proof: See e.g. MATH2601, MATH2221.

51

52

Example 34

Solve y 5y + 6y = 0.

Rewrite (HE): y + ay + by = 0.

Look for a solution that does not change too much when

differentiated so that the terms on the left-hand side cancel each

other out to give zero.

Try y = ex where is a constant to be determined.

Differentiate and substitute into (HE):

ex 2 + a + b = 0,

2 + a + b = 0.

(16)

of (16). This equation is called the characteristic equation of (HE).

Second order ODEs

53

y1 = e(+i)x = ex eix

y1 + y2

eix

= ex

2

ix

y1 y2

x e

z2 =

=e

2

A, B R;

z1 =

Case 2: If the characteristic equation (16) has one double root ,

then y1 = e1 x . It turns out that y2 = xe1 x is another solution to

(HE). Hence, the general solution to (HE) is

Let

y = Aex + Bxex ,

54

and y2 = e2 x

y = Ae1 x + Be2 x ,

1 = + i and 2 = i, then

solutions 1 and 2 , then

y1 = e1 x

+ eix

= ex cos x

2

eix

= ex sin x.

2

(HE). They are linearly independent; hence, the general solution

to (HE) is

y = ex A cos x + B sin x , A, B R.

A, B R.

55

56

Summary

Example 35

Solve the IVP

y 4y 5y = 0,

Characteristic equation

2 + a + b = 0

1 6= 2 R

1 = 2 (= )

1 = + i, 2 = i

y + ay + by = 0

y = Ae1 x + Be2 x

y = Aex + Bxex

y = ex A cos x + B sin x

57

Example 36

58

Example 37

y + 6y + 9y = 0,

y(0) = 0, y (0) = 5.

59

60

Example 40

Solve y 5y + 6y = 6x + 7.

Lemma 38

If y1 and y2 are solutions of (NE) then y1 y2 is a solution of (HE).

Proof: Exercise!

Lemma 39

The general solution of (NE) is given by y = yh + yp where yh is the

general solution of (HE) and yp is a particular solution of (NE).

We have learnt how to find yh .

How to find a particular solution yp of (NE)?

61

62

Example 41

If an (NE) has right-hand side

f (x) = xe2x + 4x cos(5x)

P(x) (polynomial of degree n)

P(x)ekx

P(x)ekx cos(x)

P(x)ekx sin(x)

Q(x) (polynomial of degree n)

Q(x)ekx

ekx Q1 (x) cos(x) + Q2 (x) sin(x)

ekx Q1 (x) cos(x) + Q2 (x) sin(x)

and

yh = (A + Bx)e2x ,

what is a guess for yp ?

Note

If any term of the guess for yp is part of yh , then multiply that term

by x.

If the new guess is still part of yh , multiply by x again.

63

64

Example 42

Solve y + y = x 2 + x.

65

66

67

68

Example 43

Solve y + 4y + 4y = e2x .

Example 44

Solve y + y = cos x such that y(0) = 3 and y (0) = 0.

69

70

Example 45

distance of 4 units and then released from rest, find x(t) when t 0.

P and that an object of mass m is suspended

from the spring. Let x denote the vertical

displacement from the equilibrium position of the

object, taking x to be positive if it lies above the

equilibrium position.

It can be shown (by using Newtons second law

of motion and Hookes law) that

x (t) + 2 x(t) = 0,

where A and B are constants.

A = 4. Since

x (t) + 2 x(t) = 0

x (0) = 0.

2 + 2 = 0,

which has two complex solutions = i.

m and the stiffness of the spring. We ignore

gravity, friction, and air resistance.

Second order ODEs

x(0) = 4,

71

B = 0. Therefore x(t) = 4 cos t.

Second order ODEs

72

consider two different cases.

Case 1: 6= . We look for a particular solution in the form

If the point P vibrates up and down and the

displacement is given by 2 sin t, then it can be

shown that x obeys the differential equation

x (t) + 2 x(t) = 2 sin t.

sin t

yp = C cos t + D sin t.

2 2 C cos t + 2 2 D sin t = 2 sin t.

x(0) = 4 and x (0) = 0.

equation is yh = A cos t + B sin t; see Example 45.

Hence

73

2 sin t

yp = 2

.

2

74

y = yh + yp = A cos t + B sin t + yp .

Case 1: 6= . Then

2

sin t,

2 2

2

cos t.

y = A sin t + B cos t + 2

2

y = A cos t + B sin t +

t cos t

yp =

.

yp = Ct cos t + Dt sin t.

2

.

2 2

75

76

Case 2: = . Then

Since y (0) = 0 the second equation gives

1

t cos t,

1

y = A sin t + B cos t cos t + t sin t.

y = A cos t + B sin t

2

B + 2

=0

2

or

B=

Hence

y = 4 cos t

1

1

Since y (0) = 0 the second equation gives B = 0 or B = 2 .

Hence

1

t

1

1

cos t.

y = 4 cos t+ 2 sin t t cos t = 2 sin t 4 +

2

.

( 2 2 )

2

2

sin t + 2

sin t.

( 2 2 )

2

without bound and the system is unstable.

77

m

y=0

Characteristic equation:

2 + + 2 = 0,

shock

absorber

spring

y (t) = Ae+ t + Be t ,

d

(y(t) a(t))

dt

dt 2

my (t) + cy (t) + ky(t) = ca (t) + ka(t)=: f (t).

m

= k(y(t) a(t)) c

< 0.

road surface

d 2 y(t)

2 4 2

.

2

a(t)

wheel

78

y(t)

mass

2

4

y (t) = Ae 2 t + Bte 2 t .

79

80

(overshooting). Car shock absorbers are designed to achieve critical

damping.

The preceding analysis shows that y = yH + yP yP as t .

1.0

0.8

Particular solution

0.6

yP = a sin t + b cos t

underdamped

critically damped

overdamped

y(t)

0.4

with a =

,

2 + 2 2

b=

,

2 + 2 2

where = 2 2 .

0.2

Amplitude:

0

2

10

81

AMP =

a2 + b 2 =

1

2 + 2 2

82

Let C(I) denote the space of all continuous functions y : I R,

where I is an interval in R.

For n = 1, 2, . . . , let C n (I) denote the space of all n-time

continuously differentiable functions y : I R, i.e., y, y , y , . . . ,

y (n) are continuous functions defined on I.

Let a0 , a1 , . . . , an1 be continuous functions. We define the map

T that maps a function y in C n (I) into a function in C(I) by (see

Definition 5)

state amplitude at a maximum?

d

d AMP

= 0

(2 + 2 2 ) = 0

d

d

2

2

= 2 = max

= 2

2

1

1

.

= AMPmax = q

2

2 4

d n1 y

d ny

d n2 y

dy

+an1 (x) n1 +an2 (x) n2 +. . .+a1 (x) +a0 (x)y.

dx n

dx

dx

dx

T is called a transformation or an operator.

For example:

T (y) =

resonance.

T (y) = y + x 2 y,

T (y) = y + ay + by

Second order ODEs

83

(n = 1)

for some fixed a, b R, (n = 2)

84

T is a linear operator

Proof.

For simplicity we prove only the case T (y) = y + ay + by. For all

y1 , y2 C n (I) and R,

T (y1 + y2 ) = (y1 + y2 ) + a(y1 + y2 ) + b(y1 + y2 )

Theorem 47

T (y) =

d n2 y

dy

d ny

d n1 y

+ an1 (x) n1 + an2 (x) n2 + . . . + a1 (x)

+ a0 (x)y

dx n

dx

dx

dx

= T (y1 ) + T (y2 )

and

T (y1 ) = (y1 ) + a(y1 ) + b(y1 )

= T (y1 ).

85

86

If yh ker(T ) and yp is any solution of (17), then

So yh + yp is a solution to (17).

coefficients only, i.e.,

y + ay + by = f .

(17)

In this case,

T (y yp ) = T (y) T (yp ) = f f = 0,

T (y) = y + ay + by.

so that y yp ker(T ).

If yh is a solution of the homogeneous equation y + ay + by = 0

then T (yh ) = 0 so that yh ker(T ).

of the form yh + yp .

Linear ODEs: a theoretical view

87

88

Example 48

The general solution of the first order linear equation

y + y/x = x

that we have presented allow you to solve this equation.

In many practical situations, you may find that yo dont even have

an analytic expression for y , but rather just a black box which

allows you to dertermine y numerically at any given (x, y) point

that you enter.

T (yh ) = 0 and T (yp ) = x.

The general solution to the corresponding homogeneous equation

y + y/x = 0 is yh = C/x.

approximate the solutions to such an IVP.

yp = x 2 /3.

89

Eulers method

Consider the IVP

90

Example 49

(

y = f (x, y),

y(x0 ) = y0 .

solution of the IVP

y = x + y, y(0) = 1.

x > x0 ,

(Note: This IVP can be solved exactly, and the exact solution is

y(x) = 2ex 1 x.)

With h = 0.1, we have

For h > 0 sufficiently small (which is called the step size) we have

x0 = 0,

x3 = 0.3, y3 = y2 + h(t2 + y2 ) = 1.22 + 0.1(0.2 + 1.22) = 1.362

If we define iteratively

yk +1 = yk + hf (xk , yk ),

y0 = 1

y1 = y0 + hf (x0 , y0 ),

xn

0

0.1

0.2

0.3

k = 0, 1, 2, . . . ,

Eulers method.

Numerical methods

Numerical methods

91

Numerical methods

y (xn )

1

1.1103418

1.2428055

1.3997176

yn

1

1.1

1.22

1.362

y (xn ) yn

0

0.0103418

0.0228055

0.0377176

Rel. error

0%

0.94 %

1.87 %

2.77 %

92

h = (b-a)/N;

x = a:h:b;

d = length(y0);

y0 = y0(:); % convert y0 to a column array

%

%

%

%

%

%

%

%

%

%

%

%

%

y(x) = f(x,y) for a < x < b,

with initial condition y(a) = y0.

y = zeros(d,N+1);

y(:,1) = y0;

for n = 2:N+1

y(:,n) = y(:,n-1) + h * fstring(x(n-1),y(:,n-1));

end

Inputs:

fstring: name of the function that computes f(x,y).

N: number of intervals in the grid.

Outputs:

x: row vector of length N+1

x(n) = a + (n-1) h, h = (b-a)/N.

To use this function you need a script file, say Eg50.m as on the next

page.

value y(n) of the exact solution y(x(n)).

>> Eg50

Numerical methods

93

Numerical methods

94

Errors

proportional to the step size. So if we were to halve the step size we

would expect to roughly halve these errors.

a = 0; b = 1; y0 = 0; N = 20;

func = @(x,y) 1./(1+x.^2) - 2 * y.^2;

y_exact = @(x) x ./ (1 + x.^2);

Example 50

Suppose we use Eulers method to solve the following problem

[t,y] = Euler(func,a,b,y0,N);

xplot = linspace(a,b);

plot(t,y,*-r,xplot,y_exact(xplot),b)

1

y =

2y 2 ,

1 + x2

y(0) = 0,

info = [N = , num2str(N)];

text(0.05,2.5,char(info))

xlabel(x), ylabel(y)

title(Example 50)

legend(y_n, y(x), location,NorthWest)

print -depsc Example50.eps

Numerical methods

0 < x < 1,

y(x) =

x

.

1 + x2

En := y(xn ) yn , are given in the following table.

95

Numerical methods

96

Example 50 (cont.)

h = 0.2

h = 0.1

xn

0.2000

0.4000

0.6000

0.8000

1.0000

0.1000

0.2000

0.3000

0.4000

0.5000

0.6000

0.7000

0.8000

0.9000

1.0000

y(xn )

0.1923

0.3448

0.4412

0.4878

0.5000

0.0990

0.1923

0.2752

0.3448

0.4000

0.4412

0.4698

0.4878

0.4972

0.5000

yn

0.2000

0.3763

0.4921

0.5423

0.5466

0.1000

0.1970

0.2854

0.3609

0.4210

0.4656

0.4957

0.5137

0.5219

0.5227

En

-0.0077

-0.0315

-0.0509

-0.0545

-0.0466

-0.0010

-0.0047

-0.0102

-0.0160

-0.0210

-0.0244

-0.0259

-0.0259

-0.0247

-0.0227

maxn |En |

known that

Z x1

y(x1 ) = y(x0 ) +

y (x) dx.

x0

RIf xwe

1

x [x0 , x1 ] then (noting that h = x1 x0 )

0.0545

integral by the trapezoidal rule

Z x1

y (x0 ) + y (x1 )

y (x) dx h

.

2

x0

This leads to an improved formula to compute y1 :

h

h

y1 = [y (x0 ) + y (x1 )] = [f (x0 , y0 ) + f (x1 , y1 )].

2

2

0.0259

Numerical methods

97

Numerical methods

Example 51

We solve the same problem as in Example 50 with the Improved Euler

method. In the following table note the convergence of order O(h) for

Eulers method and order O(h2 ) for the Improved Euler method.

(E)

(H)

(En : absolute error by Eulers method; En : absolute error by the

Improved Euler method.)

formula, we approximate it by its Euler approximation:

u1 = y0 + hf (x0 , y0 )

h

y1 = [f (x0 , y0 ) + f (x1 , u1 )].

2

h = 0.2

xk +1 = xk + h

h = 0.1

uk +1 = yk + hf (xk , yk )

h

yk +1 = [f (xk , yk ) + f (xk +1 , uk +1 )].

2

This method is also called Heuns method.

Numerical methods

98

99

tn

0.2000

0.4000

0.6000

0.8000

1.0000

0.1000

...

0.7000

0.8000

0.9000

1.0000

Numerical methods

(E)

En

-0.0077

-0.0315

-0.0509

-0.0545

-0.0466

-0.0010

...

-0.0259

-0.0259

-0.0247

-0.0227

(E)

maxn |En |

0.0545

0.0259

(H)

En

0.0042

0.0082

0.0105

0.0104

0.0089

0.0005

...

0.0023

0.0022

0.0021

0.0019

(H)

maxn |En |

0.0105

0.0023

100

method

method (cont.)

% Heun(fstring, y0, N) solves the ode

%

y(t) = f(t,y) for a < t < b,

% with initial condition y(a) = y0.

%

% Inputs:

%

fstring: function that compute f(t,y)

%

N: number of intervals

% Outputs:

%

t: row vector of length N+1 containing the points

%

t(n) = a + (n-1)h, h = (b-a)/N.

%

y: row vector of length N+1 containing the approx.

%

values y(n) of the exact solution y(t(n)).

h = (b-a) / N;

t = a:h:b;

d = length(y0);

y0 = y0(:);

y = zeros(N,d);

y(1,:) = y0;

for n = 2:N+1

v = y(n-1) + h * feval(fstring, t(n-1), y(n-1));

y(n) = y(n-1) + ( h / 2 ) * ...

( feval(fstring, t(n-1), y(n-1)) + ...

feval(fstring, t(n), v) );

end

Numerical methods

101

Better methods?

These will be learnt in MATH2301.

Numerical methods

103

Numerical methods

102

- Ordinary Differential EquationsHochgeladen vonrodwellhead
- PDE Full SolutionsHochgeladen vonSean Liu
- SE CSE IT Syllabus SolapurUniversityHochgeladen vonSwapnil Pujari
- Transient Circuit AnalysisHochgeladen vonFareed Ahmed
- moyer math - algebra i - gp 03-31-14Hochgeladen vonapi-247664996
- MATH226.1x_SyllabusHochgeladen vonlmaraujo67
- VarCalcHochgeladen vonVigneshwar Narayanan
- DEHochgeladen vonzinil
- MIT18_03SCF11_s1_6textHochgeladen vonkvhprasad
- Linear First Order ODEHochgeladen vonGustav
- TC KinematicHochgeladen vonMarius Diaconu
- 9 - formal lesson plan iHochgeladen vonapi-304704633
- SimuPlot5 ManualHochgeladen vonikorishor amba
- 7.Partial Differential Equations of Order Two With Variable Coefficients md raisinghnaiHochgeladen vonpanka
- Variational Symmetries of LagrangiansHochgeladen vonAnonymous Tph9x741
- Module 4 BHochgeladen vonPaolo Angelo Gutierrez
- 2006 an Iterative Method for Solving Nonlinear Functional EquationsHochgeladen vonNurhanani abu bakar
- Pressure Swing Adsorption_ Solve Coupled Partial Differential Equation System With ODE-Solver and Method of Lines - MATLAB Answers - MATLAB CentralHochgeladen vonMaría Carrillo De Alba
- Apendice c MatlabHochgeladen vonDiogo Martins
- Solution Manual for Elementary Differential Equations With Boundary Value Problems 2nd Edition by KohlerHochgeladen vona887562433
- ode-UNI-VICTOR.pdfHochgeladen vonLenin Espinoza
- ODE1.nbHochgeladen vonVictor Verga
- Mdcat PapersHochgeladen vonkhizar
- 0. Math for Business & Management.pdfHochgeladen vonwafiqazizahnurhajjah
- 1.1 Introduction.pptHochgeladen vonRicka O. Valino
- Ordinary Differential equationHochgeladen vonDeepak Kumar Singh
- b.tech Civil SyllabusHochgeladen vonAbdul Wahid
- 2130002-AEM-UNIT-3Hochgeladen vonNilesh
- AM251a_04Hochgeladen vonEngr Ishfaque Tunio
- Basic Technical Mathematics with Calculus SI VersionHochgeladen vonMHARLOU TORING

- Week2-Review1Hochgeladen vonkenny013
- from youtube - fast car tabsHochgeladen vonkenny013
- Uchiage Hanabi DAOKO.pdfHochgeladen vonkenny013
- Surface TensionHochgeladen vonkenny013
- Prime Factor Tree Worksheet 50 WITHOUT CIRLCESHochgeladen vonkenny013
- Harmer 2009 Review is Pages About the Pension SystemHochgeladen vonkenny013
- Module 4 Annotated 3141Hochgeladen vonkenny013
- 34235yHochgeladen vonkenny013
- Week 1 and 2 Summary ReadingsHochgeladen vonkenny013
- 15_GIT_1Hochgeladen vonkenny013
- Problem Set 3 (Duration II) With AnswersHochgeladen vonkenny013
- Lecture 5 Foreign Exchange RiskHochgeladen vonkenny013
- Tute SolutionsHochgeladen vonkenny013
- Ch20-3635Hochgeladen vonkenny013
- Bill RatesHochgeladen vonkenny013
- Fins3635 Formulas 2017Hochgeladen vonkenny013
- 16 ACTL2131 ExercisesHochgeladen vonkenny013
- Unit01_FinancialPlanningAndTheProfession2643Hochgeladen vonkenny013
- Assessment RubricHochgeladen vonkenny013
- Guest Lecture Actuarial April 2017 (Rebecca Hartcourt)Hochgeladen vonkenny013
- Kyle Landry M and S Theme.pdfHochgeladen vonkenny013
- Multi-state Actuarial Models of Functional Disability - Adam ShaoHochgeladen vonkenny013
- 15 GIT All ExercisesHochgeladen vonkenny013
- Module 4 SlidesHochgeladen vonkenny013
- Module 6 ExercisesHochgeladen vonkenny013
- Kyle Landry M and S ThemeHochgeladen vonkenny013
- NQF Resource 02 Guide to ECS Law RegsHochgeladen vonkenny013
- Accounting Framework; AmendmentHochgeladen vonkenny013
- TestHochgeladen vonKevin Jacobson

- Sdsu Computational ScienceHochgeladen vonjcpa1000
- MT112 Question Bank (1)gHochgeladen vonarjunv_14
- Syl Labib Age Ngg DegreeHochgeladen vonRonelAballaSauza
- 1. Definition, Formulation of D. E. of Ist Order and Ist DegHochgeladen vonSourabhThakur
- (Solid Mechanics and Its Applications 216) M. Reza Eslami (auth.)-Finite Elements Methods in Mechanics-Springer International Publishing (2014).pdfHochgeladen vonJonatasPereiraSilva
- The Role of Symmetry to Solve DeHochgeladen vonhammoudeh13
- it_2012_semester_3_4_18072013Hochgeladen vonsunshinesun49
- ENM212.pdfHochgeladen vongtgreat
- Lagrange Housner HudsonHochgeladen vonDanielMontesdeoca
- Math 304 Department MidtermHochgeladen vonMichael Gboneh
- First YearHochgeladen vonRuchi Sharma
- Euler Differential Equation PDFHochgeladen vonNate
- 00 Unit I Chapter 1 Fundamentals of Vibrations Student CopyHochgeladen vonKanishk Mehta
- MA2211-TPDE Lesson Plan D.samundeeswariHochgeladen vonsumikannu
- sinopsis_fizik_gunaan.docHochgeladen vonrahulsingh
- Debashis Chatterjee, J. S. Lather, Lalita Gupta-Wiley Acing the Gate_ Electrical Engineering-Wiley India (2016).pdfHochgeladen vonpoulomi ganguly
- Unit 4Hochgeladen vonGoliBharggav
- Analytical and Numerical Methods for Volterra EquationsHochgeladen vonНадежда Бурмистрова
- Accel NotesHochgeladen vonssuresu
- (Excellent) Ray Theory Characteristics and AsyptoticsHochgeladen vonmavric444
- ProgramHochgeladen vonBarbu Dani
- MASTMOcurriculum[1]Hochgeladen vonkiyyakoo
- Lecture 1Hochgeladen vonNadiah Salikon
- Discrete Barrier Using PDEHochgeladen vonabhishek210585
- desain tulngan pondasiHochgeladen vonBayu Kurnia Wibowo
- Notes PDE Pt1Hochgeladen vonjchandetsa
- L-PDE-2011Hochgeladen vonfe_chef
- A Compilation of the Math Leading to the DLMHochgeladen vonjiaweide
- Solve Non-Linear Parabolic Partial Differential Equation by Spline Collocation MethodHochgeladen vonEditor IJRITCC
- 52116904-Mathematics-Advanced-Mathematical-Methods-in-Science-and-Engineering-Hayek(1).pdfHochgeladen vonزكرياء بنحيرت

## Viel mehr als nur Dokumente.

Entdecken, was Scribd alles zu bieten hat, inklusive Bücher und Hörbücher von großen Verlagen.

Jederzeit kündbar.