Solving second order ODE eigenvalue problem using RK4

Hi, I'm trying to solve the following ODE using RK4:
y''+(lambda-x^2) y = 0 on [-L,L], subject to y(-L)=y(L)=0 (taking L=5 is fine).
I know the solution is lambda=2n+1, n some positive integer (some residual is fine), with y=exp(-x^2/2) (which obviously is very small at L=\pm 5)
I'm terribley bad at coding and I don't think my code will be any use, so I havent included it.
Please help. Thanks in advance.

1 件のコメント

Jan
Jan 2021 年 4 月 16 日
You forgot to ask a question. How can we help you?
Of course your code would be useful, because if you show it, we can help you to fix the problems in it.

サインインしてコメントする。

回答 (1 件)

カテゴリ

質問済み:

2021 年 4 月 16 日

回答済み:

2021 年 9 月 20 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by