8
Computational Physics Introduction 3/30/11

Computational Physics Introduction 3/30/11. Goals Calculate solutions to physics problems All physics problems can be formulated mathematically

Embed Size (px)

Citation preview

Page 1: Computational Physics Introduction 3/30/11. Goals  Calculate solutions to physics problems  All physics problems can be formulated mathematically

Computational Physics

Introduction3/30/11

Page 2: Computational Physics Introduction 3/30/11. Goals  Calculate solutions to physics problems  All physics problems can be formulated mathematically

Goals

Calculate solutions to physics problemsAll physics problems can be formulated

mathematically.Many strategies for solving equations.

Display solutions in a way that helps us interpret the physics

Page 3: Computational Physics Introduction 3/30/11. Goals  Calculate solutions to physics problems  All physics problems can be formulated mathematically

Division of Labor

Most of the work in solving a problem is still done in the physicist’s head Derive the equations that represent the system of

interest Understand all the approximations and limitations

(conditions for validity) Determine how to instruct the computer to solve the

equations The computer does what it is told to do. The physicist has to interpret the computer’s

output Computational solutions are theoretical

predictions (based on the equations). They must eventually be compared to measurements.

Page 4: Computational Physics Introduction 3/30/11. Goals  Calculate solutions to physics problems  All physics problems can be formulated mathematically

equationsMany types of equations:

Algebraic

Trigonometric, logorithmic

Differential, integral

Linear, nonlinear

You may have a set of equations that must be solved simultaneouslyMatrix manipulations, linear algebra

Your equations may depend on initial conditions or boundary conditions

y = 5x + 2x 2

y

tanωL

2c= tanh

ωL

2c

∂2y

∂t 2= −Ek 2

ρ

∂ 4y

∂x 4

Page 5: Computational Physics Introduction 3/30/11. Goals  Calculate solutions to physics problems  All physics problems can be formulated mathematically

Solving equations Some special equations have an analytical,

or “closed-form,” solution, which is a certain known function or combination of functions.

Most equations (or sets of equations) must be solved numerically, using a computer. The resulting solution is approximate, and consists only of a set of numbers

d2p

dt 2+ω2p = 0 → p(t) = Asin(ωt + φ)

Page 6: Computational Physics Introduction 3/30/11. Goals  Calculate solutions to physics problems  All physics problems can be formulated mathematically

Visualizing results

In most cases, you will want to make a plot of the solution, in order to visualize how certain quantities depend on others.

This is something that a computer is especially good at.

Page 7: Computational Physics Introduction 3/30/11. Goals  Calculate solutions to physics problems  All physics problems can be formulated mathematically

Strategies

Programs such as Mathematica and MATLAB can help you work with equations analyticallySymbolic manipulationMight help you obtain analytical solution

Most physics problems (that are not highly simplified) involve equations that must be solved numerically.Smooth funtions must be discretizedDerivatives become differencesIntegrals become sumsErrors of approximation must be carefully

tracked

Page 8: Computational Physics Introduction 3/30/11. Goals  Calculate solutions to physics problems  All physics problems can be formulated mathematically

Numerical solutions

Can be done with Mathematica or MATLABActual solving strategies are built inNeed to understand limitations

Can use a scientific programming language such as FORTAN or CMany basic strategies have already been

writtenUse library of routines - customize to your

problemSolution must be plotted to be useful

Special graphics programs are availableMathematica & MATLAB do this well, too