SlideShare a Scribd company logo
Computational Physics
By Saadia Shaukat
Computational Physics
 Computational physics is the study and implementation of numerical
analysis to solve problems in physics for which a quantitative theory
already exists.
 It is sometimes regarded as a subdiscipline of theoretical physics.
 On the other hand, consider it is considered an intermediate branch
between theoretical and experimental physics - an area of study which
supplements both theory and experiment.
Computational Physics
A representation of the multidisciplinary nature of computational
physics both as an overlap of physics, applied mathematics, and
computer science and as a bridge among them
Overview
 In physics, different theories based on mathematical
models provide very precise predictions on how systems
behave.
 Limits of mathematical models
 When the solution does not have a closed-form
expression.
 When the solution is too complicated.
 In such cases, numerical approximations are required.
How Computational Physics
works
 The solution is approximated by the following steps:
1. Write the problem as a finite number of simple
mathematical operations (algorithm).
2. Use Computer to perform these operations and compute
an approximated solution and respective error.
Challenges
 Computational physics problems are in general very difficult to solve exactly.
 This is due to several (mathematical) reasons:
1. lack of algebraic and/or analytic solubility
2. Complexity
3. Chaos
 In addition, the computational cost and computational complexity for many-
body problems tend to grow quickly.
 Finally, many physical systems are inherently nonlinear at best, and at worst
chaotic: this means it can be difficult to ensure any numerical errors do not
grow to the point of rendering the 'solution' useless.
Computational Science
 The focus of computational science is how to
use the computer to solve scientific problems.
 computational scientist aims to develop stable,
portable and self-consistent algorithms, all
within the context of the problem being
solved.
 Computational physics is the application of
computational science to physics problems.
Computational Physics
 More specifically Computational physics is the study and
implementation of numerical algorithms to solve problems in physics by
means of computers.
 Computational physics in particular solves equations numerically.
 Finding a solution numerically is useful, as there are very few systems
for which an analytical solution is known.
 Another field of computational physics is the simulation of many-
body/particle systems; in this area, a virtual reality is created which is
sometimes also referred to as the 3rd branch of physics (between
experiments and theory).
Computational Physics (cont)
 The evaluation and visualization of large data sets,
which can come from numerical simulations or
experimental data (for example maps in geophysics)
is also part of computational physics.
 Another area in which computers are used in physics
is the control of experiments.
Importance of computational
Physics
 Computational physics plays an important role in the following
fields:
 Computational Fluid Dynamics (CFD): solve and analyze problems
that
Involved in fluid flows
 Solid State Physics (Quantum Mechanics)
 High Energy Physics / Particle Physics: in particular Lattice
Quantum
 Chromodynamics (Lattice QCD)
 Astrophysics: many-body simulations of stars, galaxies etc.
 Geophysics and Solid Mechanics: earthquake simulations, fracture,
rupture, crack propagation etc.
 Agent Models (interdisciplinary): complex networks in biology,
economy,social sciences and many others
Computing Platforms
 Computational physicists need to be able to work on a variety
of different computing platforms. Platforms can be categorized
in two ways: by the type of CPU installed, and by the operating
system used. These two are interconnected, but since there
are a large number of different CPUs, it is easier to look at
operating systems. There are three main operating systems
used in the world today:
 Unix based,
 Mac-OS based,
 and MS Windows based.
Each has its own strengths and weaknesses.
Programming Languages
 Just as there are a number of different computing
platforms, there are also a wide variety of programming
languages available.
 The languages are typically classified according to the
advances that they incorporate, with each major
advance represented as a new generation.
First Generation Language
 The first generation language is machine code, with the program
written as a string of numbers that the computer interpreted as
instructions.
 This was the most difficult way to program a computer, but is the
closest to how the computer actually works.
 In fact, all later generation languages are translated into machine
code before the CPU processes them.
Second generation languages
 Second generation languages are considered to be
various assembler languages. Since they use English
acronyms, these languages are easier to understand
than straight machine code, but they are still arcane
compared to later generation languages.
Third generation languages-
High Level Languages
 Third generation languages are also known as “high
level” languages. A compiler takes the statements of a
particular third generation language and converts it into
machine code.
Fourth generation languages
 Fourth generation languages are similar to third generation
languages in that they rely on a compiler or interpreter, but
they are usually written in a language which has structure and
flow similar to spoken languages.
 In general, most computational physicists need expertise in
third, or later, generation languages.
 The main exception to this is if they are working on software that
must run in an embedded system or in a real time operating
system, and the speed of the code is paramount(supreme).
 In this case, the ability to trim any excess commands out of the
code stream becomes important, and assembly languages are the
best choice.
 Of the high level languages, the one that are most
commonly found in physics are
 Fortran,
 C/C++,
 MatLab,
 Mathematica,
 Maple, and
 PAW(Physics analysis work station).
Fortran
 Fortran is the oldest of the scientific computing languages.
Originally designed in 1954, it went through various
modifications.
 Fortran II was released in 1958.
 Fortran III was a short-lived release,
 Fortran IV, which was released in 1962, became the mainstay of
scientific computing.
 A large number of scientific programs and libraries were written
in Fortran IV. (Fortran 77) was released in 1977, these programs
and libraries were quickly updated and augmented.
What made Fortran so widely
accepted in the scientific
community?
 The language had a number of built in data types that
eased scientific computing, including real, double and
complex.
 It also had a wide variety of controlling and branching
structures.
 These two facts enabled large programs to be created
which had the ability to track variables associated with
experimental measurements.
 Fortran 77 remained the standard scientific language for more
than ten years.
 During this time computer science made a number of
significant advances, prime among them the invention of
pointers that allow indirect access to data.
 Various vendors released patches to Fortran 77 that allowed it
to also do this, but it wasn’t until the release of Fortran 90
that Fortran gained many of these tools.
C/C++
 C is a more recent entry into the field of scientific
programming. It was released in 1971 and was designed
to provide a computing development tool. Its strengths
include the facts that
 It has high level constructs,
 It can handle low-level activities, and
 It produces efficient programs
 From a scientific standpoint, the loose typing that C provided
quickly enabled all of the strengths of Fortran to be copied
and expanded upon.
 The rise of Unix workstations, whose kernel is written in C,
also aided in the acceptance of C in the scientific community.
 In addition, the use of header files and longer variable names
made documentation of code libraries easier.
 As computer science paradigms advanced, the idea of object-
oriented programming was developed.
 Object-oriented programming (OOP) uses a different approach
to problem solving than the method used in older languages
such as Fortran and C.
 These earlier languages use a method known as a “procedural
approach”.
 A problem is broken into smaller problems, and this process is
repeated until the subtasks can be coded.
 Thus a library of functions is created, communicating through
arguments and variables
PAW, Mathematica and Maple
 IDL, PAW, Mathematica, and Maple are all examples of
fourth generation languages.
 Unlike the third generation languages discussed above,
these are interpreted languages.
 Interpreted languages are ones in which the code is
passed directly to a parser, which converts it to machine
code and executes it immediately.
 Interpreted languages do not usually produce a stand-
alone executable, and are typically slower than their
compiled counterparts.
➢ IDL, which stands for Interactive Data Language, and
PAW, which stands for Physics Analysis Workbench, are
data analysis and graphics packages.
➢ They can read ASCII or binary data files, do a wide
range of sophisticated mathematical operations on the
data, and then present the results in either a textual or
graphical output.
➢ Both packages are widely used as post processing
software in experimental support.
 In contrast, Mathematica and Maple are symbolic computation
programs.
➢ While they can both carry out the same duties as IDL and PAW,
their greatest strength lies in their ability to perform
mathematical calculations using formulae similar to those that
would be used in an analytical approach.
➢ For example, a user could input a set of linked equations and ask
the program to solve them for a specific variable. The result will
be presented (if possible) as an analytical formula rather than as
a number.
➢ The fact that all of these packages are fourth generation
languages makestheir use much more intuitive than standard
“programming” languages.
➢ Users do not necessarily need to know arcane calls or coding
techniques to achieve their goals.
Solving Equations
 One-Dimensional Case
 The problem of finding a root of an equation can be
written as
F(x)=0
Bisection Method
Compoutational Physics
Algorithm of Bisection
Method
Matlab Implementation
 function p=bisec(a,b,TOL,N0,f)
 %syms x
 i=1;
 %f=x^2-6*x+8;
 FA=subs(f,a);
 found=0;
 while i<=N0
 p=a+(b-a)/2;
 FP=subs(f,p);
 if FP==0 | (b-a)/2 <TOL

 break;
 end
 i=i+1;
 if FP*FA >0
 a=p;
 FA=FP;
 else
 b=p;
 end
 end
Compoutational Physics
Compoutational Physics
Example
Compoutational Physics

More Related Content

PPTX
Computational physics
PPT
Chapter 2 - Computer Networking a top-down Approach 7th
PPT
INTRODUCTION-TO-RESEARCH-METHODOLOGY-2020.ppt
PPT
High level and Low level Language
PPTX
Ceramic materials
PDF
Molecular Orbital Theory
PPTX
Radiation detectors
PPT
Computational physics
Chapter 2 - Computer Networking a top-down Approach 7th
INTRODUCTION-TO-RESEARCH-METHODOLOGY-2020.ppt
High level and Low level Language
Ceramic materials
Molecular Orbital Theory
Radiation detectors

What's hot (20)

PPT
Modern Physics
PPTX
Ph 101-8
PPTX
quantum view of Harmonic oscillator
PPTX
Tensor analysis
PPTX
Application of Differential Equation in Real Life
PPT
5 introduction to quantum mechanics
PDF
Cubic Spline Interpolation
PPT
Physics Presentation
PPTX
Fermi dirac distribution
PPTX
Maxwell's equation
PPTX
josphenson junction
PPT
numerical methods
PPT
Statistical mechanics
PDF
Resources for Teaching Undergraduate Computational Physics
PPTX
Galilean Transformation Equations
PPTX
Davisson germer experiment
PPTX
Measurement and uncertainty
PPT
LORENTZ TRANSFORMATION Pooja chouhan
PPTX
Coordinate systems
Modern Physics
Ph 101-8
quantum view of Harmonic oscillator
Tensor analysis
Application of Differential Equation in Real Life
5 introduction to quantum mechanics
Cubic Spline Interpolation
Physics Presentation
Fermi dirac distribution
Maxwell's equation
josphenson junction
numerical methods
Statistical mechanics
Resources for Teaching Undergraduate Computational Physics
Galilean Transformation Equations
Davisson germer experiment
Measurement and uncertainty
LORENTZ TRANSFORMATION Pooja chouhan
Coordinate systems
Ad

Similar to Compoutational Physics (20)

PDF
6272 cnote
PDF
C progrmming
PPT
Chapter01
PPT
Chracteristcs of Computer sciences and technology .ppt
PPT
A Balanced Introduction to Computer Science
PPT
Chap1 sfsf sdfsf sfdsdf sffsd fdsdfds dsfsdf
PPT
A balanced introduction to computer science.ppt
PPT
Introduction to computers to be balanced.ppt
PPT
Chap10.ppt
PPT
Computer science introduction hardware and software.ppt
PPT
Chap10.ppt Chemistry applications in computer science
DOCX
Unit ii oo design 9
PDF
Introduction to Modern Fortran for the Earth System Sciences.pdf
PDF
A Man-Computer Interactive System
PDF
The Design and Analysis of Computer Algorithms [Aho, Hopcroft & Ullman 1974-0...
PPTX
"Hints" talk at Walchand College Sangli, March 2017
PDF
Software Engineering
PDF
Reduce course notes class xi
PPTX
Chapter 1.pptx
6272 cnote
C progrmming
Chapter01
Chracteristcs of Computer sciences and technology .ppt
A Balanced Introduction to Computer Science
Chap1 sfsf sdfsf sfdsdf sffsd fdsdfds dsfsdf
A balanced introduction to computer science.ppt
Introduction to computers to be balanced.ppt
Chap10.ppt
Computer science introduction hardware and software.ppt
Chap10.ppt Chemistry applications in computer science
Unit ii oo design 9
Introduction to Modern Fortran for the Earth System Sciences.pdf
A Man-Computer Interactive System
The Design and Analysis of Computer Algorithms [Aho, Hopcroft & Ullman 1974-0...
"Hints" talk at Walchand College Sangli, March 2017
Software Engineering
Reduce course notes class xi
Chapter 1.pptx
Ad

Recently uploaded (20)

DOCX
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx
PDF
The Land of Punt — A research by Dhani Irwanto
PPTX
BODY FLUIDS AND CIRCULATION class 11 .pptx
PPTX
Biomechanics of the Hip - Basic Science.pptx
PPT
1. INTRODUCTION TO EPIDEMIOLOGY.pptx for community medicine
PPTX
Science Quipper for lesson in grade 8 Matatag Curriculum
PDF
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
PDF
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
PPTX
BIOMOLECULES PPT........................
PPTX
Microbes in human welfare class 12 .pptx
PDF
Assessment of environmental effects of quarrying in Kitengela subcountyof Kaj...
PPTX
Seminar Hypertension and Kidney diseases.pptx
PDF
Phytochemical Investigation of Miliusa longipes.pdf
PDF
lecture 2026 of Sjogren's syndrome l .pdf
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PPTX
Introduction to Cardiovascular system_structure and functions-1
PDF
BET Eukaryotic signal Transduction BET Eukaryotic signal Transduction.pdf
PDF
Lymphatic System MCQs & Practice Quiz – Functions, Organs, Nodes, Ducts
PDF
An interstellar mission to test astrophysical black holes
PPTX
Application of enzymes in medicine (2).pptx
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx
The Land of Punt — A research by Dhani Irwanto
BODY FLUIDS AND CIRCULATION class 11 .pptx
Biomechanics of the Hip - Basic Science.pptx
1. INTRODUCTION TO EPIDEMIOLOGY.pptx for community medicine
Science Quipper for lesson in grade 8 Matatag Curriculum
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
BIOMOLECULES PPT........................
Microbes in human welfare class 12 .pptx
Assessment of environmental effects of quarrying in Kitengela subcountyof Kaj...
Seminar Hypertension and Kidney diseases.pptx
Phytochemical Investigation of Miliusa longipes.pdf
lecture 2026 of Sjogren's syndrome l .pdf
7. General Toxicologyfor clinical phrmacy.pptx
Introduction to Cardiovascular system_structure and functions-1
BET Eukaryotic signal Transduction BET Eukaryotic signal Transduction.pdf
Lymphatic System MCQs & Practice Quiz – Functions, Organs, Nodes, Ducts
An interstellar mission to test astrophysical black holes
Application of enzymes in medicine (2).pptx

Compoutational Physics

  • 2. Computational Physics  Computational physics is the study and implementation of numerical analysis to solve problems in physics for which a quantitative theory already exists.  It is sometimes regarded as a subdiscipline of theoretical physics.  On the other hand, consider it is considered an intermediate branch between theoretical and experimental physics - an area of study which supplements both theory and experiment.
  • 3. Computational Physics A representation of the multidisciplinary nature of computational physics both as an overlap of physics, applied mathematics, and computer science and as a bridge among them
  • 4. Overview  In physics, different theories based on mathematical models provide very precise predictions on how systems behave.  Limits of mathematical models  When the solution does not have a closed-form expression.  When the solution is too complicated.  In such cases, numerical approximations are required.
  • 5. How Computational Physics works  The solution is approximated by the following steps: 1. Write the problem as a finite number of simple mathematical operations (algorithm). 2. Use Computer to perform these operations and compute an approximated solution and respective error.
  • 6. Challenges  Computational physics problems are in general very difficult to solve exactly.  This is due to several (mathematical) reasons: 1. lack of algebraic and/or analytic solubility 2. Complexity 3. Chaos  In addition, the computational cost and computational complexity for many- body problems tend to grow quickly.  Finally, many physical systems are inherently nonlinear at best, and at worst chaotic: this means it can be difficult to ensure any numerical errors do not grow to the point of rendering the 'solution' useless.
  • 7. Computational Science  The focus of computational science is how to use the computer to solve scientific problems.  computational scientist aims to develop stable, portable and self-consistent algorithms, all within the context of the problem being solved.  Computational physics is the application of computational science to physics problems.
  • 8. Computational Physics  More specifically Computational physics is the study and implementation of numerical algorithms to solve problems in physics by means of computers.  Computational physics in particular solves equations numerically.  Finding a solution numerically is useful, as there are very few systems for which an analytical solution is known.  Another field of computational physics is the simulation of many- body/particle systems; in this area, a virtual reality is created which is sometimes also referred to as the 3rd branch of physics (between experiments and theory).
  • 9. Computational Physics (cont)  The evaluation and visualization of large data sets, which can come from numerical simulations or experimental data (for example maps in geophysics) is also part of computational physics.  Another area in which computers are used in physics is the control of experiments.
  • 10. Importance of computational Physics  Computational physics plays an important role in the following fields:  Computational Fluid Dynamics (CFD): solve and analyze problems that Involved in fluid flows  Solid State Physics (Quantum Mechanics)  High Energy Physics / Particle Physics: in particular Lattice Quantum  Chromodynamics (Lattice QCD)  Astrophysics: many-body simulations of stars, galaxies etc.  Geophysics and Solid Mechanics: earthquake simulations, fracture, rupture, crack propagation etc.  Agent Models (interdisciplinary): complex networks in biology, economy,social sciences and many others
  • 11. Computing Platforms  Computational physicists need to be able to work on a variety of different computing platforms. Platforms can be categorized in two ways: by the type of CPU installed, and by the operating system used. These two are interconnected, but since there are a large number of different CPUs, it is easier to look at operating systems. There are three main operating systems used in the world today:  Unix based,  Mac-OS based,  and MS Windows based. Each has its own strengths and weaknesses.
  • 12. Programming Languages  Just as there are a number of different computing platforms, there are also a wide variety of programming languages available.  The languages are typically classified according to the advances that they incorporate, with each major advance represented as a new generation.
  • 13. First Generation Language  The first generation language is machine code, with the program written as a string of numbers that the computer interpreted as instructions.  This was the most difficult way to program a computer, but is the closest to how the computer actually works.  In fact, all later generation languages are translated into machine code before the CPU processes them.
  • 14. Second generation languages  Second generation languages are considered to be various assembler languages. Since they use English acronyms, these languages are easier to understand than straight machine code, but they are still arcane compared to later generation languages.
  • 15. Third generation languages- High Level Languages  Third generation languages are also known as “high level” languages. A compiler takes the statements of a particular third generation language and converts it into machine code.
  • 16. Fourth generation languages  Fourth generation languages are similar to third generation languages in that they rely on a compiler or interpreter, but they are usually written in a language which has structure and flow similar to spoken languages.  In general, most computational physicists need expertise in third, or later, generation languages.
  • 17.  The main exception to this is if they are working on software that must run in an embedded system or in a real time operating system, and the speed of the code is paramount(supreme).  In this case, the ability to trim any excess commands out of the code stream becomes important, and assembly languages are the best choice.
  • 18.  Of the high level languages, the one that are most commonly found in physics are  Fortran,  C/C++,  MatLab,  Mathematica,  Maple, and  PAW(Physics analysis work station).
  • 19. Fortran  Fortran is the oldest of the scientific computing languages. Originally designed in 1954, it went through various modifications.  Fortran II was released in 1958.  Fortran III was a short-lived release,  Fortran IV, which was released in 1962, became the mainstay of scientific computing.  A large number of scientific programs and libraries were written in Fortran IV. (Fortran 77) was released in 1977, these programs and libraries were quickly updated and augmented.
  • 20. What made Fortran so widely accepted in the scientific community?  The language had a number of built in data types that eased scientific computing, including real, double and complex.  It also had a wide variety of controlling and branching structures.  These two facts enabled large programs to be created which had the ability to track variables associated with experimental measurements.
  • 21.  Fortran 77 remained the standard scientific language for more than ten years.  During this time computer science made a number of significant advances, prime among them the invention of pointers that allow indirect access to data.  Various vendors released patches to Fortran 77 that allowed it to also do this, but it wasn’t until the release of Fortran 90 that Fortran gained many of these tools.
  • 22. C/C++  C is a more recent entry into the field of scientific programming. It was released in 1971 and was designed to provide a computing development tool. Its strengths include the facts that  It has high level constructs,  It can handle low-level activities, and  It produces efficient programs
  • 23.  From a scientific standpoint, the loose typing that C provided quickly enabled all of the strengths of Fortran to be copied and expanded upon.  The rise of Unix workstations, whose kernel is written in C, also aided in the acceptance of C in the scientific community.  In addition, the use of header files and longer variable names made documentation of code libraries easier.
  • 24.  As computer science paradigms advanced, the idea of object- oriented programming was developed.  Object-oriented programming (OOP) uses a different approach to problem solving than the method used in older languages such as Fortran and C.  These earlier languages use a method known as a “procedural approach”.  A problem is broken into smaller problems, and this process is repeated until the subtasks can be coded.  Thus a library of functions is created, communicating through arguments and variables
  • 25. PAW, Mathematica and Maple  IDL, PAW, Mathematica, and Maple are all examples of fourth generation languages.  Unlike the third generation languages discussed above, these are interpreted languages.  Interpreted languages are ones in which the code is passed directly to a parser, which converts it to machine code and executes it immediately.  Interpreted languages do not usually produce a stand- alone executable, and are typically slower than their compiled counterparts.
  • 26. ➢ IDL, which stands for Interactive Data Language, and PAW, which stands for Physics Analysis Workbench, are data analysis and graphics packages. ➢ They can read ASCII or binary data files, do a wide range of sophisticated mathematical operations on the data, and then present the results in either a textual or graphical output. ➢ Both packages are widely used as post processing software in experimental support.
  • 27.  In contrast, Mathematica and Maple are symbolic computation programs. ➢ While they can both carry out the same duties as IDL and PAW, their greatest strength lies in their ability to perform mathematical calculations using formulae similar to those that would be used in an analytical approach. ➢ For example, a user could input a set of linked equations and ask the program to solve them for a specific variable. The result will be presented (if possible) as an analytical formula rather than as a number. ➢ The fact that all of these packages are fourth generation languages makestheir use much more intuitive than standard “programming” languages. ➢ Users do not necessarily need to know arcane calls or coding techniques to achieve their goals.
  • 28. Solving Equations  One-Dimensional Case  The problem of finding a root of an equation can be written as F(x)=0 Bisection Method
  • 31. Matlab Implementation  function p=bisec(a,b,TOL,N0,f)  %syms x  i=1;  %f=x^2-6*x+8;  FA=subs(f,a);  found=0;  while i<=N0  p=a+(b-a)/2;  FP=subs(f,p);  if FP==0 | (b-a)/2 <TOL 
  • 32.  break;  end  i=i+1;  if FP*FA >0  a=p;  FA=FP;  else  b=p;  end  end