Você está na página 1de 2

PY4109 Computational Physics Assignment 1 Period of a non-linear Oscillator

S. Fahy
University College Cork (Dated: January 2011)

I.

OVERVIEW OF THE PROBLEM

We would like to calculate the period of a 1-dimensional non-linear oscillator as a function of energy. We will assume the particle of mass m = 1. The potential energy is U (x), where x is the position. Newtons 2nd law then gives the equation of motion: d2 x U = . 2 dt x (1)

We know that the energy, E = v 2 /2 + U (x), is conserved, where v = dx/dt is the velocity. Conservation laws are generally very useful in computational physics as they often give powerful ways of checking the consistency of results obtained numerically. In order to nd the period of motion, at least two approaches are possible: (a) given initial values of x and v, solve the dierential equation numerically to nd x(t) and inspect the motion to nd the period; (b) use conservation of energy to nd the velocity, v= 2[E U (x)] (2)

as a function of position x and then integrate 1/v with respect to x between the extrema of the motion to nd half the period: T = 2
x=xmax xmax

dt =
x=xmin xmin

dx v(x)

xmax

=
xmin

dx 2[E U (x)]

(3)

We will follow the second alternative. (Ideally, if time allowed we would do both and compare the results obtained from each.)
II. FINDING THE EXTREMA OF MOTION

In order to evaluate the integral in Eq. 3, we need to know xmin and xmax for any given value of E. These points satisfy the equation, U (x) = E. So our rst task is to nd the roots of this equation. No matter what root-nding method is used, it is a good idea to plot the function U (x) and examine its behaviour for a range of values of x. Having a clear picture of the functions involved often helps in identifying the source of the diculty when problems with a numerical method arise. One possibility is to use Newtons method for nding roots: starting at a point x1 , you generate a sequence of (hopefully) sequentially improving estimates xi , i = 2, 3, . . . of the root, satisfying the equation: xi+1 = xi + E U (xi ) , U (xi ) (4)

where U is the derivative of U (x) with respect to x. This method can be very fast in converging to an accurate root of the equation U (x) = E when you already have a reasonable estimate of the root. However, it is prone to unstable behaviour, sometimes diverging away from the desired root instead of towards it. We will not pursue it further here. A more stable (though more slowly convergent) method is the bisection method. We will not develop a completely general method, but will assume that we have certain information about the function U (x). In particular, we will assume that we know where the minimum of U (x) lies. (In the rst problem, U (x) = x3 + exp[x2 ] 1, which has a minimum at x = 0.) We will also assume that the function U (x) diverges to + as x . Having chosen an initial search step length s > 0, we start from the point x0 , where U is a minimum, and evaluate U at points xn = x0 js, j = 1, 2, . . . , for which U (xj ) < E until we nd the rst point for which U (xn ) > E. Clearly the root of U (x) = E then lies between A = xn1 and B = xn . We now bisect this interval, and evaluate U (x) at the

2 mid-point, x = (A + B)/2. If U (x) > E, then the root lies between A and x. In this case we set B = x. Otherwise we set A = x. In either case, the root lies between the new values of A and B. To nd the root more accurately, we repeat the bisection in the same manner and nd which of the two segments contains the root. Continuing in this fashion, we can nd the value of the root xmin to arbitrary accuracy. When the dierence B A is suciently small, the iterations are terminated. The upper root xmax can be found in a similar fashion. (Note that the search step length s should be chosen to be small enough that we do not miss local maxima between x0 + js and x0 + (j + 1)s, where U (x) > E, even though the end points have U (x) < E.)
III. CALCULATING THE INTEGRAL

The required integral in Eq. 3 can be evaluated by dividing the entire range of motion into N segments of equal length and evaluating the integrand, fi = f (xi ) = [2(E U (xi ))]1/2 , at their mid-points, xi = xmin + 2i 1 2N [xmax xmin ]. (5)

We then approximate the integral with the weighted sum of the values Ui :
xmax xmin

dx 2[E U (x)]

i=1

fi x,

(6)

where x = [xmax xmin ]/N is the spacing between points xi . If you examine the convergence of this approximation with respect to x 0, you will nd that it converges rather poorly. (Exercise 2 asks you to examine and characterize this convergence in detail.) If you consider (or plot) the integrand f (x), you will see that it diverges at the end points, xmax and xmin , where the velocity v 0. It is fairly easy to see that this is where the poor convergence of the mid-point rule integration method arises. Let us see if we can develop a special approach to the integration, which will handle this divergence smoothly. We note that the function g(x) = 2[E U (x)] is smooth and well-behaved near the end points. (It just happens to pass through zero there.) A linear approximation to that function in any of the short integration segments [xi , xi+1 ] will be good, even near the classical turning points. We also have that f = g 1/2 . So let us transform the integral on each integration segment,
x+x x

dx 2[E U (x)]

x+x

x+x

=
x

f (x)dx =
x

dg dx

dg

x g

x+x x

x dg 2[ = g g

g(x + x)

g(x)], (7)

where g = g(x + x) g(x). The nal expression can be simplied to:


x+x x

dx 2[E U (x)]

2x g(x + x) + g(x)

(8)

Thus, if we now dene the points xi = xmin + ix, we can write the entire integral as
xmax xmin

dx 2[E U (x)]

N 1

i=0

2x g(xi+1 ) + g(xi )

(9)

You are asked in Exercise 2 to examine the convergence of this approach. The exercises ask you to investigate the period of the oscillator, with potential energy function U (x) = x3 +exp[x2 ] 1, which has its minimum value at x = 0. You are asked to discuss the numerical results with reference to limits where you know the period approximately from simple analytical results. For very small energies (and very small x), this potential energy function can be approximated by a parabola, U (x) kx2 /2. Find the value of k. Therefore the oscillator will have a period T = 2/ k equal to that of a simple harmonic oscillator of mass 1 and spring constant k when the amplitude of motion is very small. For larger energies, E, we note that the potential diverges very rapidly when |x| > 1 (a hard wall ). If you approximate the potential U = 0 for |x| < 1 and U = for |x| > 1, then the energy is entirely kinetic, so that the speed is |v| 2E as the particle bounces back and forth between the walls at x = 1. This gives a period T 2/|v| = 2/E.

Você também pode gostar