How to integrate using trapezoidal method
古いコメントを表示


How would I solve the above integral numerically using trapazoidal rule? I have no idea where to start, I am only able to use basic coding language functions, so nothing fancy please.
3 件のコメント
David Goodmanson
2021 年 2 月 10 日
Hello Candice,
could you provide more detail on the integral? Since the wave function psi(x) is a function of x only, it is a constant as far as the integral in epsilon is concerned. So psi can be pulled outside the integral, leaving an integral that does not converge.
Candice Pillow
2021 年 2 月 11 日
David Goodmanson
2021 年 2 月 12 日
This comment is not going to provide any immediate solution, but using 'a' in place of epsilon the form of the integral is
[constants]*Integral{0,2*n+1} exp(-a^2)*psi(a)^2*(1/a^2) da
To lowest order, the hermite polynomials of odd order are proportional to 'a' at the origin, and the hermite polynomials of even order are a constant at the origin. So for odd order the integrand goes like a constant at the origin and the integral converges. You can get an answer by setting up an array of 'a' values, calculating the integrand values and then using the trapz function. But for even order the integrand goes like a^-2 at the origin and the integral diverges.
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Numerical Integration and Differentiation についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!