2
$\begingroup$

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

$\endgroup$
11
  • 1
    $\begingroup$ 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) $\endgroup$
    – Lukas Lang
    Commented Nov 16, 2022 at 12:59
  • $\begingroup$ 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. $\endgroup$ Commented Nov 16, 2022 at 13:05
  • 1
    $\begingroup$ 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$? $\endgroup$
    – Lukas Lang
    Commented Nov 16, 2022 at 14:14
  • 1
    $\begingroup$ 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. $\endgroup$
    – user293787
    Commented Nov 16, 2022 at 15:31
  • 1
    $\begingroup$ Using: math.stackexchange.com/questions/4577945/… 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 $\endgroup$ Commented Nov 16, 2022 at 16:18

1 Answer 1

5
$\begingroup$

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

$\endgroup$
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.