@@ -214,6 +214,10 @@ def __init__(
214214 # (i.e., no model rebuilding for large models with sequential)
215215 self ._built_scenarios = False
216216
217+ # Minimum step size for finite difference perturbations
218+ # This is important if a parameter has a value of 0
219+ self .min_step_size = 1e-6
220+
217221 # Perform doe
218222 def run_doe (self , model = None , results_file = None ):
219223 """
@@ -575,7 +579,7 @@ def _sequential_FIM(self, model=None):
575579 # Loop over parameter values and grab correct columns for finite difference calculation
576580
577581 for k , v in model .unknown_parameters .items ():
578- curr_step = v * self .step
582+ curr_step = max ( v * self .step , self . min_step_size )
579583
580584 if self .fd_formula == FiniteDifferenceStep .central :
581585 col_1 = 2 * i
@@ -864,6 +868,8 @@ def jacobian_rule(m, n, p):
864868 param = m .parameter_scenarios [max (s1 , s2 )]
865869 param_loc = pyo .ComponentUID (param ).find_component_on (m .scenario_blocks [0 ])
866870 param_val = m .scenario_blocks [0 ].unknown_parameters [param_loc ]
871+
872+ # How does this change if we enforce the minimum step size?
867873 param_diff = param_val * fd_step_mult * self .step
868874
869875 if self .scale_nominal_param_value :
0 commit comments