You are on page 1of 7

Basics What does Computational Physics do?

of Computational Physics
ƒ Atomic Physics studies atoms

ƒ What is Computational Physics? ƒ Nuclear Physics studies nuclei

ƒ Basic computer hardware ƒ Plasma Physics studies plasmas

ƒ Software 1: operating systems ƒ Solid State Physics studies solids

ƒ Software 2: Programming languages ƒ Computational physics does not study


computers
ƒ Software 3: Problem-solving environment

What is Computational Physics? What is Computational Physics?

“Computational physics is a synthesis of Computational physics is a tool for solving


theoretical analysis, numerical algorithms, and complex numerical problems in physics
computer programming.”
P. L. DeVries Am. J. Phys., vol. 64, 364 (1996)

3 4

Example: university physics courses Why do we need computational physics?


ƒ In physics we answer how nature works.
ƒ Quite often we need equations
few analytically (unless you are a poet or a philosopher)
+ = solvable problems
ƒ Using equations we create models to describe
nature
ƒ Exact (analytic) solutions are very rare unless
a model is a very simple one
ƒ We need computational physics when
solutions to very – we cannot solve problems analytically
+ = many problems
– we have too much data to process

Many, if not the most, problems in contemporary


5 physics could never be solved without computers 6

1
Computational physics in contemporary physics Classification of computational models
ƒ Numerical calculations: solutions of well defined
mathematical problems to produce numerical solutions Deterministic or Stochastic models
Examples: systems of differential equations, integration, Ö Deterministic models: Results of deterministic models
systems of linear equations, … depend on initial conditions.
ƒ Visualization and animation: the human eye + the visual Ö Stochastic models: an element of chance exists.
processing power of the brain = very sophisticated tool
traditional presentation: 2D and 3D plots Dynamic or Static models
new presentations: animation, using colors and textures Ö A dynamic models changes in time.
ƒ Computer simulation: testing models of nature Ö A static model does not consider time
Examples: weather forecast, …
ƒ Data collection and analysis in experimental research
Example: LabView
ƒ Symbolic manipulation:
Examples: Maple, Mathematica, … 7 8

Computer Simulation (few examples)


9 Molecular Dynamic Simulation
9 Weather forecast
9 Design of complex systems (aircrafts, …)
9 Financial markets
9 Traffic
9 War games
9 …

9 10

more … Computational Physics


ƒ Many natural phenomena are nonlinear, and a is a multidisciplinary field
small change in a variable might produce a
large effect.
But just few nonlinear problems can be solved Computational Physics
analytically.
ƒ Interest in systems with many variables or
many degrees of freedom

Millennium Simulation - the largest N-body simulation


carried out thus far (more than 1010 particles). project
A 3-dimensional visualization of the Millennium Simulation management
mathematics computers
shows a journey through the simulated universe
http://www.mpa-garching.mpg.de/galform/millennium/ physics
11 12

2
Computers Computers in computational physics

ƒ Hardware
– Amazing progress: two times more
powerful processors in 18 months
(Moore’s law: the number of transistors
per square inch on integrated circuits
doubles every 18 months)
– Do we have twice more results in physics
each 18 months?
ƒ Software

13 14

Basic computer hardware


Hardware (internal)
ƒ CPU - central processing unit (speed in GHz),
cache memory: cache 1, cache 2
ƒ RAM -random-access memory (MB or GB)
communication with CPU by bus (MHz)
ƒ PCI – Peripheral Component Interconnect
ƒ USB – Universal Serial Bus
ƒ HDD – Hard Disk Drive (GB)
ƒ Graphic card
ƒ Network Interface (Mb/sec) (modems 56 Kb/sec)
15 16

Hardware (peripheral) Critical hardware for calculations

ƒ Keyboard (I/O) ƒ Desktops


ƒ Mouse (I/O) – CPU
– RAM
ƒ Printer (I/O)
ƒ Clusters
ƒ Monitor (Graphic card)
– CPU and RAM
ƒ Ethernet (network)
– number of CPUs
ƒ Scanner, external storage, …
– fast network communication between
nodes

17 http://www.top500.org/ 18

3
Software
Software 1: Operating Systems

Operating system – a set of programs to manage

ƒ communication between hardware


(device drivers)
ƒ communication between a user and a computer
ƒ running applications (software)
ƒ file system
ƒ security

19 20

Types of Operating Systems Some of Operating Systems

ƒ multi-user: Allows two or more users to run programs at Alive Dead by now
the same time. Some operating systems permit ƒ Windows ƒ DOS
hundreds or even thousands of concurrent users.
ƒ Linux ƒ IBM OS/2
ƒ multiprocessing: Supports running a program on more
than one CPU. ƒ Mac OS ƒ VMS
ƒ multitasking: Allows more than one program to run ƒ Unix ƒ IBM OS/400
concurrently.
ƒ multithreading: Allows different parts of a single
program to run concurrently.
ƒ real time: Responds to input instantly. General-purpose
operating systems, (Windows, Linux are not real-time).
21 22

What OS is better for computational Software 2: Programming Languages


physics?

The answer depends on a problem


ƒ Desktops – Windows, Linux, Mac OS
ƒ Clusters – Linux
ƒ Supercomputers – Unix, Linux
ƒ Parameters to consider:
– Available hardware, software and
computer codes
– Stability
– Analysis of results and presentation
23 http://www.engin.umd.umich.edu/CIS/course.des/cis400/ 24

4
Most common in physics

Fortran C/C++

The basic ideas behind


computational physics are
language independent
Java

25 26

“The relevance of C++ to scientific computing is somewhat


What language to use? controversial”
“A First Course in Computational Physics and Object Oriented
ƒ choice depends on a problem Programming with C++”, by D. Yevick
– numerical simulation C++ is also one of the most complex programming languages,
with many pitfalls for the unwary.
– system programming “C a reference manual” (5th edition) by S.P. Harbison and G. L.
– web programming Steele Jr.
ƒ available libraries and computer codes Spend your intellectual energies on the current problem - not
on fancy tools. When the volume and sophistication of your
ƒ experience
problems demand these weapons you will know it. That is the
time to learn a new tool - and learn it by re-doing an already-
solved problem, not a new one.
F.S. Acton “Real Computing made real
27 28

Fortran, C/C++, and others Fortran 77, C, C++, Fortran 90


ƒ Fortran – legacy! Very many computer
codes and libraries
ƒ Fortran – easy-to-learn and easy-to-use
ƒ Normally, scientific C++ programs cannot be
effectively optimized as Fortran programs
(C++ codes run slower - from 10% to 10
times)
ƒ Java and C# poses formal advantages 1 – excellent
(however, C++ is rather for industry) 2 – good
3 – fair
ƒ Scientific software – may solve problems 4 – poor
faster 29
http://www.phy.ornl.gov/csep/CSEP/PL/PL.html
30

5
Compilers: C and C++
Languages and Compilers
ƒ Dev-C++ Compiler (open source) a full-featured IDE for the C/C++
The last version was released in 2005 (no activity with the project
For effective and efficient work you need to since that)
a) Select a language that is right for you now and ƒ Code::Blocks IDE (open source) for Windows and Mac
ƒ Open Watcom C/C++ compiler, (open source)
in nearest future.
ƒ Microsoft Visual C++ 2008 Express Edition (free)
You may need to know/learn more than one language.
ƒ Borland C++ Compiler. free and proprietary versions
b) Have a good book (with examples) to learn the ƒ Intel® C++ Compilers for Windows, Linux and Mac OS (License type -
language that you selected proprietary) Non-commercial customers can download free Intel® C++
Compiler for Linux (registration required)
c) Have a compiler that fits you demands ƒ Microsoft Visual C++ 2010 (License type - proprietary)
(and budget) ƒ C++ Builder 2010 C++ (License type - proprietary)
ƒ The Portland Group C and C++ compilers for 32-bit x86 and 64-bit x64
processor-based Linux and Windows workstations, servers and
clusters.
31 32

Compilers: Fortran
ƒ Intel® Visual Fortran Compilers for Windows, Linux and Mac OS Software 3: Problem-solving environment
(License type - proprietary)
ƒ The Portland Group Fortran compilers for Linux and Windows
workstations, servers and clusters. (License type - proprietary) ƒ Maple
ƒ NAGWare f95 Compiler Available on a wide range of Unix and
Windows platforms. (License type - proprietary) ƒ Mathematica
ƒ Absoft Fortran Compiler and associated tools are available for HPC, ƒ MathCad
Linux, Windows and MacOS environments. (License type - proprietary)
ƒ Lahey/Fujitsu Fortran includes full Fortran 95/90/77 and Fortran for ƒ Derive
.NET compilers. (License type - proprietary)
ƒ Silverfrost FTN95 - Fortran for Windows (free for personal and
evaluation use)
ƒ Open 64 – open source for Linux
ƒ Open Watcom Fortran compiler (free): Latest Release (February 2009)
ƒ G95 (free): latest release (March 2009) (Open source)
33 34

comments:
Problem-solving environment
Mathematica is a huge system of remarkable capabilities
cloaked in a stupefying variety of commands. But after six
ƒ Problem-solving environment is good
months of frequent experimentation, I still find that three-
for small and medium projects
quarters of my time goes into trying to discover why I got
ƒ Programming with compiled languages an error message instead of the answer I was.
gives more control, power, flexibility for
F.S. Acton “Real Computing made real”
numerically and logically intensive
tasks

35 36

6
Software 4: Applications Project Management in computational physics

ƒ Graphics The art or skill of directing and organizing the work


ƒ Spreadsheets
ƒ Word processors
ƒ Internet
ƒ …

37 38

You might also like