Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
EveCharbie committed Sep 19, 2024
1 parent 5b25e4d commit f2634a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bioptim/dynamics/dynamics_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,13 +1235,13 @@ def compute_tau_from_muscle(
The generalized forces computed from the muscles
"""

activations = []
activations = type(q)()
for k in range(len(nlp.controls["muscles"])):
if fatigue_states is not None:
activations.append(muscle_activations[k] * (1 - fatigue_states[k]))
activations = vertcat(activations, muscle_activations[k] * (1 - fatigue_states[k]))
else:
activations.append(muscle_activations[k])
return nlp.model.muscle_joint_torque()(q, qdot, activations)
activations = vertcat(activations, muscle_activations[k])
return nlp.model.muscle_joint_torque()(activations, q, qdot)

@staticmethod
def holonomic_torque_driven(
Expand Down
4 changes: 2 additions & 2 deletions bioptim/models/biorbd/biorbd_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,15 +536,15 @@ def muscle_velocity(self) -> Function:

def muscle_joint_torque(self) -> Function:
muscles_states = self.model.stateSet()
muscles_activations = self.muscles
muscles_activations = self.muscle
for k in range(self.model.nbMuscles()):
muscles_states[k].setActivation(muscles_activations[k])
q_biorbd = GeneralizedCoordinates(self.q)
qdot_biorbd = GeneralizedVelocity(self.qdot)
biorbd_return = self.model.muscularJointTorque(muscles_states, q_biorbd, qdot_biorbd).to_mx()
casadi_fun = Function(
"muscle_joint_torque",
[self.q, self.qdot, self.muscle],
[self.muscle, self.q, self.qdot],
[biorbd_return],
)
return casadi_fun
Expand Down

0 comments on commit f2634a3

Please sign in to comment.