diff --git a/include/teqp/algorithms/critical_tracing.hpp b/include/teqp/algorithms/critical_tracing.hpp index b2a41efa15cb8a69c0ae502271c054c5ebc1cef8..3cdf04429c33b529dc244568f35152a8251f9c52 100644 --- a/include/teqp/algorithms/critical_tracing.hpp +++ b/include/teqp/algorithms/critical_tracing.hpp @@ -765,6 +765,15 @@ struct CriticalTracing { return JSONdata; } + /** + * \brief Calculate dp/dT along the critical locus at given T, rhovec + */ + static auto get_dp_dT_crit(const Model& model, const Scalar& T, const VecType& rhovec) { + using id = IsochoricDerivatives<Model, Scalar, VecType>; + auto dpdrhovec = id::get_dpdrhovec_constT(model, T, rhovec); + return id::get_dpdT_constrhovec(model, T, rhovec) + (dpdrhovec.matrix() * get_drhovec_dT_crit(model, T, rhovec).matrix()).array(); + } + }; // namespace VecType }; // namespace teqp \ No newline at end of file diff --git a/interface/pybind11_wrapper.hpp b/interface/pybind11_wrapper.hpp index bbdc155037cb460197f3f2bdcd04eebbf532b371..1e49bc12c2e168cd4993469dc640ff98bbee2688 100644 --- a/interface/pybind11_wrapper.hpp +++ b/interface/pybind11_wrapper.hpp @@ -72,6 +72,7 @@ void add_derivatives(py::module &m, Wrapper &cls) { cls.def("eigen_problem", &ct::eigen_problem); cls.def("get_minimum_eigenvalue_Psi_Hessian", &ct::get_minimum_eigenvalue_Psi_Hessian); cls.def("get_drhovec_dT_crit", &ct::get_drhovec_dT_crit); + cls.def("get_dp_dT_crit", &ct::get_dp_dT_crit); cls.def("extrapolate_from_critical", &extrapolate_from_critical<Model, double>); cls.def("pure_VLE_T", &pure_VLE_T<Model, double>);