Consider the convergent sequence of functions of $t$, $\left\lbrace f_{n}\left(t\right)\right\rbrace_{n\geq 0}$, where $f_0\left(t\right) = 1$, $\forall t\in\left[0,T\right]$ and $$ f_{n+1}\left(t\right) = g\left(\int_{t}^{T} f_{n}\left(s\right) ds\right), $$ where $g\left(\cdot\right)$ is some real-valued function that we for now can neglect, i.e. $g\left(\cdot\right) = \left(\cdot\right)$.
How is it possible to solve this kind of problem with Matlab? Say, we want to find the function $f_{10}\left(t\right)$?
So far I've tried various different symbolic methods, since I don't know how a numerical integration is performed when the functions parameter is one of the integral bounds. It gets messy.
I know that this can be done with Matlab, but I really can't see how. Please help me, I've been stuck with this for weeks.
Edit: Differentiation is not an option since in the specific case I'm interested in, $g$ is an exponential function.
Assume that we have a grid of linearly spaced points $\vec{s} = [0, h, 2h, ..., T]$. Assuming that you have some value for $\vec{f_n}(\vec{s}) = [f_n(0), f_n(h), f_n(2h), ..., f_n(T)]$, a basic numerical integration from $Nh$ to $T$ is given by a simple sum from the $N^{th}$ element to the end multiplied by the stepsize. Since you can evaluate the integral, you can get $f_{n+1}$ from it.
A base implementation in MATLAB would look like :
s = linspace(0, T); fprev = ones(size(s)); fnext = zeros(size(s)); nmax = 10; for iteration = 1 : nmax fprev(end) = fprev(end) / 2; for index in 1 : length(fnext) - 1 fprev(index) = fprev(index)/2; fnext(index) = g(sum(fprev(index:end)) * (s(2)-s(1))); end fnext(end) = g(0); fprev = fnext; endNote the corrections at the edges due to half the step at that point in the quadrature scheme.