Solving an ODE Eigenvalue Problem via the Ritz method

In summary, the conversation discusses a problem involving solving a differential equation using the Ritz method. The solution is equivalent to solving a variational approach and setting up an algebraic eigenvalue problem. The conversation also mentions a discrepancy in the scaling of the solutions and the solution is eventually found.
  • #1
member 428835
Hi PF!

I want to solve ##u''(x) = -\lambda u(x) : u(0)=u(1)=0##. I know solutions are ##u(x) = \sin(\sqrt{\lambda} x):\lambda = (n\pi)^2##. I'm trying to solve via the Ritz method. Here's what I have:

define ##A(u)\equiv d^2_x u## and ##B(u)\equiv u##. Then in operator form we have ##A(u) = -\lambda B(u)##. Taking the inner product of this expression with ##u##, where ##(f,g) \equiv \int_0^1 fg##, yields

$$(A(u),u) = -\lambda(B(u),u).$$

A variational approach implies the solution is equivalent to solving

$$\min\left((A(u),u)\right) : (B(u),u) = 1.$$

Next make the series expansion

$$u = \sum_i\alpha_i\phi_i(x).$$

Optimizing via Lagrange multipliers with respect to ##\alpha##'s implies (details omitted but straightforward)

$$\sum_i(A_{ij} +\lambda B_{ij})\alpha_i = 0,\\
A_{ij} \equiv (A(\phi_i),\phi_j),\,B_{ij} \equiv (B(\phi_i),\phi_j).
$$

This is an algebraic eigenvalue problem and solutions are direct. To solve for each harmonic ##\sin(n\pi x)##, simply take ##\phi_n\cdot\alpha_n## where ##\alpha_n## is the ##n##th eigenvector and ##\phi_n## is a vector of the first ##n## ##\phi(x)##'s.

So, substituting ##\phi_i(x) = x^i(1-x)## into ##\sum_i(A_{ij} +\lambda B_{ij})\alpha_i = 0## and calculating eigenvectors should give me a good solution, but it's not. Any ideas what I'm doing wrong? I can supply my code if that helps (Mathematica).

Edit: this isn't HW, but perhaps it should go there? Could a Mentor please move this there (I tried but I don't know how to move this without copy-pasting, hence having a double thread)?
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Update: my eigenvalues are very accurate, matching the analytic ones very well! However, when I reconstruct the harmonics (##\sin(\pi x),\sin(2\pi x),\sin(3\pi x)## etc) I require the ##n##th eigenvector, but the eigenvector is randomly scaled. Thus, the solution I obtain for the harmonics is not scaled properly. How do I determine the scaling?

Never mind, I figured it out!
 

Attachments

  • eigF.pdf
    31.5 KB · Views: 300
Last edited by a moderator:

What is an ODE Eigenvalue Problem?

An ODE Eigenvalue Problem involves finding the eigenvalues and corresponding eigenvectors of a linear differential operator. This is done by solving a system of ordinary differential equations (ODEs).

What is the Ritz method?

The Ritz method is a numerical method for solving an ODE Eigenvalue Problem. It involves approximating the solution to the differential equation using a finite number of basis functions and then finding the eigenvalues and eigenvectors of the resulting matrix equation.

How is the Ritz method different from other methods?

The Ritz method is an approximate method, meaning it does not provide an exact solution. It also allows for a flexible choice of basis functions, making it applicable to a wide range of problems. Additionally, it can handle complex boundary conditions and nonlinear differential equations.

What are some applications of the Ritz method?

The Ritz method has been used in a variety of fields, including structural engineering, fluid dynamics, quantum mechanics, and heat transfer. It is particularly useful for problems that cannot be solved analytically or are computationally expensive to solve.

What are the limitations of the Ritz method?

The Ritz method may not yield accurate results if the chosen basis functions do not adequately represent the true solution. It may also be computationally intensive for problems with a large number of unknowns. Additionally, it does not guarantee convergence to the true solution.

Similar threads

Replies
13
Views
1K
  • Differential Equations
Replies
4
Views
2K
  • Differential Equations
Replies
2
Views
1K
  • Differential Equations
Replies
1
Views
2K
  • Calculus
Replies
8
Views
857
Replies
9
Views
1K
  • Differential Equations
Replies
1
Views
752
  • Differential Equations
Replies
2
Views
2K
  • Differential Equations
Replies
21
Views
4K
  • Differential Equations
Replies
3
Views
2K
Back
Top