Iterative Solution of the Poisson Equation

Similar documents
Ring structure of splines on triangulations

1 Example 1: Axis-aligned rectangles

Linear Circuits Analysis. Superposition, Thevenin /Norton Equivalent circuits

Finite difference method

8.5 UNITARY AND HERMITIAN MATRICES. The conjugate transpose of a complex matrix A, denoted by A*, is given by

Consider a 1-D stationary state diffusion-type equation, which we will call the generalized diffusion equation from now on:

benefit is 2, paid if the policyholder dies within the year, and probability of death within the year is ).

Causal, Explanatory Forecasting. Analysis. Regression Analysis. Simple Linear Regression. Which is Independent? Forecasting

1. Fundamentals of probability theory 2. Emergence of communication traffic 3. Stochastic & Markovian Processes (SP & MP)

Recurrence. 1 Definitions and main statements

Application of Quasi Monte Carlo methods and Global Sensitivity Analysis in finance

Support Vector Machines

Solution: Let i = 10% and d = 5%. By definition, the respective forces of interest on funds A and B are. i 1 + it. S A (t) = d (1 dt) 2 1. = d 1 dt.

SPEE Recommended Evaluation Practice #6 Definition of Decline Curve Parameters Background:

A Three-Point Combined Compact Difference Scheme

Least Squares Fitting of Data

Conversion between the vector and raster data structures using Fuzzy Geographical Entities

NPAR TESTS. One-Sample Chi-Square Test. Cell Specification. Observed Frequencies 1O i 6. Expected Frequencies 1EXP i 6

The Development of Web Log Mining Based on Improve-K-Means Clustering Analysis

A machine vision approach for detecting and inspecting circular parts

Computational Fluid Dynamics II

Immersed interface methods for moving interface problems

Numerical Methods 數 值 方 法 概 說. Daniel Lee. Nov. 1, 2006

Point cloud to point cloud rigid transformations. Minimizing Rigid Registration Errors

Calculation of Sampling Weights

Section 5.4 Annuities, Present Value, and Amortization

Project Networks With Mixed-Time Constraints

This circuit than can be reduced to a planar circuit

The OC Curve of Attribute Acceptance Plans

LECTURES on COMPUTATIONAL NUMERICAL ANALYSIS of PARTIAL DIFFERENTIAL EQUATIONS

v a 1 b 1 i, a 2 b 2 i,..., a n b n i.

Chapter 4 ECONOMIC DISPATCH AND UNIT COMMITMENT

Characterization of Assembly. Variation Analysis Methods. A Thesis. Presented to the. Department of Mechanical Engineering. Brigham Young University

A Penalty Method for American Options with Jump Diffusion Processes

Lecture 2: Single Layer Perceptrons Kevin Swingler

Description of the Force Method Procedure. Indeterminate Analysis Force Method 1. Force Method con t. Force Method con t

DEFINING %COMPLETE IN MICROSOFT PROJECT

5 Solving systems of non-linear equations

Risk-based Fatigue Estimate of Deep Water Risers -- Course Project for EM388F: Fracture Mechanics, Spring 2008

Quantization Effects in Digital Filters

We are now ready to answer the question: What are the possible cardinalities for finite fields?

Production. 2. Y is closed A set is closed if it contains its boundary. We need this for the solution existence in the profit maximization problem.

POLYSA: A Polynomial Algorithm for Non-binary Constraint Satisfaction Problems with and

CHOLESTEROL REFERENCE METHOD LABORATORY NETWORK. Sample Stability Protocol

PERRON FROBENIUS THEOREM

Module 2 LOSSLESS IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

How To Calculate The Accountng Perod Of Nequalty

Compiling for Parallelism & Locality. Dependence Testing in General. Algorithms for Solving the Dependence Problem. Dependence Testing

Lecture 3: Force of Interest, Real Interest Rate, Annuity

"Research Note" APPLICATION OF CHARGE SIMULATION METHOD TO ELECTRIC FIELD CALCULATION IN THE POWER CABLES *

Logistic Regression. Lecture 4: More classifiers and classes. Logistic regression. Adaboost. Optimization. Multiple class classification

where the coordinates are related to those in the old frame as follows.

Using Series to Analyze Financial Situations: Present Value

THE METHOD OF LEAST SQUARES THE METHOD OF LEAST SQUARES

8 Algorithm for Binary Searching in Trees

CHAPTER 5 RELATIONSHIPS BETWEEN QUANTITATIVE VARIABLES

Level Annuities with Payments Less Frequent than Each Interest Period

Latent Class Regression. Statistics for Psychosocial Research II: Structural Models December 4 and 6, 2006

An Alternative Way to Measure Private Equity Performance

Energies of Network Nastsemble

On the Solution of Indefinite Systems Arising in Nonlinear Optimization

Faraday's Law of Induction

Forecasting the Demand of Emergency Supplies: Based on the CBR Theory and BP Neural Network

Calculating the high frequency transmission line parameters of power cables

Rotation Kinematics, Moment of Inertia, and Torque

Kinematic Analysis of Cam Profiles Used in Compound Bows. A Thesis. Presented to. The Graduate Faculty of the University of Missouri

What is Candidate Sampling

The circuit shown on Figure 1 is called the common emitter amplifier circuit. The important subsystems of this circuit are:

An Integrated Semantically Correct 2.5D Object Oriented TIN. Andreas Koch

SIMPLE LINEAR CORRELATION

The Application of Fractional Brownian Motion in Option Pricing

Financial market forecasting using a two-step kernel learning method for the support vector regression

BERNSTEIN POLYNOMIALS

PRACTICE 1: MUTUAL FUNDS EVALUATION USING MATLAB.

A Simple Approach to Clustering in Excel

THE DISTRIBUTION OF LOAN PORTFOLIO VALUE * Oldrich Alfons Vasicek

RESEARCH ON DUAL-SHAKER SINE VIBRATION CONTROL. Yaoqi FENG 1, Hanping QIU 1. China Academy of Space Technology (CAST)

Joint Scheduling of Processing and Shuffle Phases in MapReduce Systems

Mathematical modeling of water quality in river systems. Case study: Jajrood river in Tehran - Iran

Feature selection for intrusion detection. Slobodan Petrović NISlab, Gjøvik University College

A high-order compact method for nonlinear Black-Scholes option pricing equations of American Options

Alternate Approximation of Concave Cost Functions for

Time Domain simulation of PD Propagation in XLPE Cables Considering Frequency Dependent Parameters

PAS: A Packet Accounting System to Limit the Effects of DoS & DDoS. Debish Fesehaye & Klara Naherstedt University of Illinois-Urbana Champaign

Actuator forces in CFD: RANS and LES modeling in OpenFOAM

How To Assemble The Tangent Spaces Of A Manfold Nto A Coherent Whole

CHAPTER 14 MORE ABOUT REGRESSION

Optimization of network mesh topologies and link capacities for congestion relief

Time Value of Money Module

Extending Probabilistic Dynamic Epistemic Logic

Institute of Informatics, Faculty of Business and Management, Brno University of Technology,Czech Republic

CS 2750 Machine Learning. Lecture 3. Density estimation. CS 2750 Machine Learning. Announcements

A system for real-time calculation and monitoring of energy performance and carbon emissions of RET systems and buildings

New Approaches to Support Vector Ordinal Regression

Face Verification Problem. Face Recognition Problem. Application: Access Control. Biometric Authentication. Face Verification (1:1 matching)

A hybrid global optimization algorithm based on parallel chaos optimization and outlook algorithm

J. Parallel Distrib. Comput.

Use of Numerical Models as Data Proxies for Approximate Ad-Hoc Query Processing

IDENTIFICATION AND CORRECTION OF A COMMON ERROR IN GENERAL ANNUITY CALCULATIONS

Automated information technology for ionosphere monitoring of low-orbit navigation satellite signals

Transcription:

Iteratve Soluton of the Posson Equaton The purpose of ths project s to develop an teratve solver for the Posson equaton on cartesan grds n multple dmensons. In vector form ths equaton s gven by: 2 u = f (1) where u(x) s the soluton sought and f(x) s a known functon. Boundary condtons must be specfed on the entre permeter of the doman n order to determne a unque soluton to the equaton. For smplcty we wll use so-called Drchlet boundary condtons: the soluton u s known on the boundary. In cartesan coordnates the Posson equaton takes the followng form u xx = f(x) 2 u = ( u) = u xx + u yy = f(x, y) u xx + u yy + u zz = f(x, y, z) In order to solve the problem numercally we need to replace the second order partal dervatves wth second-order fnte dffence approxmatons. For the onedmensonal case, for example, we would use: 1D 2D 3D u xx = u 1 2u + u +1 x 2 + O( x 2 ). (3) The dfferental equatons become a system of lnear algebrac equatons that we wll solve usng Jacob teratons. (2) 1

1 The 1D Posson solver a x 1 x x +1 b 1 2 2 1 + 1 + 2 M M + 1 Fgure 1: 1D fnte dfference grd for the nterval a x b usng a unform grd spacng x = x +1 x = (b a)/m. The ndex of the nodes are the ntegers below the lne, and the correspondng abcssa are shown above. Fgure 1 shows the dscrete grd and the locaton of the nodes where the soluton s sought. Applyng the dfferental equaton at each one of the nteror nodes we obtan the algebrac system: u 1 2u + u +1 = x 2 f, for = 2, 3, 4,..., M (4) It s very mportant to remember that the system has only (M 1) unknowns snce u 1 and u M+1 are known from the boundary condtons; the unknowns u are located only at the nteror nodes. The teratve soluton proceeds by startng wth a guess whch, n general, wll not satsfy equaton 4. The guess s then updated to enforce the equalty 4 at pont u (0) u (n+1) = u(n) +1 + u (n) +1 x 2 f 2 for = 2, 3, 4,..., M (5) where the superscrpt n s the teraton ndex. Ths update s repeated untl a convergence crteron s reached, for example the correcton drops below a specfed tolerance: max 2 M c (n) = max 2 M u (n+1) u (n) < ɛ (6) Theoretcal analyss guarantees that the process wll eventually reach a soluton, and that the number of teraton needed to reach convergence scales as K ln ɛ ln ( 1 2 sn 2 ) 2M 2 ln ɛ (7) π π 2 2M The above can be used as a rough estmate to bound the teraton count. The program desgn shown n 2-3 can be used as an ntal desgn plan. The mpled dvson of labor allows the man program to control the varous tasks wth a far amount of flexblty. The code should be desgned by stages, and you should leverage your prevous efforts and re-use the software you have already bult and tested to complete the assgnment. 2

program possonsolver use grd! geometry module use fleo! fle /o module use solver! new solver to be bult use possondata! BC, Forcng and 1st guess module mplct none nteger, parameter :: M =8! number of ntervals nteger, parameter :: Mp=M+1! number of ponts real*8, parameter :: tol=1.d-9! error tolerance real*8 :: u(mp)! soluton real*8 :: f(mp)! forcng functon real*8 :: f(mp)! x-coordnates real*8 :: enorm! error norms of the teraton process nteger :: nter! number of teratons allowed/performed call SetGrd(xg,dx,smn,smax,M)! Defne the grd call WrteAscVector(xg,Mp)! save grd to fle call DefneRhs(f,x,Mp)! Defne forcng functon call FrstGuess(u,x,Mp)! frst Guess, can be smply u=0. call SetBC(u,x,Mp)! Set Boundary condtons call IteratveSolver(u,f,dx,tol,enorm,nter,Mp)! teratve solver call OutputSoluton(u,Mp)! Save soluton to a fle stop end program possonsolver Fgure 2: Outlne of man program. The man program sets-up the problem (geometry, forcng functon, frst guess and boundary condtons), calls the teratve solver, and outputs the soluton to a fle. The solver takes the tolerance 3

module solver contans subroutne IteratveSolver(u,f,dx,tol,enorm,nter,Mp) mplct none nteger, ntent(n) :: Mp! sze of computatonal grd real*8, ntent(n) :: f(mp)! forcng functon real*8, ntent(n) :: dx! grd spacng real*8, ntent(n) :: tol! tolerance real*8, ntent(out) :: enorm! error norm reported nteger, ntent(nout) :: nter! max number of teratons on nput real*8, ntent(nout) :: u(mp)! soluton nteger :: ntermax,t ntermax = nter! max teratons allowed do t = 1,ntermax call JacobIteraton(u,f,dx,enorm,Mp)! perform sngle teraton f (enorm < tol) then ext! soluton has converged ext loop endf enddo f (enorm > tol.and. t > ntermax)then prnt *, Soluton dd not converge! error warnng endf nterm = t return end subroutne IteratveSolver! JacobIteraton does a sngle update of soluton u! t returns an error norm measurng the maxmum change:! enorm = max_ u_^{n+1} - u_ subroutne JacobIteraton(u,f,dx,enorm,Mp)! perform sngle teraton mplct none... return end subroutne JacobIteraton end module solver Fgure 3: Outlne of teratve solver. The teratve solver specfed the tolerance desred, and the maxmum number of teratons allowed. It returns, asde from the soluton, an error measure of the teraton error, and the number of teratons necessary to reach the prescrbed error level. If the teraton fals to converge wthn the alloted teratons, an error message s prnted. The subroutne JacobIteraton performs a sngle update of the soluton 4

1. No forcng Durng the development phase of the program, use f = 0, u 1 = 1, and u M+1 = M + 1. The soluton s then smply a straght lne and s gven by u = M(x a) + 1, and the numercal soluton should yeld ths exact soluton. Use the nterval 1 x 1. 2. Smple forcng Once the code s workng try the code on the followng problem: whose soluton s u = 6x 3. u(±1) = ±6, f = 6x (8) 3. Non-trval problem Once the code s workng try your program on the followng case: u(±1) = cos ( πe ±1) f = πe x [e x cos(πe x ) + sn(πe x )] u(x) = cos (πe x ) The numercal soluton s now only approxmate. Try solvng the equatons usng 25, 50, 100, 200, 400, and 800 ponts. For each case record the error commtted, and the number of teratons requred to acheve convergence. Verfy that the method s ndeed second order accurate. 2 The 2D Posson solver Fgure 4 refers to the two-dmensonal computatonal grd. The fnte dfference approxmaton takes the form: u 1,j 2u,j + u +1,j x 2 + u,j 1 2u,j + u,j+1 y 2 = f,j, 2 M, 2 j N (9) Agan the unknown are located strctly n the nteror of grd snce u s known at the boundares from the boundary condtons, and hence there are (M 1)(N 1) unknowns. The teratve update of the Jacob teraton can now be wrtten as: u (n+1),j = ( (n) u 1,j + u (n) ) +1,j y 2 + ( u (n),j 1 + u,j+1) (n) x 2 x 2 y 2 f,j 2 ( x 2 + y 2 ) (10) Agan t can be shown that the number of teratons needed to reach a tolerance level scales as K max(m 2, N 2 ) ln ɛ. The programmng tasks requred s now to upgrade your one-dmensonal teratve solver to two-dmensons followng the same steps outlned before. 5

N + 1 (b, d) N. j + 2 y j+1 j + 1 y j j y j 1 j 1 j 2. 2 1 1 2 2 1 + 1 + 2 M M + 1 (a, c) x 1 x x +1 Fgure 4: 2D fnte dfference grd for the nterval a x b usng a unform grd spacng x = x +1 x = (b a)/m, and y = y j+1 y j = (d c)/n. The nodes must now be referred to wth a 2-nteger ndex (, j). The stencl for one of the computatonal grds s shown n red. Development phase Use a trval case where the exact soluton s just lnear n each of the coordnate, say u = x + 2 y 3z, f = 0, to test your code durng development. Another nterestng soluton s u = x 2 y 2. Use the doman x 2, and y 1 wth M = 8 and N = 5. The boundary condtons can be lfted from the exact soluton. Expermentaton phase For ths case the problem s data, ncludng the exact soluton, s gven by ( ) π u = cos 2 e(y x) ( ) π + sn 2 e(x+y) ( ) π f = πe [cos (x+y) 2 e(x+y) π ( )] π 2 e(x+y) sn 2 e(x+y) ( ) π πe [sn (y x) 2 e(y x) + π ( )] π 2 e(y x) cos 2 e(y x) (11) (12) Use the same geometry as for the earler case, but experment wth changng the number of ponts. Ths s somewhat of a demandng problem as the soluton starts oscllatng fast as one approaches the north-eastern corner of 6

the doman, one can antcpate that to model a wavelength accurately at least 8 ponts are needed, and hence y > 0.025. Agan, confrm the second order convergence rate usng (100 50), (200 100), (400 200), (800 400) and (1600 800) cells. Record the number of teratons needed to acheve convergence, and the CPU-tme consumed. 3 The 3D Posson solver Ths part s optonal, and does not requre much work gven that ts a smple extenson of the 2D code. It however drves home the message that the number of unknowns, and hence the tme to soluton, grows very fast n three-dmensons. The 3D stencl for the fnte dfference approxmaton of the Laplace operator, 2, nclude 7 ponts on the computatonal grd, and s gven by: u 1,j,k 2u,j,k + u +1,j,k + u,j 1,k 2u,j,k + u,j+1,k x 2 y 2 + u,j,k 1 2u,j,k + u,j,k+1 z 2 = f,j,k (2, 2, 2) (, j, k) (M, N, P ) (13) where P s the number of ntervals n the z-drecton. Agan we have assumed that Drchlet boundary condtons are appled on all boundares = 1, M, j = 1, N, and k = 1, P. The total number of unknowns s then (M 1)(N 1)(P 1). Notce that the number of unknowns grows very quckly n 3D; for example, a 25 25 25 cell dscretzaton wll have (25 1) 3 unknowns or 13,824 unknowns. The Jacob teratve soluton takes the form: u (n+1) ( (n),j,k = a x u 1,j,k + ) ( u(n) (n) +1,j,k + ay u,j 1,k + ) ( u(n) (n),j+1,k + az u,j,k 1 + ) u(n),j,k+1 a f f,j,k (14) a x = y 2 z 2 (15) a y = z 2 x 2 (16) a z = x 2 y 2 (17) a f = x 2 y 2 z 2 (18) 7