Systems of ODEs Systems of Ordinary Differential Equations - - PowerPoint PPT Presentation

β–Ά
systems of odes systems of ordinary differential equations
SMART_READER_LITE
LIVE PREVIEW

Systems of ODEs Systems of Ordinary Differential Equations - - PowerPoint PPT Presentation

1 with Eulers and RKs Methods Dec 4, 2014 Systems of ODEs Systems of Ordinary Differential Equations Solutions of a single first-order differential equations of the form: = , , given =


slide-1
SLIDE 1

Systems of ODEs

with Euler’s and RK’s Methods Dec 4, 2014

1

slide-2
SLIDE 2

Systems of Ordinary Differential Equations

  • Solutions of a single first-order differential equations of the form:

𝑒𝑧 𝑒𝑒 = 𝑔 𝑒, 𝑧 ,

given 𝑧 𝑒𝑝 =∝ have been considered

  • However, many applications give rise to systems of ODEs. A system of n first-order ODEs

has the form: 𝑧1

β€² = 𝑔 1 𝑒, 𝑧1, 𝑧2, … , π‘§π‘œ

𝑧2

β€² = 𝑔 2 𝑒, 𝑧1, 𝑧2, … , π‘§π‘œ

... π‘§π‘œ

β€² = 𝑔 π‘œ 𝑒, 𝑧1, 𝑧2, … , π‘§π‘œ

  • The numerical methods that we have discussed so far for a single equation can be

extended to apply to a system of equations as well. We start with the simplest Euler’s and then we apply the more accurate RK-4.

2

slide-3
SLIDE 3

Euler’s Method: Systems of ODEs

  • For the purpose of illustration, let’s consider a system of two equations only,

written as: 𝑒𝑧 𝑒𝑒 = 𝑔

1 𝑒, 𝑧, 𝑨

𝑒𝑨 𝑒𝑒 = 𝑔

2 𝑒, 𝑧, 𝑨

  • And suppose that Euler’s method is applied to solve them. Given the initial

values: 𝑧 𝑒𝑝 = 𝑧𝑝 z 𝑒𝑝 = 𝑨𝑝

3

slide-4
SLIDE 4

Euler’s Method for a System of Two Equations

  • Computational Sequence:

𝐿1 = 𝑔

1 𝑒𝑗, 𝑧𝑗, 𝑨𝑗

𝑀1 = 𝑔

2 𝑒𝑗, 𝑧𝑗, 𝑨𝑗

𝑧𝑗+1 = 𝑧𝑗 + β„ŽπΏ1 𝑨𝑗+1 = 𝑨𝑗 + β„Žπ‘€1

4

For 𝑗 = 0, 1, … . , 𝑂 βˆ’ 1. We can obtain successive approximations 𝑧1, 𝑧2, 𝑧3, 𝑧4, … , 𝑧𝑂 and those 𝑨1, 𝑨2, 𝑨3, 𝑨4, … , 𝑨𝑂

slide-5
SLIDE 5

Example

𝑒𝑧 𝑒𝑒 = 2𝑧 + 3𝑨, 𝑧 0 = 1 𝑒𝑨 𝑒𝑒 = 2𝑧 + 𝑨, 𝑨 0 = βˆ’1

  • Using h=0.1 find an approximation for the first step of 𝑧 0.1 , 𝑨 0.1

using Euler’s method

  • The exact solution for these equations:

𝑧 𝑒 = π‘“βˆ’π‘’ 𝑨 𝑒 = βˆ’π‘“βˆ’π‘’

5

slide-6
SLIDE 6

step size h is the same for both equations as t is the only independent variable in the system

Input Data

➒ 𝑔

1 𝑒, 𝑧, 𝑨 = 2𝑧 + 3𝑨

➒ 𝑔

2 𝑒, 𝑧, 𝑨 = 2𝑧 + 𝑨

➒ Initial Values: 𝑧𝑝 = 𝑧 0 = 1; 𝑨0 = 𝑨 0 = βˆ’1 ➒ Step size: h = 0.1

6

slide-7
SLIDE 7

Example

𝑗 = 0 𝐿1 = 𝑔

1 𝑒0, 𝑧0 , 𝑨0 = 2𝑧0 + 3𝑨0 = 2 1 + 3 βˆ’1

= βˆ’1 𝑀1 = 𝑔

2 𝑒0, 𝑧0, 𝑨0 = 2𝑧0 + 𝑨0 = 2 1 + βˆ’1

= 1 𝑧1 = 𝑧0 + β„ŽπΏ1 = 1 + 0.1 βˆ’1 = 0.90 𝑨1 = 𝑨0 + β„Žπ‘€1 = βˆ’1 + 0.1 1 = βˆ’0.90

  • Exact solution (correct up to two decimals):

𝑧 0.1 = π‘“βˆ’0.1 = 0.9048 𝑨 0.1 = βˆ’π‘“0.1 = βˆ’0.9048

7

slide-8
SLIDE 8

How do you report the solution?

𝒋 𝒖𝒋 π‘³πŸ π‘΄πŸ 𝒛𝒋 π’œπ’‹

1

  • 1

1 0.1

  • 1

1 0.9000

  • 0.9000

2 … … … … … …

8

slide-9
SLIDE 9

Runge-Kutta: Systems of ODEs

9

slide-10
SLIDE 10

Example

  • For the purpose of illustration, let’s consider a system of two equations only,

written as: 𝑒𝑧 𝑒𝑒 = 𝑔

1 𝑒, 𝑧, 𝑨

𝑒𝑨 𝑒𝑒 = 𝑔

2 𝑒, 𝑧, 𝑨

  • Given the initial values:

𝑧 𝑒𝑝 = 𝑧𝑝 z 𝑒𝑝 = 𝑨𝑝

  • RK-4 method is applied to solve them.

10

slide-11
SLIDE 11

Applied the 4th Order Runge Kutta Scheme

𝐿1 = 𝑔

1 π‘’π‘˜, π‘§π‘˜, 𝑨 π‘˜

𝑀1 = 𝑔

2 π‘’π‘˜, π‘§π‘˜, 𝑨 π‘˜

𝐿2 = 𝑔

1 π‘’π‘˜ + β„Ž

2 , π‘§π‘˜ + β„Ž 2 𝐿1, 𝑨

π‘˜ + β„Ž

2 𝑀1 𝑀2 = 𝑔

2 π‘’π‘˜ + β„Ž

2 , π‘§π‘˜ + β„Ž 2 𝐿1, 𝑨

π‘˜ + β„Ž

2 𝑀1 𝐿3 = 𝑔

1 π‘’π‘˜ + β„Ž

2 , π‘§π‘˜ + β„Ž 2 𝐿2, 𝑨

π‘˜ + β„Ž

2 𝑀2 𝑀3 = 𝑔

2 π‘’π‘˜ + β„Ž

2 , π‘§π‘˜ + β„Ž 2 𝐿2, 𝑨

π‘˜ + β„Ž

2 𝑀2 𝐿4 = 𝑔

1 π‘’π‘˜ + β„Ž, π‘§π‘˜ + β„ŽπΏ3, 𝑨 π‘˜ + β„Žπ‘€3

𝑀4 = 𝑔

2 π‘’π‘˜ + β„Ž, π‘§π‘˜ + β„ŽπΏ3, 𝑨 π‘˜ + β„Žπ‘€3

π‘§π‘˜+1 = π‘§π‘˜ + β„Ž 𝐿1 6 + 𝐿2 3 + 𝐿3 3 + 𝐿4 6 𝑨

π‘˜+1 = 𝑨 π‘˜ + β„Ž 𝑀1

6 + 𝑀2 3 + 𝑀3 3 + 𝑀4 6

11

Observe the computation sequence: you compute each slope for each stage, i.e., 𝐿1, 𝑀1, 𝐿2, 𝑀2, 𝐿3, 𝑀3, 𝐿4, 𝑀4 then π‘§π‘˜+1, π‘¨π‘˜+1

slide-12
SLIDE 12

Common to both equations

12