22 #include <boost/core/explicit_operator_bool.hpp>
24 #include <boost/exception/exception.hpp>
26 #include <boost/format/alt_sstream.hpp>
27 #include <boost/format/alt_sstream_impl.hpp>
28 #include <boost/optional/optional.hpp>
29 #include <boost/exception/diagnostic_information.hpp>
30 #include <boost/math/tools/toms748_solve.hpp>
45 double rho_aqua,
double scale_aqua,
double scale_sorbed,
46 double c_aqua_limit,
double mult_coef,
double second_coef)
80 c_sorbed=result.
solid;
96 c_sorbed=result.
solid;
105 THROW( Isotherm::ExcNegativeTotalMass()
106 << EI_TotalMass(total_mass)
110 unsigned int total_mass_idx =
static_cast <unsigned int>(std::floor(total_mass_steps));
144 if (total_mass > mass_limit){
149 mass_limit = total_mass;
152 double upper_solution_bound = mass_limit /
scale_aqua_;
154 std::pair<double,double> solution;
158 boost::uintmax_t max_iter = 20;
160 solution = boost::math::tools::toms748_solve(eq_func, 0.0, upper_solution_bound, toler, max_iter);
162 catch(boost::exception
const & e)
164 THROW( Isotherm::ExcBoostSolver()
165 << EI_BoostMessage(boost::diagnostic_information(e))
170 difference = (solution.second - solution.first)/2;
171 double c_aqua = solution.first + difference;
228 THROW( Isotherm::ExcNegativeTotalMass()
229 << EI_TotalMass(mass_limit)
235 for(
int i=0; i<= n_steps; i++) {