Skip to content

Commit

Permalink
updates README
Browse files Browse the repository at this point in the history
  • Loading branch information
mtod92 committed Dec 22, 2023
1 parent e46142a commit ab38708
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Binary file modified Figures/example_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,4 @@ function values = solve_(K, H2Otot, NH3tot)
Which provides a time of ~31 ms, with equpy giving more than a 15x enhancement.

# Considerations on performance
It is worth noting how a simple MATLAB implementation of equpy (see MATLAB folder) allows to solve the problem in 0.19 ms, for an extra 10x boost in execution time. Running the python implementation here presented from terminal allows for a reduction of execution time both for equpy and chempy of ~30%. It would not be suprising for a simple implementation of the Python algorithm relying on numba or cython to execute in a time comparable or faster than MATLAB.
While we focused here on benchmarking performance of the approach by Thomas Wayne Wall, it is worth noting how more important than the absolute time is the relative enhancement with respect to more general solvers. A simple MATLAB implementation of equpy (see MATLAB folder) allows to solve the problem in 0.19 ms, for an extra 10x boost in execution time. Running the python implementation here presented from terminal allows for a reduction of execution time both for equpy and chempy of ~30%. It would not be suprising for a simple implementation of the Python algorithm relying on numba or cython to execute in a time comparable or faster than MATLAB.
6 changes: 3 additions & 3 deletions equpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ def solve(
"""

def plotter(self):
f, (ax1, ax2) = plt.subplots(1, 2, sharey=False, figsize=(15, 5))
ax1.plot(np.arange(len(self.residuals)), self.residuals, lw=3, color="black")
f, (ax1, ax2) = plt.subplots(1, 2, sharey=False, figsize=(10, 4.5))
ax1.plot(np.arange(len(self.residuals)), self.residuals, lw=5, color="black")
ax1.scatter(
np.arange(len(self.residuals)), self.residuals, s=120, color="black"
np.arange(len(self.residuals)), self.residuals, s=150, color="black"
)

ax1.set_xlabel("steps", fontsize=14, fontname="Arial")
Expand Down
Loading

0 comments on commit ab38708

Please sign in to comment.