User Tools

Site Tools


scbc2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scbc2 [2014/09/09 07:06] – [Accuracy versus precision] simonw7scbc2 [2022/07/21 06:59] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +=====Some Computer Science Considerations=====
 +
 +In this session we explore what a model is, and how a simulation is different.  We draw on our experience with simulating plasmas but also on the experience of general simulations.  Useful references also include Oberkampf's Verification and Validation in Scientific Computing (e.g. Chapter 2).
 +
 +====Overall process of computational simulation====
 +
 +"The overall problem solving process in computational simulation usually includes the following steps:
 +
 +  - Develop a mathematical model -- usually expressed by equations of some type -- of a physical phenomena or system of interest.
 +  - Develop algorithms to solve the equations numerically.
 +  - Implement the algorithms in computer software.
 +  - Run the software on a computer to simulate the physical process numerically.
 +  - Represent the computed results in some comprehensible form such as graphical visualization.
 +  - Interpret and validate the computed results, repeating any or all of the preceding steps, if necessary." 
 +
 +(-- M. T. Heath. //Scientific Computing: An Introductory Survey// McGraw-Hill, New York, 2nd edition, 2002.)
 +
 +
 +All simulations are implemented with assumptions, most of which are never written down.  Too, simulations are riddled with approximations, most of them out of our control -- but one must have an awareness of these in order to account for them as needed.
 +
 +
 +//Some// sources of approximation:
 +
 +  * modeling - for example, omitting friction
 +  * empirical measurements - for examples, instruments have finite precision; noise; sample size
 +  * previous computations - input or data may have come from other approximate computations
 +  * truncation - for example, having to truncate an infinite series
 +  * rounding - can only represent finite precision
 +  * computer arithmetic
 +
 +(//Ibid//.)
 +
 +Also:
 +  * limitations from using computers:
 +    * binary representation of decimals
 +    * [[ https://en.wikipedia.org/wiki/Machine_epsilon | machine precision ]]
 +
 +
 +====Algorithmic (in)stability====
 +
 +Even a "correct" implementation of a model into code may not produce the results one is hoping for.  This is often out of one's hands as a user but has been a hidden surprise for many!  If a model implementer, one needs to be aware of possible issues.
 +
 +[[ http://livetoad.org/Courses/Documents/292d/Notes/instability_example.pdf | Numerical Instability: An Example ]]
 +
 +Particularly interesting exercises (pages 18-20, but 19-20):
 +[[ http://www.seas.ucla.edu/~vandenbe/103/lectures/accuracy.pdf | Problem Condition and Numerical Stability ]]
 +
 +
 +====Accuracy versus precision====
 +
 +These words mean different things, though many scientists/programmers/users use them sloppily; two
 +distinct concepts; give thought to the "rightness" (or not) of simulation results
 +
 +[[ http://www.mathsisfun.com/accuracy-precision.html | Accuracy and Precision ]]
 +
 +[[ http://spiff.rit.edu/classes/phys317/lectures/error.html | How Good is a Result? ]]
 +//especially the note about units//
 +
 +Which is more desirable: accuracy or precision?  Why?  Why might one prefer the other?  Why can't one always have both?
 +
 +
 +====Working Environment / Tools====
 +
 +===Shell===
 +
 +[[wiki:CLI|Shell Lecture Notes]]
 +
 +See also [[http://www.explainshell.com/ | Explain Shell ]]
 +
 +[[http://sites.tufts.edu/cbi/files/2013/01/linux_cheat_sheet.pdf|Cribsheet]]
 +
 +===Make===
 +
 +[[wiki:make|Make Lecture Notes]]
 +
 +