From a479f07dc7162c33dcf8129a339d493f02a708ac Mon Sep 17 00:00:00 2001 From: Ian Bell <ian.bell@nist.gov> Date: Wed, 2 Aug 2023 09:39:36 -0400 Subject: [PATCH] Fix multiprecision VLE example --- src/test_mpderivs.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/test_mpderivs.cpp b/src/test_mpderivs.cpp index 9599a80..af9ddfc 100644 --- a/src/test_mpderivs.cpp +++ b/src/test_mpderivs.cpp @@ -17,8 +17,11 @@ int main() { // Get the already very accurate values from the superancillary equation auto [rhoLdbl, rhoVdbl] = modelPR.superanc_rhoLV(125); - // Now iterate in extended precision to find the VLE solution - my_float T = 125; - auto soln = teqp::pure_VLE_T<decltype(modelPR), my_float, teqp::ADBackends::multicomplex>(modelPR, T, static_cast<my_float>(rhoLdbl), static_cast<my_float>(rhoVdbl), 20).cast<double>(); + // Now iterate in extended precision with the multicomplex backend to find the VLE solution + my_float T = 125, rhoL = rhoLdbl, rhoV = rhoVdbl; + + teqp::IsothermPureVLEResiduals<decltype(modelPR), my_float, teqp::ADBackends::multicomplex> residual(modelPR, T); + auto soln = teqp::do_pure_VLE_T<decltype(residual), my_float>(residual, rhoL, rhoV, 10).cast<double>(); + std::cout << soln << std::endl; -} \ No newline at end of file +} -- GitLab