MA1S12: SOLUTIONS TO TUTORIAL 6

advertisement

MA1S12: SOLUTIONS TO TUTORIAL 6

1. Find the first three approximations given by Euler’s method with increment 4 x = 0 .

1 for the initial value problem y

0

= x

2

√ y y (0) = 1

Solution: From the initial condition we have x

0

= 0 , y

0

= y ( x

0

) = 1

The sample points are x

1

= x

0

+ 4 x = 0 .

1 x

2

= x

1

+ 4 x = 0 .

2 x

3

= x

2

+ 4 x = 0 .

3

The approximations y

1

, y

2 and y

3 are given by the formula y n +1

= y n

+ f ( x n

, y n

) 4 x where we write f ( x, y ) = x 2

√ y .

y

1

= y

0

+ f ( x

0

, y

0

) 4 x

= 1 + f (0 , 1)(0 .

1)

= 1 + (0)

2

1(0 .

1)

= 1

1

2 MA1S12: SOLUTIONS TO TUTORIAL 6 y

2

= y

1

+ f ( x

1

, y

1

) 4 x

= 1 + f (0 .

1 , 1)(0 .

1)

= 1 + (0 .

1)

2

1(0 .

1)

= 1 .

001 y

3

= y

2

+ f ( x

2

, y

2

) 4 x

= 1 .

001 + f (0 .

2 , 1 .

001)(0 .

1)

= 1 .

001 + (0 .

2)

2

1 .

001(0 .

1)

= 1 .

005

2. The particular solution for the ODE in Q.1. is y ( x ) = x

3

+ 1

6

2

Compute the absolute error for the Euler approximations in Q.1.

Solution: Using the exact solution y ( x ) we have y ( x

1

) = y (0 .

1) =

(0 .

1) 3

+ 1

6

2

= 1 .

0003 y y

(

( x x

2

3

) =

) = y y

(0

(0

.

.

2) =

3) =

(0 .

2) 3

+ 1

6

2

= 1 .

0027

(0 .

3) 3

+ 1

6

2

= 1 .

009

The absolute error for the n th approximation is | y ( x n

) − y n

| .

MA1S12: SOLUTIONS TO TUTORIAL 6 n x n y ( x n

) y n

0 0 1 1

| y ( x n

) − y n

|

0

1 0.1 1.0003 1 0.0003

2 0.2 1.0027 1.001 0.0017

3 0.3 1.009

1.005 0.004

3

3. A petri dish contains bacteria with initial population 100. After 2 hours the population is 110. Assuming an exponential growth model find the population of the bacteria after 5 hours.

Solution: Let y ( t ) be the population of the bacteria at time t . Assuming an exponential growth model we have y ( t ) = Ae kt where A and k are both constants. We can find A using the initial condition y (0) = 100.

y (0) = Ae k (0)

= A = 100

= ⇒ y ( t ) = 100 e kt

We can find the growth constant k using the condition y (2) = 110.

y (2) = 100 e k (2)

= 110

= ⇒ e

2 k

=

110

100

= ⇒ 2 k = ln

110

100

= ⇒ k =

1

2 ln

110

100

≈ 0 .

05

= ⇒ y ( t ) ≈ 100 e

0 .

05 t

4 MA1S12: SOLUTIONS TO TUTORIAL 6

After 5 hours the population is approximately y (5) ≈ 100 e

0 .

05(5) ≈ 128

4. A mixing tank contains 300 gallons of water in which 100lbs of salt has been dissolved. Another mixture of salt and water is pumped into the tank at a rate of 2 gal/min. The concentration of salt in this inflow is 1lb per gallon. The resulting mixture is pumped out of the tank at a rate of 2 gal/min. Find the amount of salt in the tank after 10 minutes.

Solution: Let y ( t ) be the amount of salt in the tank at time t . Let

V ( t ) be the volume of the mixture in the tank at time t . Note that in this example the volume is constant

V ( t ) = 300 + 2 t − 2 t = 300

The rate at which salt enters the tank is

(ConcentrationIn)(FlowIn) = 1(2) = 2

The rate at which salt leaves the tank is

(ConcentrationOut)(FlowOut) = y ( t )

V ( t )

(2) =

2

300 y ( t )

The difference between these two values is the rate of change of the amount of salt in the tank. We can model this with a first order linear ODE y

0

( t ) = 2 −

2

300 y ( t )

In standard form we have y

0

( t ) +

2

300 y ( t ) = 2

MA1S12: SOLUTIONS TO TUTORIAL 6

Let p ( t ) =

2

300

=

1

150 and q ( t ) = 2. Then

Z p ( t ) dt =

Z 1

150 dt = t

150

+ constant

The integrating factor is

µ ( t ) = e

R p ( t ) dt

= e t

150

The general solution is y ( t ) =

1

µ ( t )

Z

= e

− t

150

Z

µ ( t ) q ( t ) dt

2 e t

150 dt t

= e

150 h

2 (150) e t

150

+ c i t

= 300 + e

150 c

Using the initial condition y (0) = 100 we have y (0) = 300 + e

− 0

150 c = 100

= ⇒ 300 + c = 100

= ⇒ c = − 200

The particular solution is y ( t ) = 300 − 200 e

− t

150

After 10 minutes the amount of salt in the tank is y (10) = 300 − 200 e

− 10

150

≈ 112 .

9 lbs

5

Download