Introduction To Numerical Modeling and Device Modeling Outline
Introduction To Numerical Modeling and Device Modeling Outline
Introduction Introduction
• Most real-word applications lead to mathematical • The simplified analytical model (e.g., set of equations)
problems which cannot be solved with exact for problem is converted into a numerical model
formulas, or analytically – Can be solved in a finite number of basic arithmetic
• A common approach is to reduce a problem to operations
special cases and simplified situations, and study – Approximation of an analytical model (error)
those in detail • A numerical model is solved with numerical methods,
• The aim is to uncover generally applicable introducing additional errors
concepts and properties, which can guide us in • Machine representation: computers have a limit on
more difficult problems how small or large a number can be
1
Numerical modeling: Examples: converging and
terminology diverging sequences
Convergence and divergence
• Sequence (aj) with j=[0,∞] is said to be e-close to • Unbounded sequences, i.e., sequences that contain
a number b if there exists a number N ≥ 0 (it can arbitrarily large numbers, always diverge
be very large), such that for all n ≥ N, |aj − b|≤ e • e−n → 0 as n →∞, and convergence is very fast
• A sequence (aj) with j=[0,∞] is said to converge to • n/(n + 2) → 1 as n →∞, and convergence is rather
b if it is e-close to b for all e> 0 (however small) slow
• Notation: aj → b, or limj→∞ aj = b • log(n) →∞ as n →∞, so the sequence diverges
• If a sequence does not converge, it diverges
2
Converging iterations
Example: Solution of an
equation x=F(x) using the
Numerical modeling:
method of iterations
• Start with an initial
basic operations
approximation x0, and
compute the sequence
• Interpolation
x1=F(x0) x2=F(x1) x3=F(x2) … • Derivatives
Diverging iterations • Each computation of the
type xn+1=F(xn) is called a • Integration
fixed-point iteration: as n
grows we would like xn to • Root finding
be closer to the root
– Nonlinear equations
• If the sequence {xn}
converges to a limiting – Differential equations
value α, then x= α is the
root: α=F(α)
3
Numerical modeling: Numerical modeling:
integration integration
• Evaluation of definite integral of a function as • The [a,b] is divided into N intervals, Trapezoid rule
4
Numerical modeling: Numerical modeling:
differential equations differential equations
• In solving differential equation we make distinction • Euler method: first order ODE with initial value
between the general and a particular solution • Consider the problem of calculating the shape of a curve
– Example: equation y’=y has the general solution y=Cex, f(x): it starts at a given point x0 (initial value) and satisfies
where C is an arbitrary constant a given differential equation, so we can calculate the
derivative at x0 (find tangent)
• Every nth order ODE has n integrating constants, that x2 … xn
• Take a small step h along the tangent
can be either the initial values, or boundary conditions and repeat the procedure x1
(determined at the integration limits) leading to initial f(x)
y ( x ) f ( x , y ( x )), y ( x 0 ) y 0 x0
value or boundary condition problems
y n 1 y n hf ( x n , y n ), yn y ( xn ) - approximate
– Same for first-order differential equations solution
Numerical modeling:
Numerical modeling:
differential equations
differential equations
Euler method Runge-Kutta method
• Runge–Kutta method: 4th order method for ODE y'(x) = -2 x y(x)
y(0) = 5
• Offers much better accuracy than the Euler method (2 nd [0,3]
degree method); can further adapt using variable step size
k 1 hf ( x n , y n ) y'(x) = -2 x y(x)
1 1 y(0) = 5
k 2 hf ( x n h, yn k1 ) [0,3]
2 2
Sample solution:
1 1 http://www.wolframalpha.com
k 3 hf ( x n h, yn k2 )
2 2
k 4 hf ( x n h , y n k 3 )
1 1 1 1
y n 1 y n k1 k2 k3 k 4 O (h )
5
6 3 3 6
5
Numerical modeling:
Numerical modeling: errors
Monte Carlo simulations
• Multiple real-life processes are stochastic in • The accuracy is always lower than in analytical
nature: characterized by probability distribution solution
and expectation value • Sources of error:
• Monte Carlo simulations are designed to repeat – Errors in given input data, operator error, etc.
the same process very large number of times to – Simplification error
obtain the solution close to the expectation value – Rounding (or chopping) error during computation
• Rely heavily on random number generators – Truncation error (e.g., an infinite series is broken off
– Eventually the sequence of numbers from the generator after a finite number of terms)
will repeat itself – Discretization error
6
Modeling physical system: Modeling physical system:
Geometry Governing equations
• We need as many equations to describe the model as there
are distinct “physics”
• Example: to model transport processes in a biomedical
system have to consider three most distinct “physics” -
fluid flow, heat transfer, and mass transfer. The following
equations should be included:
– Conservation equation for total mass (continuity equation)
– Momentum conservation equations (fluid flow equations)
– Energy conservation equation (heat transfer equation)
– Mass species conservation equation (mass transfer equation)
Example: arterial tissue surrounding blood
7
Summary References
• Most real-word applications lead to mathematical
• A. Klein and A. Godunov, Introductory Computational
problems which cannot be solved with exact Physics, Cambridge University Press, 2006
formulas, or analytically • R. L. Burden, J. D. Faires, Numerical Analysis, 9 th edition,
• A common approach is to reduce a problem to Brooks/Cole, Cengage Learning, 2011
special cases and simplified situations, and study • G. Dahlquist, Å. Björck, Numerical methods in scientific
those in detail computing, Vol.1, SIAM, Philadelphia, 2008
• Errors accumulate through every simplification • A. Datta and V. Rakesh, An Introduction to Modeling of
Transport Processes, Cambridge University Press, 2010
step at the model level, and at every
approximation related to model implementation