non linear oscillator

Upload: mauricio-morales

Post on 06-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Non Linear Oscillator

    1/2

    PY4109 Computational Physics

    Assignment 1 Period of a non-linear Oscillator

    S. FahyUniversity 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 willassume the particle of mass m = 1. The potential energy is U(x), where x is the position. Newtons 2nd law thengives the equation of motion:

    d2x

    dt2= U

    x. (1)

    We know that the energy, E = v2/2 + U(x), is conserved, where v = dx/dt is the velocity. Conservation laws aregenerally very useful in computational physics as they often give powerful ways of checking the consistency of resultsobtained numerically.

    In order to find the period of motion, at least two approaches are possible: (a) given initial values of x and v, solve

    the differential equation numerically to find x(t) and inspect the motion to find the period; (b) use conservation ofenergy to find 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 find halfthe period:

    T

    2=

    x=xmaxx=xmin

    dt =

    xmaxxmin

    dx

    v(x)=

    xmaxxmin

    dx2[E U(x)] . (3)

    We will follow the second alternative. (Ideally, if time allowed we would do both and compare the results obtainedfrom each.)

    II. FINDING THE EXTREMA OF MOTION

    In order to evaluate the integral in Eq. 3, we need to know xmin and xmaxfor any given value of E. These pointssatisfy the equation, U(x) = E. So our first task is to find the roots of this equation. No matter what root-findingmethod 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 difficulty when problemswith a numerical method arise.

    One possibility is to use Newtons method for finding 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 rootof the equation U(x) = E when you already have a reasonable estimate of the root. However, it is prone to unstablebehaviour, 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 completelygeneral method, but will assume that we have certain information about the function U(x). In particular, we willassume that we know where the minimum of U(x) lies. (In the first problem, U(x) = x3 + exp[x2] 1, which has aminimum 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 evaluateU at points xn = x0js, j = 1, 2, . . . , for which U(xj) < E until we find the first point for which U(xn) > E. Clearlythe root ofU(x) = E then lies between A = xn1 and B = xn. We now bisect this interval, and evaluate U(x) at the

  • 8/2/2019 Non Linear Oscillator

    2/2

    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. Otherwisewe set A = x. In either case, the root lies between the new values of A and B. To find the root more accurately, werepeat the bisection in the same manner and find which of the two segments contains the root. Continuing in thisfashion, we can find the value of the root xmin to arbitrary accuracy. When the difference B A is sufficiently small,the iterations are terminated. The upper root xmax can be found in a similar fashion. (Note that the search steplength 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 equallength 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:

    xmaxxmin

    dx

    2[E U(x)]

    Ni=1

    fix, (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 find that it converges rather

    poorly. (Exercise 2 asks you to examine and characterize this convergence in detail.) If you consider (or plot) theintegrand f(x), you will see that it diverges at the end points, xmax and xmin, where the velocity v 0. It is fairlyeasy 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. Wenote that the function g(x) = 2[E U(x)] is smooth and well-behaved near the end points. (It just happens to passthrough zero there.) A linear approximation to that function in any of the short integration segments [xi, xi+1] willbe good, even near the classical turning points. We also have that f = g1/2. So let us transform the integral oneach integration segment,

    x+xx

    dx

    2[E U(x)]=

    x+xx

    f(x)dx =

    x+xx

    f

    dg

    dx

    1

    dg xg

    x+xx

    dgg

    =x

    g2[

    g(x + x)

    g(x)],

    (7)where g = g(x + x) g(x). The final expression can be simplified to:

    x+xx

    dx2[E U(x)]

    2xg(x + x) +

    g(x)

    . (8)

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

    xmaxxmin

    dx2[E U(x)]

    N1i=0

    2xg(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 limitswhere 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 asimple 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 youapproximate the potential U = 0 for |x| < 1 and U = for |x| > 1, then the energy is entirely kinetic, so thatthe 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.