This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 1 Ch. 1 Introduction References: 1. J.H. Mathews, “ Numerical methods for computer science, engineering, and mathematics” , Ch. 1 2. T.M.R. Ellis et al., “ Fortran 90 programming” , Ch. 1 2 Outline 1.1 Why computation? 1.2 Computer 1.3 Binary number system 1.4 Integer data 1.5 Real data 1.6 Character data 1.7 Computer languages 3 1.1 Why computation? * Consider the following equation: x a b 1 − x = Suppose a = 2 & b = 1/2: 2 x 2 x − 1 = 2 x − 1 x 1 = x = 1 / 2 or − 1 => * In general, we don't have analytic solutions! We then need to consider numerical approximation. Example: a = 14 & b = 0.0514 x 14 − 0.0514 1 − x = * This equation appears in the estimation of the mass fraction of the 4 He nuclei in a simplified corecollapse model of massive stars. 4 * In realistic situations, there are very few physical problems that can be solved analytically. * As physics students (or physicists), we need to have some knowledge of computer programming and numerical methods. * The followings are some astrophysical examples where computers can help us: 1. Simulation of the merger of two neutron stars NASA's Grand Challenge Project (http://www.wugrav.wustl.edu) 5 2. Simulation of Type II supernova explosion of a massive star (Janka et al. http://arxiv.org/abs/0706.3056) 6 3. Supernova 1987A: Formations of triple rings Numerical simulation by Morris & Podsiadlowski Science, 315, 1103 (2007) 7 1.2 Computer Internal memory Control unit Arithmetic logic unit Central processing unit (CPU) Main memory (RAM) Secondary memory (hard disk, CDs,...) Input devices (keyboard, scanner,....) Output devices (Screen, printer,...) Note: RAM = R andom a ccess m emory 8 CU OrlonComputational Grid Question: What computers do physicists use for their research? Answer: From PC to supercomputer, or even a cluster of supercomputers! 9 Data representation * Computer memories are composed of millions of switchs: ON or OFF * Each switch represents one binary digit ( bit ): ON state 1 OFF state * A number of bits are group together to represent numbers in the binary number system . * A byte (B) = a group of 8 bits that are used together to represent a binary number. (eg: 10100110, 01110001,....) * Byte is the fundamental unit to measure the capacity of a computer's memory (eg: 1GB RAM, 100GB harddisk,...) 10 1.3 Binary number system Recall: For the usual base 10 number system, the number “ 1289” is expressed as: 1289 = 1 × 10 3 2 × 10 2 8 × 10 1 9 × 10 * In general, for a positive integer N : N = a m × 10 m a m − 1 × 10 m − 1 ⋯ a 2 × 10 2 a 1 × 10 1 a × 10 where the digits a m are chosen from { 0,1,2,..,9 } * Decimal notation : N = a k a k − 1 ⋯ a 2 a 1 a 0 10 Subscript 10: base 10 system * If it is understood that 10 is the base: N = a k a k − 1 ⋯ a 2 a 1 a Example: we understand that 1289 = 1289...
View
Full Document
 Spring '10
 DrLinLapMing
 Physics, Binary numeral system, Decimal, floatingpoint number

Click to edit the document details