computational modeling techniques - Åbo akademi

22
Computational modeling techniques Lecture 3: Modeling change (2) Modeling using proportionality Modeling using geometric similarity Ion Petre Department of IT, Abo Akademi http://www.users.abo.fi/ipetre/compmod/ September 8, 2014 1 http://users.abo.fi/ipetre/compmod/

Upload: others

Post on 28-Oct-2021

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computational modeling techniques - Åbo Akademi

Computational modeling techniques

Lecture 3: Modeling change (2) Modeling using proportionality

Modeling using geometric similarity

Ion Petre Department of IT, Abo Akademi

http://www.users.abo.fi/ipetre/compmod/

September 8, 2014 1 http://users.abo.fi/ipetre/compmod/

Page 2: Computational modeling techniques - Åbo Akademi

Content of the lecture

• Modeling change with systems of difference equations: three examples • Modeling using proportionality • Modeling using geometric similarity

September 8, 2014 http://users.abo.fi/ipetre/compmod/ 2

Page 3: Computational modeling techniques - Åbo Akademi

MODELING CHANGE WITH SYSTEMS OF DIFFERENCE EQUATIONS September 8, 2014 http://users.abo.fi/ipetre/compmod/

3

Page 4: Computational modeling techniques - Åbo Akademi

Modeling with systems of difference equations

• Example: car rental company; one office in Tampa, the other in Orlando o Travelers may rent a car from either office and drop it at either one

– Data shows that 40% of those who rent in Orlando, return it in Tampa, 30% of those who rent in Tampa, return it in Orlando

– The question is whether the car distribution will eventually become unbalanced and cars will have to be moved (empty) from one place to the other – extra cost

o Problem: build a model for how the number of cars in the two offices varies

– On=number of cars in Orlando after n time units – Tn=number of cars in Tampa after n time units – On+1=0.6On+0.3Tn – Tn+1=0.4On+0.7Tn

o Equilibrium values (O,T): – O=0.6O+0.3T – T=0.4O+0.7T – Solution: O=0.75 T

– Note that On+Tn= On+1+Tn+1, for all n – So, O+T=O0+T0 – Final solution: (3/7(O0+T0), 4/7(O0+T0))

4

Giordano et al. A first course in mathematical modeling. (3rd edition) Fig. 1.22, page 36

September 8, 2014 http://users.abo.fi/ipetre/compmod/

Page 5: Computational modeling techniques - Åbo Akademi

Example (continued)

Example • On+1=0.6On+0.3Tn

• Tn+1=0.4On+0.7Tn

• Total number of cars: 7000 • (3000,4000) equilibrium

• Start with various initial

distributions of the cars between Orlando and Tampa

• Test the numerical evolution

• Conclusion: after about 7 time units, we approach the equilibrium value (3000,4000)

– It suggests an asymptotically stable equilibrium

5 September 8, 2014

010002000300040005000600070008000

0 5 10 15

Cars

Time units

O(n)

T(n)

0

1000

2000

3000

4000

5000

6000

0 5 10 15

Cars

Time units

O(n)

T(n)

0

1000

2000

3000

4000

5000

6000

0 5 10 15

Cars

Time units

O(n)

T(n)

Giordano et al. A first course in mathematical modeling. (3rd edition) Fig. 1.23, page 37

Page 6: Computational modeling techniques - Åbo Akademi

Example: battle of Trafalgar

Trafalgar, 1805: French and Spanish naval forces under Napoleon against British naval forces under Admiral Nelson

• French and Spanish: 33 ships • British: 27 ships

• Model for battle outcome:

during an encounter, each side has a loss equal to 5% of the number of ships of the enemy

Scenario I: Straight-on series of confrontations

• Bn+1=Bn-0.05Fn • Fn+1=Fn-0.05Bn

6 September 8, 2014

0

5

10

15

20

25

30

35

0 5 10 15 20 25

Ships

Number of encounters

Scenario I: straight-on battle

B(n)

F(n)

http://users.abo.fi/ipetre/compmod/

Page 7: Computational modeling techniques - Åbo Akademi

Example (continued)

Recall the model: • French and Spanish: 33 ships • British: 27 ships • During an encounter, each side has

a loss equal to 5% of the number of ships of the enemy

Scenario II: divide-and-conquer

• Napoleon’s ships were arranged in three groups

• Strategy – Engage force A with 13 British ships – Engage force B with all available

ships – Engage force C with all available

ships

7

Giordano et al. A first course in mathematical modeling. (3rd edition) Fig. 1.25, page 39

September 8, 2014 http://users.abo.fi/ipetre/compmod/

Page 8: Computational modeling techniques - Åbo Akademi

Example (continued)

Battle A: engage French force A (3 ships) with 13 British ships

Outcome of battle A:

• French force A reduced from 3 to 0.4385

• French force B, C left intact: 17, 13, resp.

– did not engage

• British force: – from 13 ships engaged

in the battle, 12.5935 remaining

– 14 did not engage

September 8, 2014 8

0

2

4

6

8

10

12

14

0 1 2 3 4 5

Ships

Number of encounters

Scenario II: divide and conquer Battle A

B(n)

F(n)

http://users.abo.fi/ipetre/compmod/

Page 9: Computational modeling techniques - Åbo Akademi

Example (continued)

Battle B: engage French force B (17 ships) with all available British ships (26.5935)

Outcome of battle B:

• French force A: 0.4385 – did not engage

• French force B, reduced

from 17 to 0.1260

• French force C intact: 13 – did not engage

• British force:

– From 26.5935, reduced to 20.0704

September 8, 2014 9

0

5

10

15

20

25

30

0 5 10 15 20

Ships

Number of encounters

Scenario II: divide and conquer Battle B

B(n)

F(n)

http://users.abo.fi/ipetre/compmod/

Page 10: Computational modeling techniques - Åbo Akademi

Example (continued)

Battle C: engage French force B (13 ships) with all available British ships (20.0704)

Outcome of battle C:

• French force A: 0.4385 – did not engage

• French force B: 0.126

– did not engage

• French force C: from 13, reduced to 0.3111

• British force: – From 20.0704, reduced

to 15.0101

September 8, 2014 10

0

5

10

15

20

25

0 5 10 15 20

Ships

Number of encounters

Scenario II: divide and conquer Battle C

B(n)

F(n)

http://users.abo.fi/ipetre/compmod/

Page 11: Computational modeling techniques - Åbo Akademi

Modeling exercise

• Another strategy for defeating a superior force is through better technology

o Formulate a model where the British forces have better weaponry and as a result, each encounter results in

– A loss for the French-Spanish fleet of 10% of the number of British ships – A loss for the British ships of 5% of the number of French-Spanish ships – Assume that French-Spanish start with 33 ships, British start with 27 ships

September 8, 2014 http://users.abo.fi/ipetre/compmod/ 11

Page 12: Computational modeling techniques - Åbo Akademi

Modeling exercise

• Another strategy for defeating a superior force is through better technology

o Formulate a model where the British forces have better weaponry and as a result, each encounter results in

– A loss for the French-Spanish fleet of 15% of the number of British ships – A loss for the British ships of 5% of the number of French-Spanish ships – Assume that French-Spanish start with 33 ships, British start with 27 ships

• Result o Bn+1=Bn-0.05Fn

o Fn+1=Fn-0.15Bn

o B0=27, F0=33

September 8, 2014 http://users.abo.fi/ipetre/compmod/ 12

Page 13: Computational modeling techniques - Åbo Akademi

Example: competitive hunter model

• Two species, say owls and hawks co-exist in a habitat: O, H

• In the absence of the other species, each species exhibits unconstrained growth, proportional to its current level:

o On+1-On=k1On, Hn+1-Hn=k2Hn, where k1,k2>0

• The effect of each species is to diminish the growth of the other o Model it here as proportional to the number of possible encounters

between the two species: o On+1-On=k1On- k3OnHn; Hn+1-Hn=k2Hn- k4OnHn; k1,k2,k3,k4>0

• Model:

o On+1=(1+k1)On- k3OnHn; Hn+1=(1+k2)Hn- k4OnHn

September 8, 2014 13 http://users.abo.fi/ipetre/compmod/

Page 14: Computational modeling techniques - Åbo Akademi

Example (continued)

• Model: o On+1=(1+k1)On- k3OnHn; Hn+1=(1+k2)Hn- k4OnHn

• Question: what are the equilibrium points (O,H)?

o O=(1+k1)O- k3OH; H=(1+k2)H- k4OH o i.e. O(k1 – k3H)=0; H(k2- k4O)=0 o i.e., (O,H)=(0,0) or (O,H)=(k2/k4, k1/k3)

• Numerical simulation for k1=0.2, k2=0.3, k3=0.001, k4=0.002

o Equilibrium points: (0,0) and (150, 200)

September 8, 2014 http://users.abo.fi/ipetre/compmod/ 14

Page 15: Computational modeling techniques - Åbo Akademi

September 8, 2014 15

0

50

100

150

200

250

0 5 10 15

Individuals

Time units

Initial value: (150,200)

O(n)

H(n)

0

100

200

300

400

500

0 10 20 30

Individuals

Time units

Initial value: (151,199)

O(n)

H(n)

0

200

400

600

800

1000

0 10 20 30

Individuals

Time units

Initial value: (149,201)

O(n)

H(n)

This suggests an unstable equilibrium point; sensitivity to initial conditions

http://users.abo.fi/ipetre/compmod/

Page 16: Computational modeling techniques - Åbo Akademi

Modeling exercise

• Spotted owl’s primary food source is mice • Here is an ecological model for the populations of owls and mice:

o Mn+1=1.2 Mn-0.001 OnMn o On+1=0.7 On+0.002 OnMn

• Explain the significance of every term and constant in the model

September 8, 2014 http://users.abo.fi/ipetre/compmod/ 16

Page 17: Computational modeling techniques - Åbo Akademi

MODELING USING PROPORTIONALITY AND GEOMETRIC SIMILARITY

September 8, 2014 http://users.abo.fi/ipetre/compmod/ 17

Page 18: Computational modeling techniques - Åbo Akademi

Modeling using proportionality

• y is proportional to x, denoted y~x, if y=kx, for some k>0

• y~x2 if y=k1x2, for some constant k1>0

o In this case, x~y1/2

• y~ln(x) if y=k2ln(x), for some constant k2>0 • y~ex if y=k3ex, for some constant k3>0

• Note: If z~y and y~x, then z~x

18

Giordano et al. A first course in mathematical modeling. (3rd edition) Fig. 2.8, 2.9, page 66

September 8, 2014 http://users.abo.fi/ipetre/compmod/

Page 19: Computational modeling techniques - Åbo Akademi

Modeling using geometric similarity

• Two objects are said to be geometrically similar if there is a one-to-one correspondence between the points of the objects such that the ratio of distances between corresponding points is the same for all pairs of points

• Example: two boxes o l/l’=w/w’=h/h’=k, with k>0 o Ratio of their volumes:

V/V’=(lwh)/(l’w’h’)=k3

o Ratio of their surface areas: S/S’=(2lh+2wh+2wl)/(2l’h’+2w’h’+2w’l’) =k2

o In other words: – S/S’=l2/l’2, V/V’=l3/l’3

19

Giordano et al. A first course in mathematical modeling. (3rd edition) Fig. 2.18, page 76

September 8, 2014 http://users.abo.fi/ipetre/compmod/

Page 20: Computational modeling techniques - Åbo Akademi

Example

• Example: Bass fishing derby o Problem: predict the weight of a

fish in terms of some easily measurable dimensions

o Solution: assume geometric similarity

– V~l3; W~V – Conclusion: W~l3 – Calculate the proportionality

constant based on just one fish

20

Giordano et al. A first course in mathematical modeling. (3rd edition) Fig. 2.19-2.21, pages 79-81

September 8, 2014 http://users.abo.fi/ipetre/compmod/

Verify the model:

Page 21: Computational modeling techniques - Åbo Akademi

Example (continued) • The rule above does not reward catching a fat fish • Changes in the model

o Assume that the majority of the weight comes from the main body, without head and tail

o Length of the main body (effective length): leff

o The main body has a varying cross-sectional area. Consider the average cross-sectional area: Aavg

– Model: W~V~ Aavgleff o How do we measure/estimate the effective

length and the average cross-sectional area – Answer: Model it through geometric similarity! – Assume leff~l – Measure the circumference of the fish at its

widest point: the girth g – Assume Aavg~g2

– Final model: W~lg2 – Test the model: W=0.0187 lg2

21

Giordano et al. A first course in mathematical modeling. (3rd edition) Fig. 2.22, pages 82

September 8, 2014 http://users.abo.fi/ipetre/compmod/

Page 22: Computational modeling techniques - Åbo Akademi

Learning objectives for lectures 2-3

• Understand the concept of modeling the change in a discrete dynamical systems • Able to write a linear and an affine model with difference equations for a simple real-life phenomenona • Understand the diverse behavior that a linear dynamical system model can have • Understand the notion of equilibrium point • Understand the different types of stability of equilibrium points

• Ability to write multi-variable models as systems of difference equations • Understand the basic paradigm of modeling proportionality • Understand the basic paradigm of modeling geometric similarity

September 8, 2014 http://users.abo.fi/ipetre/compmod/ 22