Home > metabolic-economics > metabolic-economics-utils > cba_economic_quantities.m

cba_economic_quantities

PURPOSE ^

CBA_METABOLITE_AND_ENZYME_PRICES - Convenience function for computing economic quantities

SYNOPSIS ^

function res = cba_economic_quantities(network, c_opt, u_opt, cba_constraints)

DESCRIPTION ^

 CBA_METABOLITE_AND_ENZYME_PRICES - Convenience function for computing economic quantities

 res = cba_economic_quantities(network,c_opt,u_opt,cba_constraints)

 convenience function, calls cba_economic_potentials and the respective cost function

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function res = cba_economic_quantities(network, c_opt, u_opt, cba_constraints)
0002 
0003 % CBA_METABOLITE_AND_ENZYME_PRICES - Convenience function for computing economic quantities
0004 %
0005 % res = cba_economic_quantities(network,c_opt,u_opt,cba_constraints)
0006 %
0007 % convenience function, calls cba_economic_potentials and the respective cost function
0008 
0009 u_opt(find(u_opt/max(u_opt)<10^-5)) = 0;
0010 
0011 res.u_opt          = u_opt;
0012 network.kinetics.u = u_opt;
0013 
0014 [nm,nr] = size(network.N);
0015 
0016 if isempty(cba_constraints.zc),
0017   cba_constraints.zc = zeros(nm,1);
0018 end
0019 
0020 [res.wc, v_opt, res.dw_du, dv_du] = cba_economic_potentials(network, c_opt, cba_constraints.zv, cba_constraints.zc, cba_constraints.ind_controllable);
0021 
0022 res.v_opt  = v_opt;
0023 res.f_bene = cba_constraints.zv' * v_opt;
0024 
0025 [res.f_cost, res.f_cost_gradient, res.f_cost_hessian] = feval(cba_constraints.fitness_options.cost_function,u_opt,cba_constraints.fitness_options);
0026 
0027 res.h_hat = res.f_cost_gradient .* u_opt;
0028 res.y     = res.f_cost_gradient .* u_opt ./ v_opt;
0029 
0030 res.w = res.wc;
0031 res.w(find(network.external)) = res.w(find(network.external)) + cba_constraints.z_ext;

Generated on Fri 12-Feb-2016 20:18:22 by m2html © 2003