Function based parameter optimization (for musculotendon parameters)

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
Pasha van Bijlert
Posts: 227
Joined: Sun May 10, 2020 3:15 am

Function based parameter optimization (for musculotendon parameters)

Post by Pasha van Bijlert » Sat Jul 20, 2024 2:35 am

Hi all,

I was inspired by Oliver's thread about mocoParameters, but decided to start this separate thread because I don't think they're fully related.

I've been interested in doing parameter optimizations for the musculotendon parameters for a while now. However, as I understand it, it is currently not possible to couple parameters to each other. E.g., you could optimize F_max and L0 for each muscle, but you can't keep F_max * L0 = constant. The logical conclusion will be that the optimal solution maximizes both F_max and L0, adding free mass muscle mass to the model (possibly limited by some arbitrary weighting).

Nick - I was wondering how best to submit this as a feature request? Should I add it onto the Github issue for parameter regulization? Or should I add this separately? In my head, it would work something like a constraint on the parameters (perhaps "mocoParameterProductConstraint" or "mocoParameterProductFunction"?). In this case, I'd like to be able to define two parameters whose product must always remain constant - this would enable the user to optimize force-generating parameters without adding muscle mass (e.g., MocoParameterProductConstraint(par1, par2)). If it would help this cause, I can try to workshop something in Matlab. I think this is also somewhat related to Oliver's request, e.g., in his example he could use this to try coupling the contact sphere radius to the plain strain modulus (since in the contact model, these are both combined to get an effective stiffness, although they aren't both linearly proportional in the same way that F_max & L0 are to muscle mass).

I saw a Github issue that combined functions of outputs are being tested as a goal in Moco (which is very exciting, I can think of at least one project where I'd like to try this out). This seems to be somewhat related to function-based parameter optimizations.

Cheers,
Pasha

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

Re: Function based parameter optimization (for musculotendon parameters)

Post by Nicholas Bianco » Mon Jul 22, 2024 2:53 pm

Hi Pasha,

I think it's possible to have one solution for both use cases. I'm wondering if something like a "MocoExpressionBasedParameterGoal" would make sense here. You could point to a parameter in the model/problem, and write an expression (similar to classes like ExpressionBasedCoordinateForce) to dictate how it's minimized or constrained.

-Nick

User avatar
Pasha van Bijlert
Posts: 227
Joined: Sun May 10, 2020 3:15 am

Re: Function based parameter optimization (for musculotendon parameters)

Post by Pasha van Bijlert » Sun Aug 04, 2024 4:03 pm

Hi Nick

That type of implementation would be super useful, I think! I guess for it to work for a musculotendon parameter optimization, it would have to be possible to write an expression using 2 (or more) parameters, although I don't know how challenging that would be to implement.

Best wishes,
Pasha

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

Re: Function based parameter optimization (for musculotendon parameters)

Post by Nicholas Bianco » Tue Aug 06, 2024 9:39 am

We've created the following issue to track this feature request: https://github.com/opensim-org/opensim-core/issues/3860.

It shouldn't be too difficult to implement.

User avatar
Pasha van Bijlert
Posts: 227
Joined: Sun May 10, 2020 3:15 am

Re: Function based parameter optimization (for musculotendon parameters)

Post by Pasha van Bijlert » Tue Aug 06, 2024 6:09 pm

Hi Nick,

Cool, thank you! I'll keep an eye on that GH issue! Presumably even though the Issue title says "minimizing" of parameter values, it also includes constraining them instead of minimizing them?

Cheers,
Pasha

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

Re: Function based parameter optimization (for musculotendon parameters)

Post by Nicholas Bianco » Thu Aug 08, 2024 9:47 am

Hi Pasha,

Yes, we will make it a MocoGoal, with options to use it as a cost term or endpoint constraint.

Best,
Nick

User avatar
Pasha van Bijlert
Posts: 227
Joined: Sun May 10, 2020 3:15 am

Re: Function based parameter optimization (for musculotendon parameters)

Post by Pasha van Bijlert » Thu Aug 22, 2024 7:33 am

Hi Nick,

I'll be excited to try it out! I think in situations where we're not too sure about the muscle architecture (but are confident about the muscle mass), this would be a cool feature to have. There are also many other applications of such a customizable goal.

Best wishes,
Pasha

POST REPLY