Presentation is loading. Please wait.

Presentation is loading. Please wait.

Modeling and Simulation: Exploring Dynamic System Behaviour

Similar presentations


Presentation on theme: "Modeling and Simulation: Exploring Dynamic System Behaviour"— Presentation transcript:

1 Modeling and Simulation: Exploring Dynamic System Behaviour
Chapter 8 Simulation with CTDS Models

2 Continuous Time Dynamic Models
Synopsis Generating behavior (numerical sol’n of ode’s) Possible hazards on the road to successful solution of continuous M&S projects

3 CTDS Models Noteworthy Features
CM is formulated as a set of differential equations (ode or pde) possibly augmented with a set of algebraic equations Frequently the SUI has its origins in the “physical world” hence behavior is governed by physical laws (physics, chemistry, heat transfer, etc); i.e., “deep knowledge” Optimization studies are straightforward because (a) random effects rarely present and (b) behavior is ”smooth” Time advance is not a separate issue because it is embedded in the equation solving mechanism

4 L q΄΄(t) + R q΄(t) + q(t)/C = E(t)
Some Examples Electric Circuit (An example of a deductive model formulated from the application of physical laws) L q΄΄(t) + R q΄(t) + q(t)/C = E(t) Initial conditions: q(t0) and q΄(t0) are required

5 2. Population Dynamics (predator/prey).
(An example of an inductive model that is formulated from arguments based on observation and intuition) without interaction: P1΄(t) = – α1 P1(t) P2΄(t) = α2 P2(t)

6 The Numerical Solution Process
Concern here is with numerical procedures to solve the equation: x΄(t) = f(x(t), t) (*) over the interval [t0 , tf ] where t0 , tf and x(t0) = x0 are assumed to be given (the IVP as opposed to the BVP)

7 Key issue --- are we trying to do the impossible (i. e
Key issue are we trying to do the impossible (i.e., can we be sure a solution exists)?? Theorem Let f(x, t) satisfy the Lipschitz Condition and let x0 be any number. Then there exists exactly one function, x(t), with the following properties: x(t) is continuous and differentiable for t  [t0 , tf]  (ii) x΄(t) = f(x(t), t) for t  [t0 , tf]  (iii) x(t0) = x0

8 Lipschitz Condition * f(x, t) is defined and continuous in the strip - ∞ < x < ∞ , t0 ≤ t ≤ tf with t0 and tf finite * there exists a constant, L, such that for any t  [ t0 , tf] and any two numbers α and β | f(α, t) - f(β, t) | ≤ L | α - β |

9 What is a Numerical Solution of an IVP ?
A numerical solution to an IVP is a finite set of points (ordered pairs): { (tn , xn): n = 0,1,2, N}  where : ** xn is the generated numerical approximation for x(tn ) ** tn+1 = tn + hn ; 0 ≤ n ≤ (N-1) and tN = tf. [note reference here to “a” rather than “the”!]

10 Numerical Solution to an IVP

11 Sources of Error a) truncation (or discretization) error
·  this is a property of the solution method · if all arithmetic operations could be performed with infinite precision, then this would be the only source of error b) round-off error ·  this is a property of the computer program used to implement the solution method ·  it arises because of the finite precision in number representation

12 Associated Issues * stability
* order (this is closely related to the notion of truncation error introduced earlier) * accuracy (this is a reflection of the reliability of the results obtained) * local efficiency (this is a measure of the effort required to move the generated solution forward from t = tn to t = tn+1; it is typically measured in terms of the number of evaluations of the derivative function, f

13 The Euler Method * recall that the slope of the true solution through (tn, xn) is fn = f(xn, tn) *solution approximation for the Euler method at t = tn+1 is: xn+1 = xn + hn fn

14 Modified Euler Method (Trapazoidal Rule)
·       take an Euler step to produce the value pn+1 = (xn + hn fn) at t = tn+1 ·       let Fn+1 = f(pn+1, tn+1) ·       choose the solution estimate at t = tn+1 to be: xn+1 = xn + hn (fn + Fn+1)/2

15 Comparison of the Euler and Modified Euler Methods
Observe that Euler Method yields a new solution value after one derivative function evaluation while the Modified Euler Method requires two. Is there any benefit from this extra effort?

16 Comparison of the Euler and Modified Euler Methods (cont.)
Observe that Euler Method yields a new solution value after one derivative function evaluation while the Modified Euler Method requires two. Is there any benefit from this extra effort? Most definitely YES! From an analysis via Taylor Series expansion, it can be demonstrated that: x(tn+1) = xEn+1 + O(hn2) x(tn+1) = xMEn+1 + O(hn3)

17 The Runge-Kutta Family
xn+1 = xn + h bi gi g1 = f(xn , tn) g2 = f(xn + h a21 g1 , tn + c2 h) g3 = f(xn + h (a31 g1 + a32 g2), tn + c3 h) . gs = f(xn + h (as1 g1 + as2 g as s-1 gs-1), tn + cs h)

18 The s-stage formula requires s evaluations of the derivative function, f, to advance one step along the t-axis  The s-stage formula has ŝ = (s2 + 3s - 2)/2 free parameters These are determined by requiring x(tn+1) = xn+1 + O(hnr) i.e., a formula of order r, where r ≤ s (typically r = s) Since ŝ > s, there are many s-stage formulas of order r

19 Linear Multi-step Methods
The general representation for this broad class of methods is: xn+1 = αi xn+1-i h βi fn+1-i Special Cases: a)  if k = 1, then we have a single-step method if k > 1, then we have a multi-step method (solution values prior to tn are used in generating the solution value at tn+1)     b) if β0 ≠ 0, then we have an implicit/closed/corrector method if β0 = 0, then we have an explicit/open/predictor method

20 Predictor-Corrector Methods
These represent the standard implementation approach for linear multi-step methods. The underlying idea is to first use an explicit formula to project forward (i.e. to “predict”) and then, as a second step, an implicit formula is used to create the solution value. Example (Adams fourth-order predictor-corrector procedure) Predictor (Adams-Bashforth):   xn+1 = xn + h (55 fn – 59 fn fn-2 – 9 f n-3 ) / 24  Corrector (Adams-Moulton) xn+1 = xn + h (9 ƒn fn - 5 fn f n-2 ) / 24

21 Issues and Hazards Stability Stiffness Handling discontinuities
Variable step-size


Download ppt "Modeling and Simulation: Exploring Dynamic System Behaviour"

Similar presentations


Ads by Google