Skip to content

Commit

Permalink
expose rtol
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMVale committed Apr 28, 2024
1 parent a8abcba commit 2ad7452
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/polykin/copolymerization/multicomponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ def inst_copolymer_multi(f: Optional[FloatVectorLike],
def monomer_drift_multi(f0: FloatVectorLike,
x: FloatVectorLike,
r: FloatSquareMatrix,
atol: float = 1e-4
atol: float = 1e-4,
rtol: float = 1e-4
) -> FloatMatrix:
r"""Compute the monomer composition drift for a multicomponent system.
Expand All @@ -259,6 +260,8 @@ def monomer_drift_multi(f0: FloatVectorLike,
Matrix of reactivity ratios, $r_{ij}=k_{ii}/k_{ij}$.
atol : float
Absolute tolerance of the ODE solver.
rtol : float
Relative tolerance of the ODE solver.
Returns
-------
Expand Down Expand Up @@ -312,7 +315,7 @@ def dfdx(x: float, f: FloatVector) -> FloatVector:
y0=f0[:-1],
t_eval=x,
atol=atol,
rtol=1e-4,
rtol=rtol,
method='LSODA')

if sol.success:
Expand Down

0 comments on commit 2ad7452

Please sign in to comment.