CS 205A class_1 lecture notes

Scientific Computing

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 205 – class 1 Types of Errors Covered in class: 4, 6, 7 1. When doing integer calculations one can many times proceed exactly, except of course in certain situations, e.g. division 5/2=2.5. However, when doing floating point calculations rounding errors are the norm, e.g. 1./3.=.3333333… cannot be expressed on the computer. Thus the computer commits rounding errors to express numbers with machine precision, e.g. 1./3.=.3333333. Machine precision is 7 10 for single precision and 16 10 for double precision. Rounding errors are only one source of approximation error when considering floating point calculations. Some others are listed below. 2. Approximation errors come in many forms: a. empirical constants – Some numbers are unknown and measured in a laboratory only to limited precision. Others may be known more accurately but limited precision hinders the ability to express these numbers on a finite precision computer. Examples include Avogadro’s number, the speed of light in a vacuum, the charge on an electron, Planck’s constant, Boltzmann’s constant, pi, etc. Note that the speed of light is 299792458 m/s exactly, so we are ok for double precision but not single precision. b. modeling errors – Parts of the problem under consideration may simply be ignored. For example, when simulating solids or fluids, sometimes frictional or viscous effects respectively are not included. c. truncation errors – These are also sometimes called discretization errors and occur in the mathematical approximation of an equation as opposed to the mathematical approximation of the physics (i.e. as in modeling errors). We will see later that one cannot take a derivative or integral exactly on the computer so we approximate these with some formula (recall Simpson’s rule from your Calculus class). d. inaccurate inputs – Many times we are only concerned with part of a calculation and we receive a set of input numbers and produce a set of output numbers. It is important to realize that the inputs may have been previously subjected to any of the errors listed above and thus may already have limited accuracy. This can have implications for algorithms as well, e.g. if the inputs are only accurate to 4 decimal places, it makes little sense to carry out the algorithm to an accuracy of 8 decimal places. This issue commonly resurfaces in scientific visualization or physical simulation where experimental engineers can be unhappy with visualization algorithms that are “lossy”, meanwhile forgetting that the part that is lost may contain no useful, or accurate information whatsoever.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3. More about errors a. In dealing with errors we will refer to both the absolute error and the relative error. i. Absolute error = approximate value – true value ii. Relative error = absolute error / true value b. One needs to be careful with big and small numbers, especially when dividing by the latter. Many times calculations are non-dimensionalized or normalized in order to operate in a reasonable range of values. For example, consider the matrix equation 36 210 510 14 0 6 ee
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/29/2008 for the course CS 205A taught by Professor Fedkiw during the Fall '07 term at Stanford.

Page1 / 7

CS 205A class_1 lecture notes - CS 205 class 1 Types of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online