I have been struggling lately with solving numerically an equation of the form:

$$ g(x\pm x_{0}) = F[ g(x) ] $$

where $g(x)$ is a matrix satisfying the condition $g(x\to\pm\infty)=0$. My question is on how does one solve this recursively. I am running over some predefined sets $S=\{x_{n}\}_{n=1}^{N}$ of arguments where the function is supposed to be evaluated, so ideally the algorithm should run over a loop that yields: $$g(x_{1}\pm x_{0})$$ $$g(x_{2}\pm x_{0})$$ $$ \vdots$$ $$g(x_{N}\pm x_{0})$$

in this order with $x_{1}<x_{2}< ... <x_{N}$ for $x<0$ $\forall x\in S$ and $x_{1}>x_{2}> ... >x_{N}$ for $x>0$ $\forall x\in S$. Any help would be greatly appreciated thanks!

Edit: For clarity, consider the example:

$$A(x-x_{0})=B(x) + C(x)A(x)D(x)$$ and we know $A(x\to\infty)=0$ and B,C,D are matrices that also depend on $x$.

More of an example:

Let's say I start with a value $ x = -a<0$. My desired goal is to calculate a matrix product for that specific value of x that has the form $$ M(x) = inv( D(x) + T(x)g_{1}(x - x_{0})C(x) + S(x)g_{2}(x+x_{0})P(x) ) $$ where all quantities are matrices but the only unknown ones are $g_{1},g_{2}$. Note that $g_{1},g_{2}$ represent two different matrices. Now, what we know about these matrices is that they satisfy $g_{1,2}(x \to \pm \infty) = 0$. And, additionally, the recursion relation of each of them ( $g_{1} $ and $g_{2}$) has the form written in the edit. More specifically:

$$g_{1}(x-x_{0}) = H( g_{1}(x) )$$ $$ g_{2}(x+x_{0}) = H(g_{2}(x))$$

and both need to be evaluated for that specific value of $x=-a$. My question is on how to do that, since eventually, I want to do it not only for $x=-a<0$, but for an entire grid of $\{x\}$ that includes both positive and negative values.

notwhat you were looking for? But then your "for clarity" edit writes exactly the same kind of equation as I wrote. There's still something not very clear about the question. What is known (the input to the problem) and what is unknown (the desired output) about $g(x)$? $\endgroup$ – Igor Khavkine May 6 at 19:24underdetermined, unless their values are known on some interval of width $x_0$. It seems that you want to fix that underdeterminacy by the boundary conditions $g_{1,2}(x\to\pm \infty) = 0$. That might work, but it means that you need to solve the recurrence relation on the entire real line (or at least an infinite sub-grid) before being able to determine the value of $g_{1,2}(x)$ at any given $x$. So there is no algorithm that will give you the solution that involves only finitely many points $\{x_n\}_{n=1}^N$. $\endgroup$ – Igor Khavkine May 7 at 10:43