Any suggestion would be greatly appreciated -> I paste my code below which I used to use before.
% add ATP demand reaction to your model
model = addReaction(model, 'ATP_objective', 'atp + h2o --> adp + h + pi')
%Change objective function to ATP maximization
model=changeObjective(model, model.rxns, 0);
model=changeObjective(model, 'ATP_objective',1);
sol=optimizeCbModel(model, 'max');
>>I guess we can introduce an ATP maintenance reaction by computing for all the reactions that produce and consume ATP and then maximize it, I am not sure though but that's how we go about max ATP globally unless until asked otherwise. -> you can alternatively add a consumption reaction for ATP exactly as Vashishtrv mentioned;
model = addReaction(model, 'ATP_objective', 'ATP --> ')
again, I am not sure about the biological significance of using ATP maximization as the objective function :S
Good luck
yours,
Alyaa