faqhw1

2
Quantum Oscillator HW 1: Using a shooting method to solve the ODE Computational Goal: Find first 5 eigen values/functions ε n for the second order ODE d 2 φ n dx 2 -[Kx 2 -ε n ]φ n =0 with K =1, using the shoot- ing method. 1 How do I approximate the problem on a finite domain, what would be the boundary conditions? Implementing the Boundary Conditions requires some approximations which have not been stated explicitly in the problem statement, hence are discussed in detail here. Consider the simplified second-order differential equation: d 2 φ n dx 2 - β n φ n =0 (1) with same boundary conditions φ n (x) 0 as x → ±∞. This system has the general solution: φ n (x)= c 1 exp( p β n x)+ c 2 exp(- p β n x) (2) where only β n 0 are considered to have decaying solutions φ n (x). Furthermore, for decaying solutions we require: x: φ n (x)= c 2 exp(- p β n x) (3) x→-: φ n (x)= c 1 exp( p β n x) (4) These solutions can be also expressed as the solutions to the first order equations: x →∞ : n dx + p β n φ n =0 (5) x → -∞ : n dx - p β n φ n =0 (6) Comparing the above equations, with the constant β n value replaced by the variable β n (x)= Kx 2 -ε n ,a good approximation to implement the required boundary conditions φ n (x) 0 as x →±L at the boundaries of the computational domain x [-L, L] is given by equations: x = L : n dx + p Kx 2 - ε n φ n =0 (7) x = -L : n dx - p Kx 2 - ε n φ n =0 (8) To get an idea of the error introduced due to the above approximation, computing the derivative of the boundary condition equations with K =1 gives: d 2 φ n dx 2 ±L = ±x x 2 - ε n φ n + ( x 2 - ε n ) φ n (9) Hence the error introduced is ±x x 2 -εn φ n , which is small as φ n (x) 0 as x →±L. 1

Upload: marcosmarxm

Post on 17-Sep-2015

212 views

Category:

Documents


0 download

DESCRIPTION

dfasdasd

TRANSCRIPT

  • Quantum Oscillator HW 1: Using a shootingmethod to solve the ODE

    Computational Goal: Find first 5 eigen values/functions n for thesecond order ODE d

    2ndx2 [Kx

    2n]n = 0 with K = 1, using the shoot-ing method.

    1 How do I approximate the problem on a finite domain, whatwould be the boundary conditions?

    Implementing the Boundary Conditions requires some approximations which have not been stated explicitlyin the problem statement, hence are discussed in detail here.Consider the simplified second-order differential equation:

    d2ndx2

    nn = 0 (1)with same boundary conditions n(x) 0 as x . This system has the general solution:

    n(x) = c1 exp(nx) + c2 exp(

    nx) (2)

    where only n 0 are considered to have decaying solutions n(x). Furthermore, for decaying solutions werequire:

    x : n(x) = c2 exp(nx) (3)

    x- : n(x) = c1 exp(nx) (4)

    These solutions can be also expressed as the solutions to the first order equations:

    x : dndx

    +nn = 0 (5)

    x : dndxnn = 0 (6)

    Comparing the above equations, with the constant n value replaced by the variable n(x) = Kx2n, a

    good approximation to implement the required boundary conditions n(x) 0 as x L at the boundariesof the computational domain x [L,L] is given by equations:

    x = L :dndx

    +Kx2 nn = 0 (7)

    x = L : dndxKx2 nn = 0 (8)

    To get an idea of the error introduced due to the above approximation, computing the derivative of theboundary condition equations with K = 1 gives:

    d2ndx2

    L

    =

    ( xx2 n

    n +(x2 n

    )n

    )(9)

    Hence the error introduced is xx2n

    n, which is small as n(x) 0 as x L.

    1

  • 2 Algorithm sketch

    We have to solve a boundary value problem, which requires that all the solutions of the differential equationsatisfy two conditions prescribed above. You shooting method/algorithm to solve such a boundary valueproblem should:

    1. For every eigenfunction, eigenvalue pair [n, n] to be computed, start with an initial guess for n andn |L= (L). Hint: The theoretical eigen values are odd integer values n = 1, 3, . Since theODE is linear, the initial guess value of n(L) can be arbitrary, for convenience it can be chosen as1.

    2. Solve the problem using the MATLAB function ode45, giving values at the grid points xn = L :4x : L of n.

    3. If solution at x = L : n(L) satisfies the prescribed boundary condition within required tolerance, therequired eigenvalue n have been found. If the solution does not meet the required boundary conditionx = L, then adjust the value of n in progressively smaller step sizes till the solution converges. Forinstance, you can keep cutting the amount by which you change n by half. Remember to reset thisfor each eigen value.

    3 Other possible approximations for the boundary conditions?

    The boundary conditions prescribed above is just one possible approximation - this is the one set up for thegrader. As mentioned in the general FAQ, the grader is in place as a check on your algorithm steps. Onceyour shooting algorithm produces the same results as the grader, you know that you have implemented thealgorithm correctly, awesome! Feel free to play around with other approximations/domain sizes to see howyour eigen values compare to the theoretical eigen values.

    2