how to take numerical inverse integration?

9 ビュー (過去 30 日間)
Somnath Kale
Somnath Kale 2022 年 6 月 26 日
編集済み: John D'Errico 2022 年 6 月 26 日
Hi
I was trugulling to find the value of S(q) (see the attached equation)
In attached data I have B(r), r and q values. can someone please help me in that contex?
Thanks in advance!
  2 件のコメント
Abolfazl Chaman Motlagh
Abolfazl Chaman Motlagh 2022 年 6 月 26 日
there is integration over q, so it's a dummy variable. why do you have a value for q in every row?? you should have a list of data for r and B(r). if i'm wrong about something correct me.
with some observation over r we have set of equations for B(r) and the integral. then we can approximate S(q) with finite difference method.
Somnath Kale
Somnath Kale 2022 年 6 月 26 日
@Abolfazl Chaman Motlagh u are absolutly right . Q is the integrating variable.
Considering the upper and lower limits od the integration with a = 341E-9 and L = 5.53e-7. I just have genrated the q values using the linspace function. It will be really helpful If i got the small portion of code to get S and q!
Thhank you for your response as well!

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

採用された回答

John D'Errico
John D'Errico 2022 年 6 月 26 日
編集済み: John D'Errico 2022 年 6 月 26 日
This is technically called an inhomogeneous Fredholm integral equation, of the first kind.
Inhomogeneous, because that left hand side has g in it, not zero.
Is it easy to solve? Is there some one line call to do it, one simple piece of code you can find? Sadly, no. These tend to be difficult problems, that are, as I recall, numerically problematic. They are often things that will highly amplify any small amount of noise in your data. The technical term there would be ill-posed. It means that while the solution is not impossible, it is just ... difficult to do well.
I did a quick search for code to solve a general first kind integral equation, but,, although I did see some cases where someone claimed to solve integral equations using MATLAB, I did not find anything you could use.
Worse, then I took a quick look at your data. UGH. Why do I say that? UGH squared.
Look at the values q and r take on. They are seriously large numbers. Then, inside the integral, you have cos(q*r). That means you have this cosine wave inside the integral that is oscillating insanely fast. In turn, that means that your solution will be virtually impossible.
Again, go back to the ill-posed thing. Inside your integral, you have this thing that is oscillating over millions of cycles. Lets see, if we have
a = 341E-9;
L = 5.53e-7;
Then the limits of your integration are
[2*pi/L,2*pi/a]
ans = 1×2
1.0e+07 * 1.1362 1.8426
And r varies from effectively close to zero 3.41796875 to 553.7109375. So r varies by over a factor of 100. What does q*r look like then? q*r is a product that can be as small as
3.41796875*1.1362e7
ans = 3.8835e+07
to
553.7109375*1.8426e7
ans = 1.0203e+10
As I said, you have this cosine function that is varying by millions and even billions of times inside the domain of integration. In turn that means s(q) must be a function that also varies extremely rapidly. (Simple finite differences are probably a REALLY INSANELY BAD IDEA, when something varies that rapidly.) More typically, one uses some sort of regularized spline to estimate as s(q). The regularization counteracts the ill-posed nature of the problem, making it more tractable.
And you want to solve this, using only a few hundred pieces of data? As a consulting mathematician, I would tell you to walk as fast away from that problem as fast as you can. In fact, run like hell! At the very least, I would suggest you do a LOT of reading. Learn how such fitst kind integral equations are typically solved. Spend some time talking with a mathematician, one who understands these ugly animals, and who understands the numerical methods necessary to solve them.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by