Comments (2)
This is written mainly as future reference for anyone interested on how we solve our association
reading 3. we do perform that exact index reduction, but we take a step further: we fuse z[IJ] and ΔIJ (in their [IJ] notation) into one sparse matrix A[IJ]. their proposed iteration is equivalent to ours when dampingfactor = 0.5
but we could use their initial point. we can actually obtain their KIJ matrix by:
julia> model = PCSAFT(["water","methanol"])
PCSAFT{BasicIdeal} with 2 components:
"water"
"methanol"
Contains parameters: Mw, segment, sigma, epsilon, epsilon_assoc, bondvol
julia> iszero.(Clapeyron.assoc_site_matrix(model,0.03,373.15,[0.5,0.5]))
4×4 SparseArrays.SparseMatrixCSC{Bool, Int64} with 16 stored entries:
1 0 1 1
0 1 1 1
1 1 1 0
1 1 0 1
Note here the `SparseMatrixCSC` type. we only store the non empty values.
The only difference between their algorithm and ourds
All approaches that try to solve association as a fixed iteration problem can be written as:
A*Y⊙Y + Y - 1 = ∅
where ⊙ is the hadamard product between A[I,J]*Y[i] and Y[I]. the fixed point iteration used can be obtained by solving for Y. this is, at the same time, one general case of a quadratic matrix equation:
Mx = a + b(x,x)
where b
is a bilinear form, and M
in our case is -I
. this general form is discussed here (10.1016/j.laa.2011.05.036)(https://doi.org/10.1016/j.laa.2011.05.036) and proposes some alternative iteration methods.
On the optimization approaches, the main roadblock is the allocation of all caches and inverting matrices. it seems that inverting a matrix is a heavy operation, compared to repeated multiplications. on some preliminar tests. if this allocation and solving is done inline (that is, on each eos
call) it takes around 5x more time. work in a "inline cached eos" for routines at fixed T,z could help here, but one has to be careful if threads are used.
from clapeyron.jl.
One thing that is complex under our association solver was adding combining rules. a combining rule means a dense matrix of reduced indices, or at least, denser that what gains can be obtained with using an sparse matrix. Because of that, the new combining::Symbol
keyword was added to AssocOptions
.
sparse_nocombining
: the default. creates an sparse matrix.sparse_nocombining
: new option. instantiates a dense matrix, but still no combiningelliott
Combining rule.
we use the general definition of the elliott combining rule:
Δ(i,j,a,b) = √(Δ(i,i,a,b)*Δ(j,j,a,b))
instead on the more EoS-specific values. (CPA and SAFT have different expressions for the mixing rules of the association energy, but they reduce to the equation above).
At the moment, if one term is associating and the other is not, we default to zero. this could be explored further in the future.
this work was made as a byproduct of tackling #75
from clapeyron.jl.
Related Issues (20)
- Parameter Estimation for sle_solubility HOT 14
- UNIFAC ether and aldehyde groups error HOT 3
- Defining a custom alpha HOT 2
- COFFEE equation of state
- EOS-CG 2021 HOT 7
- user defined eos HOT 2
- Induced-Association Interactions in SAFT HOT 16
- Saturation solves fail moving from 0.5.7 to 0.5.8 HOT 4
- Move CPA input to use SI values
- Units of property functions HOT 8
- Help with modelling activity coefficients in UNIFAC HOT 3
- Wrong conversion of parameters for water in CPA HOT 10
- Installation problems with precompilation (`Setfield` not defined) HOT 4
- Surprising default combining rule in association term HOT 3
- Evaluation of CPA at too high a density yields no error, just NaN HOT 4
- Possible issue with bubble and dew point estimation (or SAFT-gamma Mie) HOT 2
- Ask for help with sCPA calculating the molar volume of water HOT 7
- Simple example with activity coefficient model and antoine parameters for saturation pressure? HOT 3
- modified LKP and LKP-SJT
- Clarification/issue in SoftSAFT implementation HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clapeyron.jl.