last day (14 days later) » 

18:24
1
A: Numerically solve an integro-differential equation

Carl WollIf you can convert the integro-differential equation into an IVP or BVP ODE, then that would be the best approach. If you can't do so, then you can try the following iterative approach. The basic idea is to replace the unknown $x(\eta )$ in the integrand with an ansatz (guess), and then solve the...

Thanks for this answer. I think it's more comprehensive since it deals with both transformable and non-transformable cases (xzczd's code didn't work for your 2nd example). I was just wondering if, in your second code block, you forgot the x[1] with the g[ζ] in the line, -ν x'[ζ] + ψ[ζ] x[ζ] + Integrate[f[ζ,η] cur[n-1][η], {η, 0, ζ}] + g[ζ] == 0,
Also, in your case, cur[8][0] or cur[7][0] gives the value of $x(0)$, right?
I think including x[1] in the ODE is an issue, because Mathematica is expecting all args of a function to be the same. If you want to vary x[1], you can add the variable x1 and use x[1] == x1.
Yes, cut[n][0] is the nth estimate of x[0]
I am not having $x(1)$ as a variable but in my original equation, the last term is $g(\zeta)x(1)$, not just $g(\zeta)$, which is what the code above seems to assume. Or am I misunderstanding?
Isn't x[1]==1? If you want to have an initial condition of say x[1] == x1 for some value x1 that isn't 1 then you would change the last term to $g(\zeta) x1$. If you instead use $g(\zeta) x(1)$ then NDSolve will issue messages.
Yeah, in this specific case, $x(1)=1$ but it's also something I'd like to choose. I did what you said and defined x[1] == x1 right after the equation and defined the value of x1 in the very beginning. It works now. Thank you very much.
Just to make sure I get some of the more subtle details of the iterative procedure, the cur[0] = # &; assumes an initial guess of the function $x$ to be $x=\zeta$?
I have to explain the code to someone so I am trying to make sure I know the details :)
18:30
Yes. cur[0] = #& is equivalent to cur[0][z_] := z
So we guess the function x to be x=z as a first guess and substitute it into the original equation?
Then what do we solve for though?
We substitute the guess only into the integral. Then use NDSolve to figure out what the corresponding x is.
OK so just to ensure I got it right, in the simplest case with everything = 1, where we have this, we only let x(eta) = eta and integrate to zeta (get z^2/2) but we leave the x(zeta) in the previous term as is and find x(zeta)? Then we substitute that into the expression for x(eta) and repeat?
So we basically solve -x'+x+z^2/2+1=0 with NDSolve
OK I think I got it now. Thanks a lot :)
Have a great day~

last day (14 days later) »