2
$\begingroup$

I am trying to study the convergence of a function that is defined by recursion. We want to find for which 'j' the difference between $ g_i^j $ and $ g_i^{j+1} $ is equal or smaller than $10^{-3}$ .

I don’t know how to do that, can we use FixedPoint for a function of two variables ? Or we necessarily have to use the loop While? Thanks

Clear[f, g]
f[x_] := x^2;
g[i_Integer, 1] := g[i, 1] = f[i];
g[50, _] = g[0, _] = 0; (*initial and final condition*)
g[i_Integer, j_Integer] := g[i, j] = Max[0.5*(g[i - 1, j] + g[i + 1, j - 1]), f[i]];

I defined the function Gap for the difference of the two values as

Gap[i_,j_]:=Gap[i,j]=g[i,j+1]-g[i,j] ;
$\endgroup$
  • $\begingroup$ I need a little more info. (1) Do you want to find for which j the difference between two successive g's is less than $10^{-3}$ for all i or for some i? (2) There are two inputs to g so how do you define the recursion? it is a recursion in i or a recursion on j or both? (It actually looks like there's backwards and forwards recursion on i somehow.) $\endgroup$ – march Nov 28 '15 at 23:06
  • $\begingroup$ It says to repeat the scan as many time as necessary so that all gaps between two successive values $g^j_i $ and $g^{j+1}_i$ is equal or smaller than $10^{-3}$ , so it is for all i. And for the recursion we see in the expression of $g$ that is in $i$ and $j$ $\endgroup$ – user35952 Nov 29 '15 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.