You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at the moment, due to how we define functions and the fact that our models need to support ForwardDiff.jl, we have the ability, in theory, to generate fully symbolic versions of an EoS. for a proof of concept, this can be done (if we remove the NaN-safe protections):
using Clapeyron, Symbolics
model = UNIFAC(["water","ethanol"])
@variables v0 T0, x1, x2
x = [x1,x2]
Ge = Clapeyron.excess_gibbs_free_energy(model,v0,T0,x)
dGe = Symbolics.gradient(Ge,x)
act = Symbolics.simplify(exp.(dGe) ./(Clapeyron.R̄ * T0))
that gives the expression for the activity coefficient in terms of T0 and x (v0 is ignored).
In practice, we need additional support to make that a seamless experience. my vision is that: Clapeyron.activity_coefficient(model,v,T,z) just works and returns the expression above. for that, we would need:
Register nan-safe functions (and its derivatives) (tier 0: support primal functions)
Register the differentials so they return symbolic derivatives instead of ForwardDiff ones (tier 1:support bulk properties)
i don't know if we can/should support higher tiers. any commentary about that it is appreciated
The text was updated successfully, but these errors were encountered:
at the moment, due to how we define functions and the fact that our models need to support ForwardDiff.jl, we have the ability, in theory, to generate fully symbolic versions of an EoS. for a proof of concept, this can be done (if we remove the NaN-safe protections):
that gives the expression for the activity coefficient in terms of T0 and x (v0 is ignored).
In practice, we need additional support to make that a seamless experience. my vision is that:
Clapeyron.activity_coefficient(model,v,T,z)
just works and returns the expression above. for that, we would need:i don't know if we can/should support higher tiers. any commentary about that it is appreciated
The text was updated successfully, but these errors were encountered: