As shown in [7], optimal control problems with either ODE or PDE dynamics can be solved efficiently using a setting of consistent approximations obtained by numerical discretization of the dynamics together with master algorithms that adaptively adjust the precision of discretization (in an outer loop) and call finite dimensional optimization algorithms as subroutines (in an inner loop). An important fact overlooked in [7] is that in many discretized optimal control problems both the value and the gradient of the cost function cannot be computed exactly because they involve the solution of a large linear or nonlinear system at some stage. As a result, the master algorithms presented in [7] cannot be implemented efficiently for such problems. In [7] we find also a master algorithm for solving finite dimensional optimization problems when both the cost function value and its gradient can only be computed approximately. In this paper we present a new master algorithm model that combines ...