-
Notifications
You must be signed in to change notification settings - Fork 1
Systems
You can create maps and equations by using Difference
and Differential
and analyze the created instance.
params (** params)
is executed.
- t=None
- u=None
- **params
- dim
A function to put the orbit on the attractor.
Calculate T_0 = 5000
times from the initial position (t0
, u0
)
If t0
and u0
are left unspecified, make_inital
will generate the initial values.
The calculation result is discarded by default.
If you want to check, use notsave=False
.
It is stored in u_seq
.
- t0=None
- u0=None
- *
- T_0=5000
- notsave=True
- **params
<class TU>
Shows the transition from a randomly selected initial value to the attractor.
from hundun import Drawing
from hundun.equations import Lorenz
lorenz = Lorenz()
tu = lorenz.settle_on_attractor(notsave=False)
print(tu)
u_seq = lorenz.u_seq
d = Drawing(three=True)
d[0,0].plot(u_seq[:, 0], u_seq[:, 1], u_seq[:, 2],
linewidth=0.5, color='gray')
for j, label in zip([0, -1], ['start', 'end']):
d[0,0].scatter(u_seq[j, 0], u_seq[j, 1], u_seq[j, 2],
label=label, s=40)
d[0,0].legend()
d.show()
d.close()
TU(t=0, u=array([-5.89434775, -9.53167753, 16.2837206 ]))
Automatically use settle_on_attractor
when instantiating an orbit to place it on an attractor.
- t0=None
- u0=None
- h=0.01
- *
- T_0=5000
- **params
- c:
<class DynamicalSystems>
Returns the result calculated using self._solve
.
Execute solve
n
times.
- n
- self.t_seq
- self.u_seq
Even if it is one-dimensional of its own u
, if it is inf
, it returns True
.
Returns the current (t
, u
).
Returns the accumulated value t
of the result calculated by solve
.
Returns the accumulated value u
of the result calculated by solve
.
Reset the saved u_seq
.
Randomly generate initial values with reference to dim
.
Get the time series of the result calculated n
times.
- n
- *args
- **kwargs
- u_seq
from hundun import Drawing
from hundun.equations import Lorenz
u_seq = Lorenz.get_u_seq(1000)
d = Drawing(3, 1)
for i, axis in enumerate(['x', 'y', 'z']):
d[i,0].plot(u_seq[:, i])
d[i,0].set_axis_label('step', axis)
d.show()
d.close()
By defining it, the Lyapunov spectrum can be calculated based on the Jacobian Matrix.
A class of discrete dynamical systems.
_solve
simply maps.
def _solve(self, t, u, *, h=1, **params):
self.u = self(t, u, **params)
self.t = t+h
return TU(self.t, self.u)
A class of differential dynamical systems.
Runge-Kutta method is performed in _solve
.
def _solve(self, t, u, *, h=0.01, solver=_RK4, f=None, **params):
sol = solver(f or self, h=h, **params)
self.u = sol(t, _np.array(u))
self.t = t+sol.h
return TU(self.t, self.u)