Presentation is loading. Please wait.

Presentation is loading. Please wait.

Assignment 3 Questions 1 and 2 Stephen Adams CS 4MN3

Similar presentations


Presentation on theme: "Assignment 3 Questions 1 and 2 Stephen Adams CS 4MN3"— Presentation transcript:

1 Assignment 3 Questions 1 and 2 Stephen Adams 0386110 CS 4MN3
March 17, 2009

2 Q1: Runge’s Phenomenon Clearly shown in the Cauchy-Lorentz function (Its importance in physics is due to it being the solution to the differential equation describing forced resonance) variable in denominator = full set of derivatives important because error is bound by derivatives Consider Clearly grows as higher order approximations are used

3 Q1: Runge’s Phenomenon Red = exact Blue = 5th order i.p.
Green = 9th order i.p. Can be countered with non-equidistant intervals or by use of splines.

4 Natural Cubic Spline A spline is a special piecewise polynomial especially useful for interpolation and curve smoothing Splines work well with both uniform and non-uniform node distributions Advantages to a degree 3 spline are curve is highly flexible (due to extra critical point) can be reverse-engineered from a real solution to provide real co-efficients avoids Runge’s phenomenon

5 Construction Given function F:
define the set S of cubic polynomials S1(x1)…Sn(xn) for each xi, x=[0,n] F(xi) = Si(xi) x=[1,n-1] Si(xi)’, Si(xi)’’ are continuous s’’(0) = s’’(xn) = 0 (eg linear)

6 Natural? s’’(0) = s’’(xn) = 0 (eg linear)
This condition completes the set of equations and leads to a tridiagonal system that can be easily solved to provide the co-efficients of the polynomials Question 1 stores the co-efficient vectors as they are re-used frequently (why recalculate all the time?)

7 Q2: Error function The Gauss error function occours frequently in probability and differential equations. It is very sensitive about x = 0

8 IEEE Floats, lots near 0 How close to 0 that the problem exists is implementation dependant but consider IEEE-754 SP range 0, +/-2[-128,127] ~half are on [0,1) or (-1,0] IEEE-754 DP range 0, +/-2[-1024, 1023] is very close to 0 … denorms are even worse …

9 QuadR Quadr is designed to perform adaptive quadrature using the rectangle rule (see also quad for Simpson’s rule) If the width of the rectangle is allowed to go to 0, then we have exactly the integral Here the function value is computed for the mid-point of each rectangle, which can be prohibitive

10 Adaptive Quadrature Adaptive techniques attempt to reduce the prohibitive cost by employing wide rectangles on areas where the function has low order (or linear) derivatives This allows more precision in sensitive areas of the function Determining overall error can be tested by several techniques, such as using multiple quadrature approaches or comparing to a table of known values.

11 Sources used Wikipedia Course notes Wolfram Mathworld Mathworks.com


Download ppt "Assignment 3 Questions 1 and 2 Stephen Adams CS 4MN3"

Similar presentations


Ads by Google