Static Optimization API

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Joel Quarnstrom
Posts: 11
Joined: Tue Jun 30, 2020 9:40 am

Static Optimization API

Post by Joel Quarnstrom » Wed Aug 05, 2020 8:50 am

Hello,

I am trying to use Static Optimization to solve for muscle forces in a model given a kinematic path. I am using the API. I read through the Doxygen documentation about the StaticOptimization class, but I still have a few questions.

I am unsure how to apply an external force to a model. I tried to find a function within the Joint, Body, and PhysicalFrame classes that would let me specify an external force applied to some part of the model, but I had no success. Do you know how to do this?

I understand that in order to solve a Static Optimization problem, the system needs to have a model, kinematic state variables, and external forces. When using this in the API, if I construct a Static Optimization object using a model, and if I have already defined a state with coordinate values, what other functions do I need to call in order to complete the Static Optimization? Do I use the begin and end functions?

Are there any examples of c++ code that specifically use the StaticOptimization class?

Thank you,
Joel Quarnstrom

Tags:

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: Static Optimization API

Post by Ayman Habib » Thu Aug 06, 2020 3:59 pm

Hello,

The test case code available here
https://github.com/opensim-org/opensim- ... on.cpp#L51

shows how to use StaticOptimization and how to apply ExternalLoads during solving.

Please let us know if you continue to have questions.
-Ayman

User avatar
Joel Quarnstrom
Posts: 11
Joined: Tue Jun 30, 2020 9:40 am

Re: Static Optimization API

Post by Joel Quarnstrom » Fri Aug 07, 2020 9:20 am

Thank you for posting that example. I read through it. It seemed that this code used an XML document in conjunction with the AnalysisTool class to perform Static Optimization. Do you know if it is possible to actually use the StaticOptimization class in the C++ code as outlined here:

https://simtk.org/api_docs/opensim/api_ ... ml#details

I am not very familiar with creating XML documents, and if there is a way to use the StaticOptimization class itself instead of doing it through the AnalysisTool class and having to mess with XMLs, I would prefer to do it that way.

I might not be interpreting it correctly, and please correct me if my understanding of that code is incorrect.

Thank you,
Joel Quarnstrom

POST REPLY