Skip to content

Commit

Permalink
edited paper
Browse files Browse the repository at this point in the history
  • Loading branch information
mtod92 committed Dec 20, 2023
1 parent 7ae635a commit f58df6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ $$[C]_{tot} = [C] \+ [AB_2C] \label{Eq. 5}$$

We can define a system comprising these equations to be simultaneously solved.
In this system, we can see that chemical equilibria consist of nonlinear functions, meaning that they cannot be expressed as a sum of their variables each raised to the power of one.
`equpy` solves this problem by linearizing these equations to make them suitable to be solved employing linear algebra and an iterative numerical method equivalent to the Newton search of the logarithmic equations over the logarithm of the variables.
`equpy` solves this problem by linearizing these equations to make them suitable to be solved employing linear algebra and an iterative numerical method equivalent to the Newton search of the logarithmic equations over the logarithm of the variables.

# Example
4 changes: 3 additions & 1 deletion paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ W_4\ln[B] + W_5\ln[AB_2] + W_6\ln[AB_2C] = \ln \Bigl\{[B]_{tot}* \Bigl( \frac{W_
W_7\ln[C] + W_8\ln[AB_2C] = \ln \Bigl\{[C]_{tot}* \Bigl( \frac{W_7}{1} \Bigr)^{W_7}*\Bigl(\frac{W_8}{1}\Bigr)^{W_8}\Bigr\}
\end{equation}

With $W_1 ... W_8$ equal to:
With $W_{1...8}$ equal to:
\begin{equation} \nonumber
W_1 = \frac{[A]}{[A]+[AB_2]+[AB_2C]}
\end{equation}
Expand Down Expand Up @@ -193,6 +193,8 @@ K_5 = [C]_{tot}* \Bigl( \frac{W_7}{1} \Bigr)^{W_7}*\Bigl(\frac{W_8}{1}\Bigr)^{W_
And finally put all linearized equations in a matrix form suitable for our implementation, so that the new set of equations in linearized form can be expressed as follows:
![Fig.1 Linear problem expressed in matrix form. \label{fig:1}](Fig1.png)

With **r** being the vector of the residuals, calculated as **r** = **Mx****y**, whose norm can be used to probe the error in the approximate solution. Since $W_{1…8}$, $K_3$, $K_4$ and $K_5$ are functions of our unknown solutions, **M** and **y** must be calculated using an initial guess of **x**, and the system solved for a new vector of solutions that can used for the next iteration until a satisfying result is reached.

# Acknowledgements

M.T. acknowledges the support of HHMI and Jack W. Szostak, the authors would like to thank Aleksandar Radakovic for introducing them to the problem of multiple equilibria at the genesis of this project.
Expand Down

0 comments on commit f58df6e

Please sign in to comment.