1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Problem with Heun's Method

  1. Feb 8, 2016 #1
    1. The problem statement, all variables and given/known data
    Use the Heun method to compute the period of small oscillations about the equilibrium position of a nitrogen atom.
    xi = 1.1
    Um = 7.37
    x0 = 1.2
    alpha = 2.287
    m = 2.325e-26

    2. Relevant equations

    U(x) = Um((1-e^(-alpha(x-x0)))^2 - 1)

    3. The attempt at a solution

    I was told to take the derivative of dU/dx and got (-1/m)*(2*Um*alpha*(1-e**(-alpha*(x-x0)))*(e**(-alpha*(x-x0)))) and used that to calculate my heun step with a time step of 0.5e-15. With this I get a graph that looks like this: 1XxRKQK.jpg which is a velocity vs. time graph. I'm wondering if this graph looks correct and if so why? I thought it would turn out to be something more like: DampedSine.png








     
  2. jcsd
  3. Feb 8, 2016 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    If ##U(x) = U_m((1-e^{(-alpha(x-x0)))^2 - 1)}##, it's not clear how you calculated

    $$U'(x) = (-1/m)*(2*Um*alpha*(1-e^{(-alpha*(x-x0)))}*(e^{(-alpha*(x-x0)))}))$$

    I'm assuming that ##U_m## is a constant and not ##U ⋅ m##.

    You might want to use some substitutions in the original expression for U(x) to simplify its form before taking the derivative. I would check the derivative using a tool like Wolfram Alpha before writing code with it.
     
  4. Feb 8, 2016 #3
    Yea sorry about my bad formatting you're right it is a constant and I used python to compute the derivative.
     
  5. Feb 8, 2016 #4

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    I'm not sure how you do that, but I would check the derivative which Python gave against a pencil and paper derivative or Wolfram Alpha.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Problem with Heun's Method
Loading...