Fourth Version

Actually the program was working. The final value function seems to be
increasing in both dimensions (foreign assets and capital) though it
might be better checked with a 3D graph. It also appears concave for
capital (it can be checked by increasing the lenght of the grid - for
instance put kmax to 5).
Now we need to do the simulations and solve the problem for different
calibrations.