Group Abstract Group Abstract

Message Boards Message Boards

Solving a system of integral equations by iteration with NestList

GROUPS:
Hi all,

I have to solve the following system of equations.
F1[s_]=NIntegrate[F1[sp]*T1[sp]/(sp-s-I*10^-6),{sp,0.6,Infinity}]+NIntegrate[F2[sp]*T2[sp]/(sp-s-I*10^-6),{sp,1.1,Infinity}];
F2[s_]=NIntegrate[F1[sp]*T2[sp]/(sp-s-I*10^-6),{sp,0.6,Infinity}]+NIntegrate[F2[sp]*T1[sp]/(sp-s-I*10^-6),{sp,1.1,Infinity}];

I have to solve it iteratively, that is, I should give an initial function for both F1 and F2 (the so-called F1input, F2input below), and resulting F1 and F2 functions are calculated. Then, I should make use of these new functions and do the same as before. The procedure should be iterated until after n steps the procedure converges. Notice that the integrals also depends on s, which is a variable that in my case runs from 0 to 3.

I tried the following to get my problem solved but it does not works as desired unfortunately.
data = Table[{s,
NestList[Apply[Function[{F1,F2}, {Abs[NIntegrate[F1*T1[sp]/(sp-s^2-I*10^-6),{sp, 0.6, Infinity},PrecisionGoal->1,MaxRecursion->100]+NIntegrate[F2*T2[sp]/(sp-s^2-I*10^-6),{sp, 1.1, Infinity},PrecisionGoal -> 1, MaxRecursion -> 100]],Abs[NIntegrate[F1*T2[sp]/(sp-s^2-I*10^-6),{sp, 0.6, Infinity},PrecisionGoal->1,MaxRecursion -> 100]+NIntegrate[F2*T1[sp]/(sp-s^2-I*10^-6),{sp,1.1, Infinity},PrecisionGoal -> 1,MaxRecursion -> 100]]}], #] &,{F1input[sp],F2input[sp]}, 1]},{s, 0, 3, 0.25}]

To sum up I want to obtain a table giving me three entries: F1 and F2 for each value of s analyzed.

Your help would be really appreciated. Thank you so much in advance. 

Sergi
Answer
6 months ago
Just on a cursory inspection, not sure your equations were written down correctly because they are identical so F1==F2.

Your stated goal of getting three approximate solutions means you would want Nest instead of NestList (which gives all the intermediate approximations as well).

Not sure why there is an Abs in there.

The way you have setup your function, F1 and F2 are supposed to be values, approximations to F1, F2, so the initial conditions should be guesses too, and of course you might want to run the iteration for more than 1 step (the third argument of NestList) and finally one need not expect that the iteration will actually solve the Integral equations. 
POSTED BY: Todd Rowland
Answer
6 months ago
When you run something like :
NIntegrate[F1[sp]/(sp - s - I*10^-6), {sp, 0.6, Infinity}]
What you're looking to do is to basically input a function (f1) and to have NIntegrate output a function (really an interpolation function).

NIntegrate doesn't do this. NIntegrate returns a number and requires that you don't give it undefined values that aren't variables of integration.

There's a number of ways around this. I think the best for Mathematica 9 would be to use ParametricNDSolve. This means you have to rephrase the integral as a differential equation, but that's not too bad. ParametricNDSolve will give you a function, which is what you want as output from the function you will have doing the iteration.
POSTED BY: Sean Clarke
Answer
6 months ago
So you can use ParametricNDSolve, but it's not very well suited to being nested since it doesn't return just a simple interpolation. If you were still interested in knowing how you can convert an Integral into a Parametric NDSolve statement, please consider this integral as an example:
Integrate[Sin[a x], {x, 0, 1}]
This can be easily solved symbolically, returning a function of a, but let's just assume it can't. If that were the case, we could transform it into this ParametricNDSolveValue statement:
ParametricNDSolveValue[{output'[x] == Sin[a x], output[0] == 0}, output[1], {x, 0, 1}, {a}]
This gives the same curve, just numerically.


Anyway, what you probably really want to do is build an Interpolation on each iteration. There's smarter ways of doing this, but I'll try a rough example with equidistant, nonadaptive sampling.

Consider this simple integral equation which I'll use as an example because it is really simple. I don't know that much about integral equations or I would come up with something more interesting that was roughly as simple
F[a] == Integral[F[x a], {x, 0, 1}]

We want to make a function, I'll call it iterate, which takes a function and then runs:
NIntegrate[f[x a], {x, 0, 1}]
For many values of "a" and then makes an interpolation out of those values. Use Table to create a list of values for different values of a. It can be defined like this:
iterate[f_] := Interpolation@
  Table[{a, NIntegrate[f[x a], {x, 0, 1}]}, {a, 0, 1, 0.01}]
"iterate" is a function that returns a function defined on the interval 0 to 1

We can now run iterate over and over. I'll just choose Sin as the seed function:
it = iterate[Sin]
Now run this a couple of times
it = iterate[it]; Plot[it[t], {t, 0, 1}]
You can see that it approaches a function equal to 0 everywhere, which is boring, but a solution to the intergral equation above.
POSTED BY: Sean Clarke
Answer
6 months ago
Hi Sean,

first of all thank you for trying to help, but I still have not solved my problem. Notice that I corrected some mistakes in my post thanks to Todd's comment. 

I know I can not use NIntegrate with undefined values (s in my case), that is why I use the Table command before NestList in order to get a result for each value of s evaluated.

What I really want to do is to solve both integrals at the same time giving initial functions (The so called F1input and F2input). I am trying to follow the following simple example which is quite useful
 With[{\[CurlyEpsilon] = 1/10},
  NestList[Apply[
     Function[{y, x}, {y + \[CurlyEpsilon] Sin[x],
       x + y + \[CurlyEpsilon] Sin[x]}], #] &, N[{2, 3}], 10]]
 
 
 {{2., 3.}, {2.01411, 5.01411}, {1.91863, 6.93274}, {1.97911,
   8.91185}, {2.02819, 10.94}, {1.92834, 12.8684}, {1.95808,
   14.8265}, {2.03525, 16.8617}, {1.94382, 18.8055}, {1.93942,
  20.745}, {2.0342, 22.7792}}


Thanks a lot,

Sergi
Answer
6 months ago