BioSTEAMDevelopmentGroup / BLocS

BioSTEAM Location-Specific Evaluation
Other
4 stars 1 forks source link

Bug with state specific evaluation of cornstover biorefinery #8

Closed daltonwstewart closed 2 years ago

daltonwstewart commented 2 years ago

Hi @yoelcortes

I'm having an issue we've run into before with the TEA not being able to determine the MESP. This time it's only occuring when using evaluate_SS for the cornstover biorefinery. Here's the error message:

Traceback (most recent call last):

Input In [3] in <cell line: 1> evaluate_SS('cornstover',10)

File ~/Dropbox/Stewart-Guest_Shared/Code/BLocS/blocs/incentives/evaluation.py:500 in evaluate_SS model.evaluate(**evaluate_args('SS'))

File ~/Dropbox/Stewart-Guest_Shared/Code/biosteam/biosteam/evaluation/_model.py:432 in evaluate values[i] = evaluate(samples[i], **dyn_sim_kwargs)

File ~/Dropbox/Stewart-Guest_Shared/Code/biosteam/biosteam/evaluation/_model.py:463 in _evaluate_sample values = self._exception_hook(new_exception, sample)

File ~/Dropbox/Stewart-Guest_Shared/Code/biosteam/biosteam/evaluation/_model.py:106 in raise_exception def raise_exception(exception, sample): raise exception

File ~/Dropbox/Stewart-Guest_Shared/Code/biosteam/biosteam/evaluation/_model.py:460 in _evaluate_sample return [i() for i in self.metrics]

File ~/Dropbox/Stewart-Guest_Shared/Code/biosteam/biosteam/evaluation/_model.py:460 in return [i() for i in self.metrics]

File ~/Dropbox/Stewart-Guest_Shared/Code/biosteam/biosteam/evaluation/_metric.py:39 in call self.cache = self.getter()

File ~/Dropbox/Stewart-Guest_Shared/Code/BLocS/blocs/incentives/evaluation.py:314 in MFSP_baseline MFSP = 2.98668849 * tea.solve_price(tea.ethanol_product)

File ~/Dropbox/Stewart-Guest_Shared/Code/biosteam/biosteam/_tea.py:920 in solve_price sales = self.solve_sales()

File ~/Dropbox/Stewart-Guest_Shared/Code/biosteam/biosteam/_tea.py:957 in solve_sales if x0 == 0: raise e from None

File ~/Dropbox/Stewart-Guest_Shared/Code/biosteam/biosteam/_tea.py:954 in solve_sales sales = flx.aitken_secant(f, x0, x1, xtol=10, ytol=1000.,

File /opt/anaconda3/lib/python3.9/site-packages/flexsolve/open_solvers.py:85 in aitken_secant if checkroot or checkiter: utils.raise_tol_error()

File /opt/anaconda3/lib/python3.9/site-packages/flexsolve/utils.py:200 in raise_tol_error raise RuntimeError('minimum tolerance reached; root could not be solved')

RuntimeError: minimum tolerance reached; root could not be solved)

Can you take a look and see if we can fix it? Thank you. Dalton

yoelcortes commented 2 years ago

Fixed! Please pull the latest versions of Bioindustrial-Park, BioSTEAM, and thermosteam.

Thanks!