I am trying to solve the following integro-differential equation: $$ a(\varepsilon) f'(\varepsilon) + b(\varepsilon) f(\varepsilon) + \int_{\varepsilon}^{\varepsilon + \varepsilon_1} R_1(\epsilon) f(\epsilon) d\epsilon - \int_{\varepsilon - \varepsilon_2}^{\varepsilon} R_2(\epsilon) f(\epsilon) d\epsilon = 0, $$ where $\varepsilon_1 = 10$, $\varepsilon_2 = 20$.
Note that the reduction of this equation into a second-order ODE is possible, but is much harder to solve. See, e.g., this question.
Taking
eps1 = 10;
eps2 = 20;
epsmin = .025;
epsmax = 150;
a[eps_] := 1 + eps
b[eps_] := eps^1.4
R1[eps_] := Piecewise[{{eps, eps1 <= eps <= epsmax}|}, 0]
R2[eps_] := Piecewise[{{eps, eps2 <= eps <= epsmax}|}, 0]
We know that f[eps] > 0
for epsmin <= eps <= epsmax
, and that f[eps] = 0
for eps <= epsmin
and eps >= epsmax
. For eps >= epsmax
, all derivatives of f[eps]
also become 0. Also,
Integrate[Sqrt[eps] f[eps], {eps, epsmin, epsmax}] == 1;
I have tried to use NDSolve
with NIntegrate
as follows:
solBW = NDSolve[{f'[eps]+b[eps] f[eps]/a[eps]a[eps]f'[eps] + 1/a[eps]b[eps]f[eps] NIntegrate[R1[eps1]+ f[eps1]NIntegrate[R1[y]f[y],{eps1y, eps, eps + eps1}] - 1/a[eps] NIntegrate[R2[eps1] f[eps1]NIntegrate[R2[y]f[y],{eps1y, eps - eps2, eps}] == 0, f[epsmax]==0f[epsmax] == 0}, f, {eps, epsminepsmax, epsmin}];
but it returns
NIntegrate: eps1y = eps is not a valid limit of integration.
Any hint on how to solve this equation numerically is appreciated.