Skip to content

Commit

Permalink
Do not alter during runtime Butcher tableau coefficients
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoferigo committed Mar 12, 2024
1 parent 5dcfeb9 commit a54bfae
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/jaxsim/integrators/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,10 @@ def build(
The integrator object.
"""

# Adjust the shape of the tableau coefficients.
c = jnp.atleast_1d(cls.c.squeeze())
b = jnp.atleast_2d(cls.b.T.squeeze()).transpose()
A = jnp.atleast_2d(cls.A.squeeze())

# Check validity of the Butcher tableau.
if not ExplicitRungeKutta.butcher_tableau_is_valid(A=A, b=b, c=c):
if not ExplicitRungeKutta.butcher_tableau_is_valid(A=cls.A, b=cls.b, c=cls.c):
raise ValueError("The Butcher tableau of this class is not valid.")

# Store the adjusted shapes of the tableau coefficients.
cls.c = c
cls.b = b
cls.A = A

# Check that b.T has enough rows based on the configured index of the solution.
if cls.row_index_of_solution >= cls.b.T.shape[0]:
msg = "The index of the solution ({}-th row of `b.T`) is out of range ({})."
Expand Down

0 comments on commit a54bfae

Please sign in to comment.