Skip to content

Commit

Permalink
Try refining scaling more
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusHolly committed Jan 14, 2025
1 parent 0c4493a commit fde1c01
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ def main(bio_P=False, has_scalers=True):
dt.display_variables_at_or_outside_bounds()
dt.display_variables_with_extreme_jacobians()
dt.display_constraints_with_extreme_jacobians()
print("---SVD---")
svd = dt.prepare_svd_toolbox()
svd.display_underdetermined_variables_and_constraints()

return m, results

Expand Down Expand Up @@ -590,6 +593,9 @@ def scale_system(m, bio_P=False, has_scalers=True):
# sb.set_variable_scaling_factor(m.fs.AD.vapor_phase[0].pressure, 1e-5, overwrite=True)
# sb.set_variable_scaling_factor(m.fs.AD.volume_AD[0], 1e-3)
# sb.set_variable_scaling_factor(m.fs.AD.KH_ch4[0], 1e3)
sb.set_variable_scaling_factor(
m.fs.AD.liquid_phase.properties_in[0.0].flow_vol, 1e3, overwrite=True
)
sb.set_variable_scaling_factor(
m.fs.AD.KH_h2[0], 1e4
) # This should be uncommented for now - start adding additional scaling
Expand Down Expand Up @@ -702,10 +708,18 @@ def scale_system(m, bio_P=False, has_scalers=True):
# overwrite=True,
# )

# for c in m.fs.component_data_objects(pyo.Constraint, descend_into=True):
# if "eq_flow_vol_rule" in c.name:
# csb.scale_constraint_by_nominal_value(
# c,
# scheme=ConstraintScalingScheme.inverseRSS,
# overwrite=True,
# )

# for c in m.fs.component_data_objects(pyo.Constraint, descend_into=True):
# csb.scale_constraint_by_nominal_value(
# c,
# scheme=ConstraintScalingScheme.harmonicMean,
# scheme=ConstraintScalingScheme.inverseMaximum,
# overwrite=True,
# )

Expand Down

0 comments on commit fde1c01

Please sign in to comment.