Anharmonic Oscillation | Calculate Period w/ Gaussian Quadrature

In summary: Gaussian quadratures do not use equally spaced points--the points are chosen in a more sophisticated way that gives a more accurate approximation. But, again, I don't know how to explain how to do it in a post.
  • #1
Robben
166
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
  • #2
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.
 
  • #3
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

[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.

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})}}?##
 
  • #4
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.
 
  • #5
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).
 

Related to Anharmonic Oscillation | Calculate Period w/ Gaussian Quadrature

1. What is anharmonic oscillation?

Anharmonic oscillation is a type of motion in which the restoring force is not directly proportional to the displacement from equilibrium. This means that the oscillation does not follow a simple sinusoidal pattern, and instead exhibits more complex behavior.

2. How is the period of anharmonic oscillation calculated?

The period of anharmonic oscillation can be calculated using various methods, such as numerical integration or perturbation theory. One common method is using Gaussian quadrature, which involves approximating the integral of the equation of motion over one period. This method is preferred because it is more accurate and efficient compared to traditional methods.

3. What is Gaussian quadrature?

Gaussian quadrature is a numerical integration technique that uses a weighted sum of function values at specific points to approximate the integral of a function. This method is more accurate and efficient compared to traditional numerical integration techniques, as it uses a smaller number of function evaluations.

4. How does Gaussian quadrature calculate the period of anharmonic oscillation?

In the context of anharmonic oscillation, Gaussian quadrature approximates the integral of the equation of motion over one period by using a weighted sum of function values at specific points. This allows for a more accurate calculation of the period compared to traditional methods, which may involve approximating the integral over a larger range of values.

5. What are the benefits of using Gaussian quadrature to calculate the period of anharmonic oscillation?

There are several benefits of using Gaussian quadrature to calculate the period of anharmonic oscillation. Firstly, it is more accurate compared to traditional methods, as it uses a smaller number of function evaluations. Additionally, it is more efficient, as it does not require a large number of points to be evaluated. Furthermore, it can handle a wider range of functions, including highly oscillatory or discontinuous functions, making it a versatile technique for calculating the period of anharmonic oscillations.

Similar threads

  • Advanced Physics Homework Help
Replies
9
Views
2K
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
16
Views
506
  • Advanced Physics Homework Help
Replies
7
Views
1K
  • Advanced Physics Homework Help
Replies
10
Views
820
  • Advanced Physics Homework Help
Replies
6
Views
868
  • Advanced Physics Homework Help
Replies
9
Views
1K
  • Advanced Physics Homework Help
Replies
26
Views
3K
  • General Math
Replies
4
Views
758
Back
Top