"Millard.computeFiberEquilibrium(state, True) does not work."

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
hu hu
Posts: 13
Joined: Fri Jun 23, 2023 1:50 am

"Millard.computeFiberEquilibrium(state, True) does not work."

Post by hu hu » Sat Dec 14, 2024 7:52 pm

I am using the Millard muscle model. I have already configured the compliance of the tendon. After setting the values and velocities of the coordinates, I set the muscle activation and calculated the fiber length using `computeFiberEquilibrium`. However, I found that the results are the same in the following two cases, which confuses me.
  • Millard.computeFiberEquilibrium(state, False)
  • Millard.computeFiberEquilibrium(state, True)
Here are some code snippets:

Code: Select all

for i in range(nMuscles):
    muscle = MuscleSet.get(i) 
    muscle.set_ignore_tendon_compliance(False)

Code: Select all

for i in range(nCoords):
    coord = coord_set.get(i)
    coord_value = q_data[j, i]  
    coord_speed = u_data[j, i]
    coord.setValue(state, coord_value)
    coord.setSpeedValue(state, coord_speed)
model.realizeVelocity(state)

Code: Select all

for i in range(nMuscles):
    muscle = MuscleSet.get(i)
    muscle.setActivation(state, activation_data.get(i))
    Millard = osim.Millard2012EquilibriumMuscle.safeDownCast(muscle)
    Millard.computeFiberEquilibrium(state, False)
    # Millard.computeFiberEquilibrium(state, True)
Then, I output the fiber length.

Code: Select all

muscle_lengths = []
for i in range(nMuscles):
    muscle = MuscleSet.get(i)
    muscle_fiber_length = muscle.getFiberLength(state)
    muscle_lengths.append(muscle_fiber_length)
print(",".join(map(str, muscle_lengths)))
The results of the two cases are exactly the same. How should this be understood?

Tags:

POST REPLY