2

I have trouble running a calculation without getting an error,

I have the given Fredholm equation:

enter image description here

where $\psi(x)=\sin x$and $K(x,y)=\cos(x/2-3y)$

Now I calculated that for the operator to be a contraction, $\lambda<\sqrt{2}$. Further, I have initial conditions that $\phi(0)=0$

So I have to solve the integral equation with the given parameters and plot the iterated solutions $f_1, f_2...f_{50}$. The form of this is , with $A$ being the Fredholm operator:

enter image description here

This means I have to find the plots of the iterated solutions which should converge to the solution, with a given value of lambda in that domain.

My attempt:

psi[x_]=Sin[x];
K[x_,y_]=Cos[x/2 -3 y];

[Lambda]=1

PHI = DSolveValue[[Phi][x] == psi[x] + [Lambda] Integrate[K[x, y] [Phi][y], [Phi[0]]==0 {y, 0, x}], [Phi], x]

and

 Plot[
     Table[
       Callout[PHI[x], NumberForm[\[Lambda], {5, 3}]],
       {\[Lambda], -1, 4, 0.7}] // Evaluate,
     {x, 0, Pi/2},
     AspectRatio -> 1]

However, I get "Invalid integration variable or limit(s) in [Phi][0]==0."

and a blank plot.

Any idea how I can improve this code? I was thinking maybe I should use Picard iteration?

I add the question as a picture: enter image description here enter image description here enter image description here

Thanks

Vangsnes
  • 591
  • 2
  • 9
  • 1
    Looks buggy to me - ϕ[x] shouldn't appear anymore in the solution of the differential equation. Playing around a bit, I am not sure Mathematica can solve this kind of equation (the issue seems to be that the integration bound depends on x) – Lukas Lang Nov 16 '22 at 12:59
  • If you change the upper limit in the integral to say 4, or any number, it works. It is the variable in the upper limit that is not accepted, unless you keep the variable x in the upper limit and change psi[x] to some constant. – Vangsnes Nov 16 '22 at 13:05
  • It was from an older version of the code, but it is superfluous, and its presence does not change the outcome. – Vangsnes Nov 16 '22 at 13:18
  • @Vangsnes Yeah, I noticed that a constant bound works - with this in mind, are you sure your equation is correct? It seems quite unusual to have both the integrand and the integration limit depend on x – Lukas Lang Nov 16 '22 at 13:19
  • @LukasLang I added an update – Vangsnes Nov 16 '22 at 13:53
  • 1
    I am very confused by your update - how does $\phi(0)=0$ relate to the equation you show at the top? Where do the $f_1,f_2,...$ come from? What is $A$? – Lukas Lang Nov 16 '22 at 14:14
  • 1
    Please keep it simple and go back to the original version of your question. You introduced new symbols ($a$ and $f$ and $A$) and a new topic (iteration) and the question is now very confusing. – user293787 Nov 16 '22 at 15:31
  • The question is to find an approximation to the solution of that integral equation using those conditions. f and A are respectively the approximated solutions, and the Fredholm operator. a is not added to the question anywhere I can see. – Vangsnes Nov 16 '22 at 15:35
  • 1
    Using: https://math.stackexchange.com/questions/4577945/how-to-solve-a-fredholm-equation-with-known-lambda we have: DSolve[f[x] + 3 Sin[x] + 8 \[Lambda] f[x] Sin[(5 x)/2] + 4 f''[x] == 4 \[Lambda] Cos[(5 x)/2] f'[x], f[x], x],but Mathematica can't solve. Maple can solve gives solution by define integral with HeunC function,but can be found a closed-form solution – Mariusz Iwaniuk Nov 16 '22 at 16:18
  • @MariuszIwaniuk . I update the question with the text which describes this, perhaps better than I did. – Vangsnes Nov 16 '22 at 16:41

1 Answers1

5

The goal is to solve $$f(x) = \sin x + \lambda \int_0^x \cos(x/2-3y) f(y) dy$$

One can solve this by rewriting it as a differential equation. Define $$u(x) = \int_0^x \cos(x/2-3y) f(y) dy$$ $$v(x) = \int_0^x \sin(x/2-3y) f(y) dy$$ They satisfy the following initial value problem:

eq = {
       u'[x]==Cos[5*x/2]*(Sin[x]+lambda*u[x])-1/2*v[x],
       v'[x]==-Sin[5*x/2]*(Sin[x]+lambda*u[x])+1/2*u[x],
       u[0]==0,
       v[0]==0
};

This computes the solution $f(x) = \sin x + \lambda u(x)$ numerically:

solvef[lambdaval_,xmax_] := Block[{lambda=lambdaval},
    Sin[x]+lambda*u[x] /. NDSolve[eq,{u,v},{x,0,xmax}][[1]]];

Plot:

With[{xmax=Pi/2,lambdas=Range[-1,4,0.7]},
  With[{sols=Table[solvef[lambda,xmax],{lambda,lambdas}]},
    Plot[sols,{x,0,xmax},PlotLabels->Map["\[Lambda]="<>ToString[#]&,lambdas],
         AxesLabel->{"x","f(x)"}]]]

enter image description here

user293787
  • 11,833
  • 10
  • 28
  • Thanks , I will study your solution in detail tomorrow! – Vangsnes Nov 16 '22 at 18:06
  • PS link to the Picard soln https://www.mathematica-journal.com/2016/02/27/exact-and-approximate-solutions-of-the-abel%e2%80%93volterra-equations/ – Vangsnes Nov 16 '22 at 19:56