Finding eigenvalues with spectral technique: basis functions fail

In summary, the conversation discusses finding the eigenvalues of an ODE using basis functions and taking inner products to formulate a matrix equation. The question arises about why the first basis function, phi_1, must be included in the solution, and how the correct solutions can be identified without an analytic solution to compare to.
  • #1
member 428835
Hi PF!

I'm trying to find the eigenvalues of this ODE $$y''(x) + \lambda y = 0 : u(0)=u(1)=0$$ by using the basis functions ##\phi_i = (1-x)x^i : i=1,2,3...n## and taking inner products to formulate the matrix equation $$A_{ij} = \int_0^1 \phi_i'' \phi_j \, dx\\ B_{ij} = \int_0^1 \phi_i\phi_j\,dx :\\A+\lambda B = 0 .$$
Solving ##A+\lambda B = 0## is direct; it's a linear algebraic equation. We can compare our approximate solution to the exact solution ##(i \pi)^2 : i=1,2,3...## In this way, I know if a solution is correct or not.

Understanding the above, why is it if I choose the basis functions to begin at ##i=2## I do not get the correct solution? I assume in this case the basis does not span the solution's function space, but can someone elaborate? How do I know if a given basis function spans the solution space?
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Why are Bij =0??
 
  • #3
I second hutch's question. For your question, I suggest you consider what the true eigenfunctions are for this ODE and how many functions in your basis you need to represent even one of the exact eigenfunctions.
 
  • #4
hutchphd said:
Why are Bij =0??
My bad, clearly a typo!

Haborix said:
For your question, I suggest you consider what the true eigenfunctions are for this ODE and how many functions in your basis you need to represent even one of the exact eigenfunctions.
I appreciate your feedback :oldbiggrin: But this doesn't answer my question. If I don't know the exact eigenfuctions, how would I know to include the first term, ##\phi_1##?
 
  • #5
Because you need a complete basis in general. What prompts the question? Frankly, I don't see the point here. Why do you think you can pick and choose?
 
  • #6
hutchphd said:
Because you need a complete basis in general. What prompts the question? Frankly, I don't see the point here. Why do you think you can pick and choose?
You're coming across a little rude, and I don't know why. But we all have bad days, so it's okay, and here is some background, and also why I didn't say complete (because obviously I'm out of my league if I try to use that word).

If anyone reading this I really don't think you need the background, as the actual problem I'm working on is very complicated. However, the simple one I've manufactured in the question stem should be sufficient to help me out.

Does anyone know why we need to include the ##\phi_1## term? Without knowing the exact solution, how would I know that I'm missing a term?
 
  • #7
I am having some trouble following. It looks like you're trying to find a solution to your ODE that is in the space of functions spanned by ##\phi_1,\ldots,\phi_n##, but (unless ##\lambda=0##) there won't be a nonzero solution in the span. Perhaps you don't mean to include only finite many ##\phi_i## and want to allow infinite sums? Could you clarify?
 
  • #8
Infrared said:
I am having some trouble following. It looks like you're trying to find a solution to your ODE that is in the space of functions spanned by ##\phi_1,\ldots,\phi_n##, but (unless ##\lambda=0##) there won't be a nonzero solution in the span. Perhaps you don't mean to include only finite many ##\phi_i## and want to allow infinite sums? Could you clarify?
There is a non-zero solution though. Just using ##n=1## recovers ##\lambda = 10##, which is close to ##(1\cdot\pi)^2##. And if we increase the number of terms we recover higher eigenvalues and accuracy of each. Or am I not understanding you?

And yes, I'm only using finitely many ##\phi_i##. If I use ##i = 2:5## I get a bad solution, but if I use ##i = 1:4## I get a good solution. I know it's good because it matches the exact. But if I didn't have the exact solution to compare, how would I know what is right?
 
  • #9
joshmccraney said:
You're coming across a little rude, and I don't know why.
Sorry about the rude (didn't intend it) but i am still not quite sure what you are asking (and I am not a mathematician).
joshmccraney said:
And yes, I'm only using finitely many ϕiϕi\phi_i. If I use i=2:5i=2:5i = 2:5 I get a bad solution, but if I use i=1:4i=1:4i = 1:4 I get a good solution. I know it's good because it matches the exact. But if I didn't have the exact solution to compare, how would I know what is right?
For instance I don't know what "right" means in the above...What do you mean "matches"...not exactly surely?
 
  • #10
hutchphd said:
Sorry about the rude (didn't intend it) but i am still not quite sure what you are asking (and I am not a mathematician).

For instance I don't know what "right" means in the above...What do you mean "matches"...not exactly surely?
Thanks for saying that, and I'm sorry for the ambiguity. The the first four analytic eigenvalues are $$\lambda_{1-4} =
{
{9.8696},
{39.4784},
{88.8264},
{157.914}
}.$$

When I compute the matrices using ##\phi_{1-4}## I recover $$\lambda _{1-4} =
{
{9.86975},
{39.5016},
{102.13},
{200.498}
}$$

which looks pretty good. However, when I compute the matrices using ##\phi_{2-5}## I recover $$\lambda _{1-4} =
{
{10.4331},
{41.3846},
{92.123},
{244.059}
}$$ which is clearly wrong. Without an analytic solution to compare to, how would I know which computed eigenvalues are correct?
 

FAQ: Finding eigenvalues with spectral technique: basis functions fail

1. What is the spectral technique for finding eigenvalues?

The spectral technique is a mathematical method used to find the eigenvalues of a matrix. It involves breaking down the matrix into its spectral components and using these components to calculate the eigenvalues.

2. How does the spectral technique differ from other methods of finding eigenvalues?

The spectral technique is unique in that it utilizes basis functions, which are sets of mathematical functions that span the space of the matrix. This allows for a more efficient and accurate calculation of eigenvalues compared to other methods.

3. Why do basis functions sometimes fail in finding eigenvalues?

Basis functions can fail in finding eigenvalues when they are not able to accurately represent the matrix. This can occur when the matrix is too complex or when the basis functions are not chosen properly.

4. What are some advantages of using the spectral technique for finding eigenvalues?

The spectral technique has several advantages, including its ability to handle large and complex matrices, its high accuracy in calculating eigenvalues, and its efficiency in computation.

5. Are there any limitations to using the spectral technique for finding eigenvalues?

While the spectral technique is a powerful method, it does have some limitations. It may not be suitable for all types of matrices, and the accuracy of the results can be affected by the choice of basis functions. Additionally, it may require more computational resources compared to other methods.

Similar threads

Back
Top