28
ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011.

ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

  • View
    227

  • Download
    2

Embed Size (px)

Citation preview

Page 1: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

ENGG2013 Unit 22

Modeling byDifferential Equations

Apr, 2011.

Page 2: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

FREE FALLING BODY

kshum 2

Page 3: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Height, velocity and acceleration

• Parabola

kshum 3

0 0.5 1 1.5 2-10

0

10

20

t

y

0 0.5 1 1.5 2-20

-10

0

t

v

0 0.5 1 1.5 2-11

-10

-9

t

a

y = –5t2+15

v = –10t

a = –10

Page 4: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Newton’s law of motion

• F = ma – Force = mass acceleration– a = y’’(t)

• F = mg – Gravitational Force is proportional to the mass,

the proportionality constant g –10 ms-2.

kshum 4

y’’(t) = g

Assume no air friction

Page 5: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Differential equation

kshum 5

• A differential equation is an equation which involves derivatives.

• Examples:

The variable x is a function of time t.

The variable y is a function of t.

dx/dt = x + 2t

d2y/dt2 = t2 + y2

Page 6: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Initial conditions

• y(0)=0• y’(0)=10

kshum 6

0 0.5 1 1.5 220

22

24

26

t

y0 0.5 1 1.5 2

-10

0

10

t

v

0 0.5 1 1.5 2-11

-10

-9

t

a

y(t) = –5t2+10t+20

y(t) = –10t+10

y’’(t) = –10

Page 7: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Initial conditions

• y(0)= –5• y’(0)= –10

kshum 7

y(t) = –5(t+1)2

y(t) = –10t –10

y’’(t) = –10

0 0.5 1 1.5 2-60

-40

-20

0

t

y

0 0.5 1 1.5 2-30

-20

-10

t

v

0 0.5 1 1.5 2-11

-10

-9

t

a

Page 8: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Variables and parameters

kshum 8

• The dependent variable is called the system state, or the phase of the system. The independent variable is usually time.

• A constant which does not change with time is called a parameter.

• In the example Newton’s law of motion y’’(t) = g– Phase = system state = height of the mass– Independent variable = time– g is parameter.

Page 9: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Solutions to a differential equation• A solution is a function which satisfies the given

differential equation.• In solving differential equation, the solutions are

function of time.• In general, there are many solutions to a given

differential equation. We have different solutions for different initial condition.

• Deriving a solution is difficult, but checking whether a given function is a solution is easy.

kshum 9

y(t) = –5t2+15 is a solution to y’’(t) = –10because after differentiating –5t2+15 twice, we get –10.

y(t) = 4t2 is not a solution to y’’(t) = –10because after differentiating 4t2 twice, we get 8, not –10.

Page 10: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

General solution

• If every solution to a differential equation can be obtained from a family of solutions

f(t,c1,c2,c3,…,cn)

by choosing the constants c1, c2, c3,…, cn

appropriately, then we say that f(t,c1,c2,c3,…,cn) is a general solution.

kshum 10

Page 11: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

General solution to y’’(t) = -10

• For this simple example, just integrate two times.• Integrate both sides of y’’(t) = – 10 y’(t) = –10t+c1

• Integrate both sides of y’(t) = – 10+c1

y(t) = – 5t2+c1t+c2 (general solution)

• The constants c1 and c2 can be obtained from the initial conditions.

kshum 11

Page 12: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

FIRST-ORDER DIFFERENTIAL EQUATION

kshum 12

Page 13: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Brief review of derivatives

• Derivative is the slope of tangent line.– Tangent line is a line touching a curve at a point

kshum 13

-2 -1.5 -1 -0.5 0 0.5 1 1.5 20

0.5

1

1.5

2

2.5

3

3.5

4

y=x2.

Slope of the tangent lineat (x,x2) equals 2x.

Derivative of x2.

Page 14: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Slope of tangent line

• Derivative is the instantaneous rate of change.

kshum 14

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2-10

-8

-6

-4

-2

0

2

4

6

8

10y=x3+x

Slope = 4 at (-1,-2).

y’ =3x2+1y’ evaluated at x=-1 is 3(-1) 2+1=4.

Page 15: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

First-order differential equation• No second or higher derivative, for example

• First-order derivative defines slope.• Example

kshum 15

dx/dt = a function of x and t

General solution

constant

Page 16: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

An illustration• If an initial condition is given, then we can solve for the

constant C.• Suppose that x(0) = 2. C=3.

kshum 16

-3 -2 -1 0 1 2 30

10

20

30

40

50

60

t

x

Page 17: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

-3 -2 -1 0 1 2 30

10

20

30

40

50

60

t

x

0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4

4

5

6

7

8

9

t

x

Zoom in at (1, 6.1548)

kshum 17

Line segment with slope -1+e1=7.1548.

Page 18: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Zoom in at (2, 19.1672)

kshum 18

-3 -2 -1 0 1 2 30

10

20

30

40

50

60

t

x

1.8 1.85 1.9 1.95 2 2.05 2.1 2.15 2.2 2.25

16

17

18

19

20

21

22

t

x

Line segment with slope –1 + 3e2=21.1672

Page 19: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Direction field or slope field

• A graphical method for solving differential equation.

• Systematically evaluate f(x,t) on a grid on points.

• On a grid point (t,x), draw a short line segment with slope f(x,t).

• A solution must follow the flow pattern.

kshum 19

Page 20: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Direction Field for x’=x+t

kshum 20

Sample solution for x(0)=2

-3 -2 -1 0 1 2 3

-10

-8

-6

-4

-2

0

2

4

6

8

10

t

xx ' = x + t

Each grid point (t,x) is associated with a line segment with slope x+t.

Page 21: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Newton’s law of cooling

kshum 21

• Imagine a can of coffee in an air-conditioned room.

• The rate of change of the temperature T(t) is directly proportional to the difference between T and the temperature T0 of the environment.

• Rate of change in temperature is directly proportional to (T – T0).– k is a positive constant.– T > T0, T decreases with rate k (T – T0).– T < T0, T increases with rate k (T0 – T).

dT/dt = – k (T – T0) (k>0)

Page 22: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Rate of change in temperature

10 12 14 16 18 20 22 24 26 28 30-1.5

-1

-0.5

0

0.5

1

1.5

2

2.5

3

T

rate

of c

ha

ng

e in

tem

p.

T T

dT/dt = – 0.2 (T – 23)

T0

Page 23: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

0 5 10 15 20 25 30

0

5

10

15

20

25

30

35

40

t

T

T ' = - 0.2 (T - 23)

Direction fielddT/dt = – 0.2 (T – 23)

Page 24: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Sample solutions

Some typical solution paths, corresponding initial temperature 0, 5, 10, 15, 20, 25, 30, 35, 40, are shown in the graph.

0 5 10 15 20 25 30

0

5

10

15

20

25

30

35

40

t

TT ' = - 0.2 (T - 23) dT/dt = – 0.2 (T – 23)

Page 25: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Autonomous DE and Phase line

• Autonomous DE: x’(t) = a function of x only.– no independent variable on the R. H. S.

• For autonomous DE, we can understand the system via the phase line.

T0T T

dT/dt = – k (T– T0)Phase line

Stable equilibrium

Critical point at T0

(k>0)

Page 26: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Direction field for x’=2x(1-x)

kshum 26

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

-1

-0.5

0

0.5

1

1.5

2

t

xx ' = 2 x (1 - x)

The pattern is the same on every vertical line.

Slopesare zeroon thesetwo criticallines.

Page 27: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Phase line for x’=2x(1-x)

kshum 27

1x x

Phase line

Critical points at x=0 and x=1

0 x

Stable equilibriumUnstable equilibrium

Without solving the differential equation explicitly, we know that the solution x(t) converges to 1 if it starts at positive x(0), butdiverges to negative infinity if it starts at negative x(0).

Page 28: ENGG2013 Unit 22 Modeling by Differential Equations Apr, 2011

Main concepts

• Independent variable, dependent variable and parameters

• Initial conditions• General solution• Direction field• Autonomous differential equations.

– Phase line• Equilibrium

– Stable and unstable