Im interested in running a basic cake eating problem in sage. In its recursive formulation we have to solve the following bellman equations: v(kt)=ln(kt−kt+1)+βv(kt+1), β∈(0,1) The algorithm for solving this problem is as follows:
Step 1: Take an initial guess of v(kt+1)=0
Step 2: Solve for the maximum of v(kt) (in the first iteration this is v(kt)=ln(kt−kt+1))
Step 3: Using our maximum for v(kt) iterate it forward and update our bellman (in this case we have v(kt)=ln(kt−kt+1)+β[ln(kt+1−kt+2)])
Step 4: Maximize this updated equation and repeat until convergence.
Any help is appreciated.