Scientific advances create the need to become computationally adept to tackling problems of increasing complexity. The use of computers in attaining solutions to many of sciences difficult problems is inevitable. Therefore, educators face the challenge to infuse the undergraduate curriculum with computational approaches that will enhance students abilities and prepare them to meet the worlds newer generation of problems. Computational physics courses are becoming part of the undergraduate physics landscape and learned skills need to be honed and practiced. A reasonable ground to do so is the standard traditional upper level physics courses. I have thus developed a classical mechanics textbook1 that employs computational techniques. The idea is to make use of numerical approaches to enhance understanding and, in several cases, allow the exploration and incorporation of the what if environment that is possible through computer algorithms. The textbook uses Matlab because of its simplicity, popularity, and the swiftness with which students become proficient in it. The example code, in the form of Matlab scripts, is provided not to detract students from learning the underlying physics. Students are expected to be able to modify the code as needed. Efforts are under way to build OSP2 Java programs that will perform the same tasks as the scripts. Selected examples that employ computational methods will be presented. 1 To be published, Jones and Bartlett Publishers. 2 Open Source Physics: http://www.opensourcephysics.org/.
Table of Contents
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Review of Newton's Laws Eulers method (computation) Application of Newton's 2nd Law of Motion in One Dimension Harmonic Motion in One Dimension Examples of Harmonic Motion Interacting Spring-Mass System (Computation) Vectors and Differential Calculus Motion Beyond One Dimension Charged particle in 3d under both E\&M fields (computation) Systems of Coordinates Foucault pendulum (computation) Central Forces Gravitation Binary System (simulation) Rutherford Scattering Rutherford Scattering (simulation) Systems of Particles Motion of Rigid Bodies Symmetric Top (simulation) Lagrangian Dynamics Double Pendulum (simulation) Principle of Least Action (simulation)
Chapter 1 Highlights Why we need computational physics? We can go beyond solvable problems. We can get more insight. We can explore situations beyond classroom examples. Start with the iterative Euler method.
Chapter 1 Highlights Why we need computational physics? We can go beyond solvable problems. We can get more insight. We can explore situations beyond classroom examples. If we know the acceleration of an object,
dv = a dt
v(t ) = v0 + at
dx = v(t )dt
Fs = k x(t )
x(t ) = x0 + v0 t +
1 2 at 2
However, if the acceleration is not constant, say a mass at the end of a spring,
d 2 x dv a(t ) = k x(t ) / m = 2 = dt dt
The analytic solution is done in a later chapter. Lets look at a numerical solution. MATLAB code is provided. Students are encouraged to run it and explore it. The Euler Method to solve a 2nd order DE: convert it to two 2nd order DEs
dx = v(t , x) dt
and
dv = a (t , v) dt
So that we do,
vi +1 = vi + ai t ,
ti +1 = ti + t ,
xi +1 = xi + vi +1 t ai = k xi m .
to be solved on [t0 , t f ]
with
For N steps
t = ( t f t0 ) N
x0 , v0
on time interval
[0,1s ]
N = 10
so that
t = 0.1
vi +1 = vi + ai t xi +1 = xi + vi +1 t ai = 200 xi m
0.0 -2.0 0.0 2.0 0.0 -2.0 0.0 2.0 0.0 -2.0 0.0 0.1 -0.1 -0.1 0.1 0.1 -0.1 -0.1 0.1 0.1 -0.1 -0.1 -20 20 20 -20 -20 20 20 -20 -20 20 20
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
We also need to be able to visualize analytical solutions so use small MATLAB scripts provided or modify available ones Harmonic Motion example: Interacting Spring-Mass System (Computation)
Interaction massspring system a)with walls, and b) without walls
d 2 x1 m1 2 = k1 x1 k0 ( x1 x2 ) dt
Case 1: No Walls - Single Mode
and
d 2 x2 m2 = k2 x2 k0 ( x2 x1 ) 2 dt
The analytic solution is:
k1 = k2 = 0
x1 (t ) = xcm (t ) xcm 0
m2 xr (t ) m1 + m2
x2 (t ) = xcm (t ) xcm 0
m1 + xr (t ) m1 + m2
xr = A sin t + B cos t ,
A = vr 0 = v20 v10 ,
vcm =
B = xr 0 = x20 x10
xcm (t ) xcm 0
m x + m2 x2 = 1 1 = vcm t m1 + m2
inter_spr1.html
The coupled massspring system without walls with a single mode of vibrations
m1 = m2 = m,
x1 x x2
k1 = k2 = k k0
m 0 m 0 m
m x = k x k0 M x
k 0 k k 0 1 1 M 1 1
x1 (t ) = x10 cos t cos m t + x20 sin t sin m t x2 (t ) = x10 sin t sin m t + x20 cos t cos m t
Average = ( + ) / 2 1 2 frequency Modulation m = (2 1 ) / 2 frequency inter_spr2.html
Three Dimensional Motion of a charged Particle in an Electromagnetic Field (Computation) - This follows the two dimensional analytic solutions of the charge in Electric, magnetic, and joint E& B fields We have or
d2y = q (vz Bx vx Bz + E y ) / m, dt 2 d 2z = q(vx By v y Bx + Ez ) / m dt 2