-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code for lds test for lyapunov exponents
- Loading branch information
1 parent
b7e961a
commit e79a3b6
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from dysts.base import BaseDyn, staticjit | ||
|
||
class DynSys: | ||
def __init__(self, alpha): | ||
self.alpha = alpha | ||
|
||
def rhs(self, X, t): | ||
"""The right hand side of a dynamical equation""" | ||
out = self._rhs(*X.T, t, alpha=self.alpha) | ||
return out | ||
def jac(self, X, t): | ||
"""The Jacobian of the dynamical system""" | ||
out = self._jac(*X.T, t, alpha=self.alpha) | ||
return out | ||
|
||
class LDS(DynSys): | ||
@staticjit | ||
def _rhs(x, t, alpha): | ||
xdot = alpha * x | ||
return xdot | ||
@staticjit | ||
def _jac(x, t, alpha): | ||
row1 = [alpha] | ||
return row1 |