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!

Anharmonic Oscillation

  1. Feb 10, 2015 #1
    1. The problem statement, all variables and given/known data

    Assume that the potential is symmetric with respect to zero and the system has amplitude ##a## suppose that ##V(x)=x^4## and the mass of the particle is ##m=1##. Write a java function that calculates the period of the oscillator for given amplitude ##a## using Gaussian quadrature with ##N=20## points.

    2. Relevant equations

    ##E = \frac12 m(\frac{dx}{dt})^2+V(x)##
    ##T=\sqrt{8m}\int^a_0\frac{dx}{\sqrt{V(a)-V(x)}}.##

    3. The attempt at a solution

    I don't have much experience with numerical methods so I am having difficulty understanding the question and how to proceed.

    Is the question asking instead of using ##T##, i.e the period given by : ##T=\sqrt{8m}\int^a_0\frac{dx}{\sqrt{V(a)-V(x)}}##, we instead must use the Gaussian quadrature of ##T##? Also, will ##T=\sqrt{8m}\int^a_0\frac{dx}{\sqrt{V(a)-V(x)}}## work for a nonquadratic function ##V(x)##?
     
  2. jcsd
  3. Feb 10, 2015 #2

    stevendaryl

    User Avatar
    Staff Emeritus
    Science Advisor

    The method of Gaussian quadratures is (in my opinion) a really difficult way to efficiently compute integrals numerically. I think it's too complicated to explain in a message. The basic idea is simple enough: You can approximate an integral

    [itex]\int_{a}^b f(x) dx = \sum_{i=1}^N w_i f(x_i)[/itex] where [itex]x_1, x_2, ...[/itex] are points in the interval [itex][a,b][/itex] and [itex]w_i[/itex] is a weighting function. The simplest approach is the "rectangle rule", which uses [itex]w_i = \frac{b-a}{N}[/itex] and [itex]x_i = a + i \cdot \frac{b-a}{N}[/itex]. Gaussian quadrature is a way to get a much more accurate approximation by choosing [itex]w_i[/itex] and [itex]x_i[/itex] in a more sophisticated way, but it's beyond me to explain how to do it in a post.

    As to the second question, if a particle goes from [itex]a[/itex] to [itex]b[/itex] and back, then the time taken for a full period is twice the time to go from [itex]a[/itex] to [itex]b[/itex]. To compute that time, you use:

    [itex]T = 2 \int dt = \int_a^b \frac{dt}{dx} dx = \int_a^b \frac{1}{v} dx[/itex] where [itex]v = \frac{dx}{dt}[/itex]. To compute [itex]v[/itex], you use conservation of energy:

    [itex]E = \frac{1}{2} m v^2 + V[/itex]
    [itex]v = \sqrt{\frac{2}{m} (E - V)}[/itex]

    So [itex]T = 2 \int_a^b \sqrt{\frac{m}{2(E-V)}} dx[/itex]

    If the potential is symmetric about x=0, then you can just do half the integral and double it:

    [itex]T = 4 \int_0^b \sqrt{\frac{m}{2(E-V)}} dx[/itex]

    So it works no matter what the potential [itex]V[/itex] is--it doesn't have to be quadratic.
     
  4. Feb 10, 2015 #3
    I see, thank you very much!

    So our weighted function for this particular question will be ##w_i = \frac{b-a}{N} = \frac{a-0}{20}## which implies ##
    \int_{a}^b f(x) dx = \sum_{i=1}^N w_i f(x_i) = \sum_{i=1}^{20} \frac{a-0}{20}\sqrt{8 \dot\ (1)}\frac{1}{\sqrt{V(a)-V(x_i = 0 +i\frac{a-0}{N})}}?##
     
  5. Feb 10, 2015 #4

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Wouldn't count as a gaussian quadrature in my book. (a/20 is equal weights) But I wouldn't know how to do it more sophisticated, sorry.
     
  6. Feb 10, 2015 #5

    stevendaryl

    User Avatar
    Staff Emeritus
    Science Advisor

    That's NOT using quadratures. That's using the much simpler "rectangle rule", also known as Newton's method (I think).
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted