Hi everyone!
I resumed the simulations recently and would like some extra help, if possible. I have the human model with 4 actuators on the joints (left and right hip and knees), and the feet are connected to the pedals of a crankset.
With your help (thank you!), I've achieved the following milestones:
P1) Joint Torque Prediction for Position Change: I can predict the joint torques needed for the model to move from an initial position to a final position (e.g., 0 to 360).
P2) Joint Torque Prediction for Speed Pattern: I can predict the joint torques required for the model to follow a speed pattern. For instance, I can determine the torques needed to make the model cycle at 180deg/s for 2s. I use the solution as a guess for subsequent periods.
- Presentation1.png (111.18 KiB) Viewed 8127 times
However, I'm struggling with
P2. Specifically, the simulations do not converge for durations beyond 4s.
Attempts made:
1. Using the unsealed .sto file as a guess for the next solution. I've concatenated it 5x.
2. Increasing the number of meshes.
3. Introducing both speed and angle patterns (made the convergence worse).
Simulation details:
- Tolerance values: convergence - 1e0, constraint - 1e-2
- Number of meshes: frequency * duration time (frequency set to 10)
Goal and boundaries:
I have one goal focused on speed tracking and specific boundaries.
Code: Select all
tracking = osim.MocoStateTrackingGoal()
tracking.setName('speed_tracking')
tracking.setReference(ref)
tracking.setAllowUnusedReferences(True)
tracking.setWeightForState('/jointset/crank_angle/crank_angle/speed', 1.0)
tracking.setWeightForState('/jointset/crank_angle/crank_angle/value', 0.0)
problem.addGoal(tracking)
problem.setTimeBounds(0.0, end_time)
problem.setStateInfo('/jointset/crank_angle/crank_angle/value', [], 0.0, [])
problem.setStateInfo('/jointset/crank_angle/crank_angle/speed', [-np.deg2rad(max_speed*1.2), np.deg2rad(max_speed*1.2)], 0, [])
Do you have any suggestions?
But I have some
specific questions regarding guesses:
1. If I run the optimisation and use the solution as a guess for the same problem (same time duration, tolerances, etc.), shouldn't it converge at iteration 1? I'm experiencing issues with this.
2. How does the "guess" work for different time frames? If the final time of the guess is 4.0s, and I extend the problem to 4.5s, what happens? Does it use random values in this 0.5s, or does it interpolate to 4.5?
Again, I truly appreciate all your time and assistance. Cheers!