Giter Club home page Giter Club logo

Comments (2)

longemen3000 avatar longemen3000 commented on June 30, 2024

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.

longemen3000 avatar longemen3000 commented on June 30, 2024

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 combining
  • elliott 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.