Skip to content

Commit

Permalink
Updated bound within curve fit
Browse files Browse the repository at this point in the history
Updated the minimum bound on dt to be -min(self.D_time[filename]) instead of 0. It can't be any less than this, though, or we risk the exponential turning positive, which would cause problems.
  • Loading branch information
GeorgeEvans0 authored Nov 5, 2022
1 parent 2a99f17 commit e4dbccd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion HyPAT/source_code/permeation_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ def f(xdata, D, dt, A):
try:
if not skipD: # If not skipping the calculation of D
popt, pcov = curve_fit(f, self.D_time[filename], self.lhs[filename], p0=[D, 0, 1], xtol=D * 1e-3,
bounds=([0, 0, -1000], [10, 10*h, 1000]))
bounds=([0, -min(self.D_time[filename]), -1000], [10, 10*h, 1000]))
else:
NaN = float("NaN")
popt = [NaN, NaN, NaN]
Expand Down

0 comments on commit e4dbccd

Please sign in to comment.