CS6068 Applications: Numerical Methods

Slides:



Advertisements
Similar presentations
Partial Differential Equations
Advertisements

Computational Modeling for Engineering MECN 6040
Chapter 8 Elliptic Equation.
Geometric (Classical) MultiGrid. Hierarchy of graphs Apply grids in all scales: 2x2, 4x4, …, n 1/2 xn 1/2 Coarsening Interpolate and relax Solve the large.
Parallelizing stencil computations Based on slides from David Culler, Jim Demmel, Bob Lucas, Horst Simon, Kathy Yelick, et al., UCB CS267.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Part Eight Partial Differential Equations.
Total Recall Math, Part 2 Ordinary diff. equations First order ODE, one boundary/initial condition: Second order ODE.
ECE602 BME I Partial Differential Equations in Biomedical Engineering.
ECE669 L4: Parallel Applications February 10, 2004 ECE 669 Parallel Computer Architecture Lecture 4 Parallel Applications.
Computer-Aided Analysis on Energy and Thermofluid Sciences Y.C. Shih Fall 2011 Chapter 6: Basics of Finite Difference Chapter 6 Basics of Finite Difference.
PARTIAL DIFFERENTIAL EQUATIONS
Introduction to Differential Equations
PARTIAL DIFFERENTIAL EQUATIONS
Partial differential equations Function depends on two or more independent variables This is a very simple one - there are many more complicated ones.
Chapter 13 Finite Difference Methods: Outline Solving ordinary and partial differential equations Finite difference methods (FDM) vs Finite Element Methods.
Numerical Methods for Partial Differential Equations
Differential Equations and Boundary Value Problems
CISE301: Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures KFUPM (Term 101) Section 04 Read & CISE301_Topic9.
SE301: Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures KFUPM Read & CISE301_Topic9 KFUPM.
Numerical methods for PDEs PDEs are mathematical models for –Physical Phenomena Heat transfer Wave motion.
Scientific Computing Partial Differential Equations Explicit Solution of Wave Equation.
COMPUTATIONAL MODELING FOR ENGINEERING MECN 6040 Professor: Dr. Omar E. Meza Castillo Department.
1 Numerical Methods and Software for Partial Differential Equations Lecturer:Dr Yvonne Fryer Time:Mondays 10am-1pm Location:QA210 / KW116 (Black)
Scientific Computing Partial Differential Equations Introduction and
Hyperbolic PDEs Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Lecture 8 – Stencil Pattern Stencil Pattern Parallel Computing CIS 410/510 Department of Computer and Information Science.
Scientific Computing Partial Differential Equations Poisson Equation.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Parallel Programming in C with MPI and OpenMP Michael J. Quinn.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Linear Systems Iterative Solutions CSE 541 Roger Crawfis.
Parallel Simulation of Continuous Systems: A Brief Introduction
MA2213 Lecture 11 PDE. Topics Introduction p Poisson equation p Visualization of numerical results p Boundary conditions p.
+ Numerical Integration Techniques A Brief Introduction By Kai Zhao January, 2011.
Elliptic PDEs and the Finite Difference Method
Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Introduction to PDE classification Numerical Methods for PDEs Spring 2007 Jim E. Jones References: Partial Differential Equations of Applied Mathematics,
Engineering Analysis – Computational Fluid Dynamics –
Numerical methods 1 An Introduction to Numerical Methods For Weather Prediction by Mariano Hortal office 122.
Discretization Methods Chapter 2. Training Manual May 15, 2001 Inventory # Discretization Methods Topics Equations and The Goal Brief overview.
MULTISCALE COMPUTATIONAL METHODS Achi Brandt The Weizmann Institute of Science UCLA
Elliptic PDEs and Solvers
Partial Derivatives Example: Find If solution: Partial Derivatives Example: Find If solution: gradient grad(u) = gradient.
Solving Partial Differential Equation Numerically Pertemuan 13 Matakuliah: S0262-Analisis Numerik Tahun: 2010.
Department of Mathematics Numerical Solutions to Partial Differential Equations Ch 12. Applied mathematics. Korea University.
Relaxation Methods in the Solution of Partial Differential Equations
EEE 431 Computational Methods in Electrodynamics
High Altitude Low Opening?
Boundary-Value Problems in Rectangular Coordinates
Christopher Crawford PHY
Chapter 30.
Solving the heat equation using ADI method
Convergence in Computational Science
Introduction to Partial Differential Equations
PDEs and Examples of Phenomena Modeled
Partial Differential Equations
Finite Difference Method
ME/AE 339 Computational Fluid Dynamics K. M. Isaac Topic2_PDE
Analytical Tools in ME Course Objectives
Topic 3 Discretization of PDE
Scientific Computing Partial Differential Equations Implicit Solution of Heat Equation.
Partial Differential Equations
Notes on Assignment 3 OpenMP Stencil Pattern
Topic 3 Discretization of PDE
Jacobi Project Salvatore Orlando.
Numerical Methods on Partial Differential Equation
Stencil Pattern ITCS 4/5145 Parallel computing, UNC-Charlotte, B. Wilkinson Oct 14, 2014 slides6b.ppt 1.
Stencil Pattern ITCS 4/5145 Parallel computing, UNC-Charlotte, B. Wilkinson Jan 28,
Stencil Pattern ITCS 4/5145 Parallel computing, UNC-Charlotte, B. Wilkinson StencilPattern.ppt Oct 14,
Parallel Programming in C with MPI and OpenMP
Topic 3 Discretization of PDE
Presentation transcript:

CS6068 Applications: Numerical Methods Solving ordinary and partial differential equations Finite difference methods (FDM) Wave equation: vibrating string problem Heat equation: Steady state heat distribution problem

PDEs and Examples of Phenomena Modeled Ordinary differential equation: equation containing derivatives of a function of one variable Partial differential equation: equation containing derivatives of a function of two or more variables Models: Air flow over an aircraft wing Blood circulation in human body Water circulation in an ocean Bridge deformations as its carries traffic Evolution of a thunderstorm Oscillations of a skyscraper hit by earthquake Strength of a toy Financial Markets

Turbulence: The most important unsolved problem of classical physics Nobel Laureate Richard Feynman http://usatoday30.usatoday.com/tech/science/columnist/vergano/2006-09-10-turbulence_x.htm Courtesy MICOM group at the Rosenstiel School of Marine and Atmospheric Science, University of Miami

The Variety of Methods for Solving PDEs Finite element method Finite difference method Convert PDEs into matrix equation Usage of truncated Taylor Series approximations Add boundary condition Iteration from initial condition

Class of Linear Second-order PDEs Linear second-order PDEs are of the form where A - H are functions of x and y only Elliptic PDEs: B2 - AC < 0 (steady state heat equations) Parabolic PDEs: B2 - AC = 0 (heat transfer equations) Hyperbolic PDEs: B2 - AC > 0 (wave equations)

Difference Quotients

Computational Formulas for 1st and 2nd Derivatives

Example Use of Successive Approximations by Finite Differences: Since sin ’ x = cos x we have: cos(1)≈(sin(1+h)−sin(1-h))/2h h= 0.1 0.01 0.001 0.0001 approx= .539402, .540293,.540302,.540302 error=.0009,.000009,.00000009,.0000000009 Cos(1) =.54030230586

Vibrating String Problem Vibrating string modeled by a hyperbolic PDE Derived from Newton’s and Hooke’s Law F= m a = -k y

Scalar wave equation in one space dimension Solution Stored in 2-D Array Each row represents state of string at some point in time Each column shows how position of string at a particular point changes with time

Finite Difference Approximation

Discrete Space, Time Intervals Lead to 2-D Array

Heart of Sequential C Program u[j+1][i] = 2.0*u[j][i] - u[j-1][i] + C2*(u[j][i+1] - 2.0*u[j][i] + u[j][i-1])

Parallel Program Design Associate primitive task with each element of matrix Examine communication pattern Agglomerate tasks: thread per column Static number of identical tasks Regular communication pattern Strategy: agglomerate columns into blocks Difficulty: sharing information across blocks

Communication Still Needed Initial values (in lowest row) are computed without communication Values in black cells cannot be computed without access to values held by other tasks

Ghost Points Ghost points: memory locations used to store redundant copies of data held by neighboring processes Allocating ghost points as extra columns simplifies parallel algorithm by allowing same loop to update all cells

Communication in an Iteration This iteration the process is responsible for computing the values of the yellow cells.

Computation in an Iteration This iteration the process is responsible for computing the values of the yellow cells. The striped cells are the ones accessed as the yellow cell values are computed.

Replicating Computations Without replication: With replication:

Next Example: Steady State Heat Distribution Problem Ice bath Steam Steam Steam

Solving the Problem Underlying PDE is the Poisson equation When f = 0 called Laplace equation This is an example of an elliptical PDE Will create a 2-D grid Each grid point represents value of state state solution at particular (x, y) location in plate

Heart of Sequential C Program w[i][j] = (u[i-1][j] + u[i+1][j] + u[i][j-1] + u[i][j+1]) / 4.0;

//Cuda Kernel Code that updates temperatures based on difference with average of neighbors // T-new= T-old + k [Sum(Neighbors) – 4T-old]

Optimized Implementation Method 1: use ghost points around 2-D blocks, but requires extra copying steps Method 2: use “texture memory” in CUDA which provides for fast access – spatially localized cache. See sample code in cuda_by_example.zip