Expected behavior.
Hi,
I’m currently checking out the capabilities of the Fractionator object within CADET-Process.
I’m working with a model where the first component is Salt, but it does not really make much sense to include that component in the fraction analysis. I tried to exclude the component ‘Salt’ by which I got the plots with peaks fractionated. But in results, I couldn’t get any other output data(like recovery, productivity etc.)
Actual behavior
Instead, what I got looks something like this:
Performance(mass=array([5.69060987e-07, 2.78445789e-07, 4.62579920e-07]),concentration=array([0.01121847, 0.03779179, 0.0114423 ]), purity=array([0.95160093, 0.94969219, 0.95000652]), recovery=array([1.79769313e+308, 1.79769313e+308, 1.79769313e+308]),productivity=array([0.00041074, 0.00020098, 0.00033389]), eluent_consumption=array([inf, inf, inf]) mass_balance_difference=array([6.01536496e-07, 6.01536588e-07, 6.01536665e-07]))
with error:
RuntimeWarning: divide by zero encountered in dividereturn self.mass / self.process.V_eluentC:\Users\modia\anaconda3\envs\cadet-env\lib\site-packages\CADETProcess\fractionation\fractionator.py:560: RuntimeWarning: divide by zero encountered in dividereturn self.mass / self.process.V_eluent
How to produce bug (including a minimal reproducible example)
I did found a similar forum, in which the person was using similar code to remove component, but I wasn’t able to debug divide_by_zero error.
I used a similar method by adding the components flag to the init of the FractionationOptimizer:
fractionator = fractionation_optimizer.optimize_fractionation(
simulation_results, components=[‘A’, ‘B’, ‘C’], purity_required=[0.95, 0.95, 0.95]
)