Graduate Finding eigenvalues with spectral technique: basis functions fail

Click For Summary
The discussion revolves around finding eigenvalues for a specific ordinary differential equation (ODE) using basis functions. The user encounters issues when omitting the first basis function, leading to incorrect eigenvalue results. It is emphasized that a complete basis is necessary to accurately represent the solution space of the ODE. The user successfully computes eigenvalues using a complete set of basis functions but struggles to determine correctness without an exact solution for comparison. The conversation highlights the importance of including all relevant basis functions to ensure accurate results in spectral methods.
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
Why are Bij =0??
 
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.
 
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##?
 
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?
 
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?
 
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?
 
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?
 
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?
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K