Page 1 of 1

Scaling muscle properties

Posted: Wed Nov 02, 2022 8:55 am
by raphaelg1
Hello,

In the OpenSim documentation in "How Scaling Works" https://simtk-confluence.stanford.edu:8 ... ling+Works, it is mentioned that "...muscle's new optimal fiber length and tendon slack length are computed during the scaling process. A scale factor is computed as the ratio of the length before scaling to the length after scaling and the result is used to scale the component's length-dependent properties." I haven't been able to find how the new length of the muscle is calculated in https://github.com/opensim-org/opensim-core, and thus I don't know how the scaling factor for optimal fiber length and tendon slack length are calculated. Do you know where I can find the code or equation that calculated the new muscle length ?

Best Regards,

Re: Scaling muscle properties

Posted: Wed Nov 02, 2022 10:31 am
by aymanh
Hello,

Here's a link to the code snippet you're looking for:
https://github.com/opensim-org/opensim- ... e.cpp#L181

Please let us know if that answers your questions.

Best regards,
-Ayman

Re: Scaling muscle properties

Posted: Thu Nov 03, 2022 1:43 am
by raphaelg1
That answers my question, thank you !
However, now I would like to know how upd_GeometryPath() works (mostly where it is) and how the path.getLength(s) and path.getPreScaleLength(s) calculate the muscle length ?

Re: Scaling muscle properties

Posted: Thu Nov 03, 2022 10:10 am
by tkuchida
now I would like to know how upd_GeometryPath() works
upd_GeometryPath() returns a writable reference to the GeometryPath.
how the path.getLength(s) and path.getPreScaleLength(s) calculate the muscle length ?
The length of the GeometryPath (the total path of the muscle-tendon unit) is stored before the model is scaled. After scaling, extendPostScale() is called to adjust the optimal fiber length and tendon slack length properties. If scaling the model increased the length of the GeometryPath by x%, then the optimal fiber length and tendon slack length are also increased by x%. This is just one strategy; you can also update these properties yourself after the model is scaled.

Re: Scaling muscle properties

Posted: Mon Nov 21, 2022 8:09 am
by raphaelg1
Thank you for your answer, where can I find the code of the functions getLength(s) and getPreScaleLength(s) ?

Re: Scaling muscle properties

Posted: Mon Nov 21, 2022 3:43 pm
by tkuchida
where can I find the code of the functions getLength(s) and getPreScaleLength(s)?
You can search the code on GitHub (https://github.com/opensim-org/opensim-core) to find the implementations. Please note that the muscle length is obtained from the underlying GeometryPath.