Skip to content

Commit

Permalink
some diverse hints
Browse files Browse the repository at this point in the history
  • Loading branch information
fhchl committed Sep 21, 2023
1 parent 3fde181 commit 08fe3d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dynax/estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def transfer_function(sys: DynamicalSystem, to_states: bool = False, **kwargs):
linsys = sys.linearize(**kwargs)
A, B, C, D = linsys.A, linsys.B, linsys.C, linsys.D

def H(s):
def H(s: complex):
"""Transfer-function at s."""
identity = np.eye(linsys.n_states)
phi_B = jnp.linalg.solve(s * identity - A, B)
Expand Down
4 changes: 2 additions & 2 deletions dynax/evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import jax
import jax.numpy as jnp
import numpy as np
from numpy.typing import ArrayLike
from jaxtyping import Array, ArrayLike

from .interpolation import spline_it
from .system import DynamicalSystem
Expand Down Expand Up @@ -44,7 +44,7 @@ def __call__(
ucoeffs: Optional[ArrayLike] = None,
squeeze: bool = True,
**diffeqsolve_kwargs,
):
) -> tuple[Array, Array]:
"""Solve initial value problem for state and output trajectories."""
t = jnp.asarray(t)
x0 = jnp.asarray(x0)
Expand Down
4 changes: 2 additions & 2 deletions dynax/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def output(self, x, u=None, t=None):
def linearize(self, x0=None, u0=None, t=None) -> "LinearSystem":
"""Compute the approximate linearized system around a point."""
if x0 is None:
x0 = np.zeros(self.n_states)
x0 = jnp.zeros(self.n_states)
if u0 is None:
u0 = np.zeros(self.n_inputs)
u0 = jnp.zeros(self.n_inputs)
A, B, C, D = _linearize(self.vector_field, self.output, x0, u0, t)
# jax creates empty arrays
if B.size == 0:
Expand Down

0 comments on commit 08fe3d1

Please sign in to comment.