function p=fixedpoint(g,p0,tol,max_iterations) % Fixed point iteration: See section 2.2. for i=1:max_iterations % Store the previous iteration in p0. p=g(p0); if abs(p-p0)