Skip to content
Snippets Groups Projects
Commit d2d0de9d authored by Peter Schubert's avatar Peter Schubert
Browse files

Report Density Constraint, Calculate degrees of freedom

parent 5ee09d74
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,8 @@ class GbaProblem:
# calculate stoichiometric sub-matrices and scale them according to volume
# TODO: sparce matrix storage and calculations
specis_x_mrs = self.get_stoic_matrix(self.var_sids, self.mr_rids)
self.dof = specis_x_mrs.shape[1] - np.linalg.matrix_rank(specis_x_mrs)
metab_x_mrs = self.get_stoic_matrix(self.var_metab_sids, self.mr_rids)
self.metab_x_psrs = self.get_stoic_matrix(self.var_metab_sids, self.ps_rids)
self.enz_x_mrs = self.get_stoic_matrix(self.var_enz_sids, self.mr_rids)
......
......@@ -81,4 +81,5 @@ class GbaIpoptProblem:
self.nit = iter_count
if self.report_freq > 0:
if iter_count % self.report_freq == 0:
print(f'[{iter_count:5d}] growth rate: {-3600 *obj_value:.5f}')
print(f'[{iter_count:5d}] growth rate: {-3600 *obj_value:.5f}, '
f"density constr: {self.gba_problem.last_values['heq_density'][1]}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment