0001 function res = cba_economic_quantities(network, c_opt, u_opt, cba_constraints)
0002
0003
0004
0005
0006
0007
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;