+ Numerical Integration Techniques A Brief Introduction By Kai Zhao January, 2011.

Slides:



Advertisements
Similar presentations
Courant and all that Consistency, Convergence Stability Numerical Dispersion Computational grids and numerical anisotropy The goal of this lecture is to.
Advertisements

Example Project and Numerical Integration Computational Neuroscience 03 Lecture 11.
Formal Computational Skills
Arc-length computation and arc-length parameterization
Partial Differential Equations
Chapter 8 Elliptic Equation.
Ordinary Differential Equations
Asymptotic error expansion Example 1: Numerical differentiation –Truncation error via Taylor expansion.
Lecture 18 - Numerical Differentiation
CE33500 – Computational Methods in Civil Engineering Differentiation Provided by : Shahab Afshari
Chapter 3 Steady-State Conduction Multiple Dimensions
1cs542g-term Notes  Even if you’re not registered (not handing in assignment 1) send me an to be added to a class list.
PART 7 Ordinary Differential Equations ODEs
CSE245: Computer-Aided Circuit Simulation and Verification Lecture Note 5 Numerical Integration Spring 2010 Prof. Chung-Kuan Cheng 1.
Lecture 2: Numerical Differentiation. Derivative as a gradient
Numerical Integration CSE245 Lecture Notes. Content Introduction Linear Multistep Formulae Local Error and The Order of Integration Time Domain Solution.
Numerical Methods Marisa Villano, Tom Fagan, Dave Fairburn, Chris Savino, David Goldberg, Daniel Rave.
Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 9 Instructor: Tim Warburton.
Numerical Solutions to ODEs Nancy Griffeth January 14, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis.
Professor Walter W. Olson Department of Mechanical, Industrial and Manufacturing Engineering University of Toledo Solving ODE.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
1 st order linear differential equation: P, Q – continuous. Algorithm: Find I(x), s.t. by solving differential equation for I(x): then integrate both sides.
Tutorial 5: Numerical methods - buildings Q1. Identify three principal differences between a response function method and a numerical method when both.
Scientific Computing Partial Differential Equations Introduction and
Math 3120 Differential Equations with Boundary Value Problems Chapter 2: First-Order Differential Equations Section 2-6: A Numerical Method.
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 5a.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Large Steps in Cloth Simulation - SIGGRAPH 98 박 강 수박 강 수.
Scientific Computing Numerical Solution Of Ordinary Differential Equations - Euler’s Method.
Numerical Methods for Solving ODEs Euler Method. Ordinary Differential Equations  A differential equation is an equation in which includes derivatives.
7. Introduction to the numerical integration of PDE. As an example, we consider the following PDE with one variable; Finite difference method is one of.
Elliptic PDEs and the Finite Difference Method
MECH593 Introduction to Finite Element Methods Eigenvalue Problems and Time-dependent Problems.
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 12.
Finite Difference Methods Definitions. Finite Difference Methods Approximate derivatives ** difference between exact derivative and its approximation.
Sensitivity derivatives Can obtain sensitivity derivatives of structural response at several levels Finite difference sensitivity (section 7.1) Analytical.
Engineering Analysis – Computational Fluid Dynamics –
© Imperial College London Numerical Solution of Differential Equations 3 rd year JMC group project ● Summer Term 2004 Supervisor: Prof. Jeff Cash Saeed.
Discretization Methods Chapter 2. Training Manual May 15, 2001 Inventory # Discretization Methods Topics Equations and The Goal Brief overview.
Particle Systems. Applications Particle systems are broadly defined for: Explosion Cloth Fluid And more… It is integrated into many animation software,
Partial Derivatives Example: Find If solution: Partial Derivatives Example: Find If solution: gradient grad(u) = gradient.
Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
ECE 576 – Power System Dynamics and Stability Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Ordinary Differential Equations
1/14  5.2 Euler’s Method Compute the approximations of y(t) at a set of ( usually equally-spaced ) mesh points a = t 0 < t 1
Lecture 39 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
NUMERICAL DIFFERENTIATION or DIFFERENCE APPROXIMATION Used to evaluate derivatives of a function using the functional values at grid points. They are.
Lecture 11 Alessandra Nardi
High Accuracy Differentiation Formulas
Lecture 4: Numerical Stability
Finite Difference Methods
ECE 576 – Power System Dynamics and Stability
CSE245: Computer-Aided Circuit Simulation and Verification
Class Notes 18: Numerical Methods (1/2)
CSE 245: Computer Aided Circuit Simulation and Verification
Finite Volume Method for Unsteady Flows
Ordinary differential equaltions:
Chapter 26.
Topic 3 Discretization of PDE
CSE245: Computer-Aided Circuit Simulation and Verification
Numerical Analysis Lecture 37.
Topic 3 Discretization of PDE
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L2.
Numerical Analysis Lecture 38.
Overview Class #2 (Jan 16) Brief introduction to time-stepping ODEs
MATH 175: Numerical Analysis II
6th Lecture : Numerical Methods
Topic 3 Discretization of PDE
Presentation transcript:

+ Numerical Integration Techniques A Brief Introduction By Kai Zhao January, 2011

+ Objectives Start Writing your OWN Programs Make Numerical Integration accurate Make Numerical Integration fast CUDA acceleration 2

+ The same Objective Lord, make me accurate and fast. - Mel Gibson, Patriot 3

+ Schedule Methods Numerical Differentiation Euler Method Approaches The Three-Variable Model Heat Diffusion Equation 4

+ Preliminaries Basic Calculus Derivatives Taylor series expansion Basic Programming Skills Octave 5

+ Numerical Differentiation Definition of Differentiation Problem: We do not have an infinitesimal h Solution: Use a small h as an approximation 6

+ Numerical Differentiation Approximation Formula Is it accurate? Forward Difference 7

+ Numerical Differentiation Taylor Series expansion uses an infinite sum of terms to represent a function at some point accurately. which implies Error Analysis 8

+ Truncation Error 9

+ Numerical Differentiation Roundoff Error A computer can not store a real number in its memory accurately. Every number is stored with an inaccuracy proportional to itself. Denoted Total Error Usually we consider Truncation Error more. Error Analysis 10

+ Numerical Differentiation Backward Difference Definition Truncation Error No Improvement! 11

+ Numerical Differentiation Definition Truncation Error More accurate than Forward Difference and Backward Difference Central Difference 12

+ Numerical Differentiation Compute the derivative of function At point x=1.15 Example 13

+ Use Octave to compare these methods Blue – Error of Forward Difference Green – Error of Backward Difference Red – Error of Central Difference 14

+ Numerical Differentiation Multi-dimensional Apply Central Difference for different parameters High-Order Apply Central Difference several times for the same parameter Multi-dimensional & High-Order 15

+ Euler Method The Initial Value Problem Differential Equations Initial Conditions Problem What is the value of y at time t? IVP 16

+ Euler Method Consider Forward Difference Which implies Explicit Euler Method 17

+ Euler Method Split time t into n slices of equal length Δ t The Explicit Euler Method Formula Explicit Euler Method 18

+ Euler Method Explicit Euler Method - Algorithm 19

+ Euler Method Using Taylor series expansion, we can compute the truncation error at each step We assume that the total truncation error is the sum of truncation error of each step This assumption does not always hold. Explicit Euler Method - Error 20

+ Euler Method Consider Backward Difference Which implies Implicit Euler Method 21

+ Euler Method Split the time into slices of equal length The above differential equation should be solved to get the value of y(t i+1 ) Extra computation Sometimes worth because implicit method is more accurate Implicit Euler Method 22

+ Euler Method Try to solve IVP What is the value of y when t=0.5? The analytical solution is A Simple Example 23

+ Euler Method Using explicit Euler method We choose different dts to compare the accuracy A Simple Example 24

+ Euler Method texactdt=0.05errordt=0.025errordt= error A Simple Example At some given time t, error is proportional to dt. 25

+ Euler Method For some equations called Stiff Equations, Euler method requires an extremely small dt to make the result accurate The Explicit Euler Method Formula The choice of Δ t matters! Instability 26

+ Euler Method Instability Assume k=5 Analytical Solution is Try Explicit Euler Method with different dts 27

+ Choose dt=0.002, s.t. Works! 28

+ Choose dt=0.25, s.t. Oscillates, but works. 29

+ Choose dt=0.5, s.t. Instability! 30

+ Euler Method For large dt, explicit Euler Method does not guarantee an accurate result Stiff Equation – Explicit Euler Method texactdt=0.5errordt=0.25errordt=0.002error

+ Euler Method Implicit Euler Method Formula Which implies Stiff Equation – Implicit Euler Method 32

+ Choose dt=0.5, Oscillation eliminated! Not elegant, but works. 33

+ The Three-Variable Model The Differential Equations Single Cell 34

+ The Three-Variable Model Simplify the model Single Cell 35

+ The Three-Variable Model Using explicit Euler method Select simulation time T Select time slice length dt Number of time slices is nt=T/dt Initialize arrays vv(0, …, nt), v(0, …, nt), w(0, …, nt) to store the values of V, v, w at each time step Single Cell 36

+ The Three-Variable Model At each time step Compute p,q from value of vv of last time step Compute Ifi, Iso, Ifi from values of vv, v, w of previous time step Single Cell 37

+ The Three-Variable Model At each time step Use explicit Euler method formula to compute new vv, v, and w Single Cell 38

+ The Three-Variable Model 39

+ Heat Diffusion Equations The Model The first equation describes the heat conduction Function u is temperature distribution function Constant α is called thermal diffusivity The second equation initial temperature distribution 40

+ Heat Diffusion Equation Laplace Operator Δ (Laplacian) Definition: Divergence of the gradient of a function Divergence measures the magnitude of a vector field’s source or sink at some point Gradient is a vector point to the direction of greatest rate of increase, the magnitude of the gradient is the greatest rate Laplace Operator 41

+ Heat Diffusion Equation Meaning of the Laplace Operator Meaning of Heat Diffusion Operator At some point, the temperature change over time equals the thermal diffusivity times the magnitude of the greatest temperature change over space Laplace Operator 42

+ Heat Diffusion Equation Cartesian coordinates 1D space (a cable) Laplace Operator 43

+ Heat Diffusion Equation Compute Laplacian Numerically (1d) Similar to Numerical Differentiation Laplace Operator 44

+ Heat Diffusion Equation Boundaries (1d), take x=0 for example Assume the derivative at a boundary is 0 Laplacian at boundaries Laplace Operator 45

+ Heat Diffusion Equation Exercise Write a program in Octave to solve the following heat diffusion equation on 1d space: 46

+ Heat Diffusion Equation Exercise Write a program in Octave to solve the following heat diffusion equation on 1d space: TIPS: Store the values of u in a 2d array, one dimension is the time, the other is the cable(space) Use explicit Euler Method Choose dt, dx carefully to avoid instability You can use mesh() function to draw the 3d graph 47

+ Store u in a two-dimensional array u(i,j) stores value of u at point x=x i, time t=t j. u(i,j) is computed from u(i-1,j-1), u(i,j-1), and u(i+1,j+1). 48

+ Heat Diffusion Equation Explicit Euler Method Formula Discrete Form 49

+ Heat Diffusion Equation Stability dt must be small enough to avoid instability 50

+ The END Thank You! 51