Questions about the PeriodicityGoal

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
Alexandre Peres
Posts: 4
Joined: Tue May 09, 2023 6:15 am

Questions about the PeriodicityGoal

Post by Alexandre Peres » Mon Jul 15, 2024 12:07 pm

Hi everyone! I'm currently facing some problems when implementing the PeriodicityGoal on a cycling movement.

My first problem is that after simulating the first half of the cycling motion and requesting a createPeriodicTrajectory, the crank goes back to its initial position for the mirrored movement, making it behave in an unwanted way. Does anyone know how can I solve this problem other than manually changing the .sto file? I've attached an image of the crank at the end of the movement

My other problem, and it's been quite challenging, is the fact that once I create the periodic movement, my constraint forces are removed from the .sto file, making it impossible to use it as a guess for a following simulation. I've been using a file obtained from only the first half of the movement, and this one has the constraint forces. But I'm still having a hard time converging my problems. Does anyone have a suggestion on how I can obtain a better guess file?
Attachments
crank_inversion_problem.png
crank_inversion_problem.png (150.3 KiB) Viewed 1336 times

User avatar
Nicholas Bianco
Posts: 1056
Joined: Thu Oct 04, 2012 8:09 pm

Re: Questions about the PeriodicityGoal

Post by Nicholas Bianco » Fri Jul 19, 2024 1:43 pm

Hi Alexandre,

The createPeriodicTrajectory utility assumes that the input trajectory is a symmetric half-period of a full periodic motion. Are you imposing symmetry in your cycling motion?

Your cycling model seems simple enough that you might consider simulating the full crank cycle while imposing standard periodic constraints.

-Nick

POST REPLY