Computational Physics 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 36

Basics

ofComputationalPhysics
 What is Computational Physics?
 Basic computer hardware
 Software 1: operating systems
 Software 2: Programming languages
 Software 3: Problem-solving environment
What does Computational Physics do?

 Atomic Physics studies atoms


 Nuclear Physics studies nuclei
 Plasma Physics studies plasmas
 Solid State Physics studies solids
 Computational physics does not study
computers

2
What is Computational Physics?

“Computational physics is a synthesis of


theoretical analysis, numerical algorithms, and
computer programming.”
What is Computational Physics?

Computational physics is a tool for


solving complex numerical problems in
physics
Example: university physics courses

few analytically
+ = solvable problems

solutions to very
+ = many problems
Why do we need computational physics?
 In physics we answer how nature works.
 Quite often we need equations
(unless you are a poet or a philosopher)
 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
– we cannot solve problems analytically
– we have too much data to process

Many, if not the most, problems in contemporary


physics could never be solved without 6
computers
Computational physics in contemporary physics
 Numerical calculations: solutions of well defined
mathematical problems to produce numerical solutions
Examples: systems of differential equations, integration,
systems of linear equations.
 Visualization and animation: the human eye + the visual
processing power of the brain = very sophisticated tool
traditional presentation: 2D and 3D plots
New presentations: animation, using colors and textures
 Computer simulation: testing models of nature
Examples: weather forecast.
 Data collection and analysis in experimental research
Example: Lab View
 Symbolic manipulation:
Examples: Maple, Mathematical. 7
Classification of computational models
Deterministic or Stochastic models

Dynamic or Static models


Computer Simulation (few examples)
 Molecular Dynamic Simulation
 Weather forecast
 Design of complex systems (aircrafts)
 Financial markets
 Traffic
 War games

9
Computer simulations for non-linear problems
 Many natural phenomena are nonlinear, and
a small change in a variable might produce
a large effect.
But just few nonlinear problems can be
Solved analytically.
 Interest in systems with many variables or
many degrees of freedom
Computational Physics
is a multidisciplinary field

Computational Physics

s project management
mathematics
physic
computers
Computers
 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

12
Computers in computational physics

13
Basic computer hardware

14
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)
15
Hardware (peripheral)

 Keyboard (I/O)
 Mouse (I/O)
 Printer (I/O)
 Monitor (Graphic card)
 Ethernet (network)
 Scanner, external storage, …
Critical hardware for calculations
 Desktops
– CPU
– RAM
 Clusters
– CPU and RAM
– number of CPUs
– fast network communication between
nodes

17
Software

18
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
Types of Operating Systems

 multi-user: Allows two or more users to run programs at


the same time. Some operating systems permit
hundreds or even thousands of concurrent users.
 multiprocessing: Supports running a program on more
than one CPU.
 multitasking: Allows more than one program to run
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).
Some of Operating Systems
Alive Dead by now
 Windows  DOS
 Linux  IBM OS/2
 Mac OS  VMS
 UNIX  IBM OS/400
What OS is better for computational
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
Software 2: Programming Languages

23
The basic ideas behind
computational physics are
language independent

24
Most common in physics

Fortra C/C++
n

Java
What language to use?

 Choice depends on a problem


– numerical simulation
– system programming
– web programming
 Available libraries and computer codes
 experience
FORTRAN, C/C++, and others
 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
(however, C++ is rather for industry)
 Scientific software – may solve problems
faster. 28
Software 3: Problem-solving environment

 Maple
 Mathematical
 MathCAD
 Derive

31
Problem-solving environment

 Problem-solving environment is good


for small and medium projects
 Programming with compiled languages
gives more control, power, flexibility for
numerically and logically intensive
tasks
Software 4: Applications

 Graphics
 Spreadsheets
 Word processors
 Internet
 …

34

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy