Git Product home page Git Product logo

Comments (2)

dstansby avatar dstansby commented on September 23, 2024

Is this issue referring to this code:

fiasco/fiasco/ion.py

Lines 347 to 354 in cd89e7c

# Invert matrix
val, vec = np.linalg.eig(c_matrix.value)
# Eigenvectors with eigenvalues closest to zero are the solutions to the homogeneous
# system of linear equations
# NOTE: Sometimes eigenvalues may have complex component due to numerical stability.
# We will take only the real component as our rate matrix is purely real
i_min = np.argmin(np.fabs(np.real(val)), axis=1)
pop = np.take(np.real(vec), i_min, axis=2)[range(vec.shape[0]), :, range(vec.shape[0])]
?

from fiasco.

wtbarnes avatar wtbarnes commented on September 23, 2024

Well I was actually thinking of the ionization equilibrium calculation in Element,

fiasco/fiasco/element.py

Lines 93 to 102 in cd89e7c

rate_matrix = kwargs.get('rate_matrix', None)
if rate_matrix is None:
rate_matrix = self._rate_matrix()
# Solve system of equations using singular value decomposition
_, _, V = np.linalg.svd(rate_matrix.value)
# Select columns of V with smallest eigenvalues (returned in descending order)
# NOTE: must take the absolute value as the SVD solution is only accurate up
# to the sign. We require that the solutions must be positive.
ioneq = np.fabs(V[:, -1, :])
ioneq /= ioneq.sum(axis=1)[:, np.newaxis]

Though it may also apply to the level populations calculation as well.

from fiasco.

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.