Anharmonic Oscillation | Calculate Period w/ Gaussian Quadrature

  • Thread starter Thread starter Robben
  • Start date Start date
  • Tags Tags
    Oscillation
Click For Summary

Homework Help Overview

The discussion revolves around calculating the period of an anharmonic oscillator with a potential given by \( V(x) = x^4 \). The original poster is tasked with implementing a Java function to compute the period using Gaussian quadrature, specifically with \( N = 20 \) points, while considering the mass of the particle as \( m = 1 \).

Discussion Character

  • Exploratory, Mathematical reasoning, Assumption checking

Approaches and Questions Raised

  • The original poster expresses uncertainty about the application of Gaussian quadrature in this context and questions whether the provided formula for the period \( T \) is applicable for non-quadratic potentials. Some participants discuss the complexity of Gaussian quadrature and its comparison to simpler numerical methods like the rectangle rule.

Discussion Status

Participants are exploring different interpretations of the problem and discussing the validity of using Gaussian quadrature versus simpler methods. There is no explicit consensus on the best approach, but some guidance on the relationship between the period and the integral is provided.

Contextual Notes

There is a mention of the potential being symmetric about zero, which may influence the approach to calculating the period. Additionally, the original poster's lack of experience with numerical methods is noted, which may affect their understanding of the problem.

Robben
Messages
166
Reaction score
2

Homework Statement



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.

Homework Equations



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

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)##?
 
Physics news on Phys.org
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

\int_{a}^b f(x) dx = \sum_{i=1}^N w_i f(x_i) where x_1, x_2, ... are points in the interval [a,b] and w_i is a weighting function. The simplest approach is the "rectangle rule", which uses w_i = \frac{b-a}{N} and x_i = a + i \cdot \frac{b-a}{N}. Gaussian quadrature is a way to get a much more accurate approximation by choosing w_i and x_i 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 a to b and back, then the time taken for a full period is twice the time to go from a to b. To compute that time, you use:

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

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

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

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

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

So it works no matter what the potential V is--it doesn't have to be quadratic.
 
stevendaryl said:
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

\int_{a}^b f(x) dx = \sum_{i=1}^N w_i f(x_i) where x_1, x_2, ... are points in the interval [a,b] and w_i is a weighting function. The simplest approach is the "rectangle rule", which uses w_i = \frac{b-a}{N} and x_i = a + i \cdot \frac{b-a}{N}. Gaussian quadrature is a way to get a much more accurate approximation by choosing w_i and x_i 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 a to b and back, then the time taken for a full period is twice the time to go from a to b. To compute that time, you use:

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

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

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

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

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

So it works no matter what the potential V is--it doesn't have to be quadratic.

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})}}?##
 
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.
 
Robben said:
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})}}?##

That's NOT using quadratures. That's using the much simpler "rectangle rule", also known as Newton's method (I think).
 

Similar threads

Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
19
Views
3K
Replies
7
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K