Speed Constraints#

Constraints on motion speed and velocity.

class biosym.constraints.speed.Constraint(model, settings, args)#

Bases: BaseConstraint

Base class for speed constraints in the biosym package.

get_confun()#

Evaluate the speed constraint function.

Parameters:

states_list – Dictionary containing the current states.

Returns:

The speed constraint function.

get_jacobian()#

Get the Jacobian of the dynamics constraint function.

Parameters:

states_list – Dictionary containing the current states.

Returns:

The Jacobian of the dynamics constraint function.

get_n_constraints()#

Get the number of constraints defined by this dynamics constraint.

Returns:

The number of constraints.

get_nnz()#

Get the number of non-zero entries in the Jacobian of the dynamics constraint.

Returns:

The number of non-zero entries.

biosym.constraints.speed.confun(states_list, globals_dict, settings, info)#

Evaluate the constraint function for adaptive step sizes. :param states_list: Dictionary containing the current states. :param globals_dict: Dictionary containing global variables (e.g., duration). :param settings: Dictionary containing settings for the dynamics constraint. :param info: Information about the constraint function. :return: The evaluated constraint function.

biosym.constraints.speed.jacobian(states_list, globals_dict, settings, info)#

Placeholder for the Jacobian of the constraint function.

This function should be implemented in subclasses to compute the Jacobian of the dynamics constraints.

Parameters:
  • states_list – List containing the current states.

  • settings – Dictionary containing settings for the dynamics constraint.

  • info – Information about the constraint function.

Returns:

The Jacobian of the constraint function.