MATLAB Scripting for CMC

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
AUDE LEFRANC
Posts: 16
Joined: Wed Sep 18, 2019 12:47 pm

MATLAB Scripting for CMC

Post by AUDE LEFRANC » Tue Nov 10, 2020 11:57 pm

Hey All!

I'm trying to figure out how to run CMC using the API. However, there is limited info on how to use each method in the API docs.

I have set up my code, and then CMC starts running but fails to converge on a solution and crashes after a couple seconds. I think the main reason for this is I have no idea how to correct include the actuators file because there isn't a "setActuators" method. My code and error are attached below.

The files themselves should be ok because I already ran them in OpenSim3.3 and 4.1 and got reasonable metabolic cost results.

What method do I use for that? What other reason could cause this to fail?

Also, I am using an OpenSim 3.3 model but using Opensim 4.1 .. would that cause any issues?

Thank you so much!
Attachments
CMC_API_code.JPG
CMC_API_code.JPG (131.21 KiB) Viewed 537 times
CMCError.JPG
CMCError.JPG (108.45 KiB) Viewed 537 times

Tags:

User avatar
Carmichael Ong
Posts: 401
Joined: Fri Feb 24, 2012 11:50 am

Re: MATLAB Scripting for CMC

Post by Carmichael Ong » Thu Nov 12, 2020 6:43 pm

Multiple actuator files can be set, and they can all be set together using setForceSetFiles (https://simtk.org/api_docs/opensim/api_ ... 51892a66d3). This is not quite the most intuitive name, but if you have a working CMC setup file, you can see this tag name if you open the .xml setup file in a text editor.

User avatar
AUDE LEFRANC
Posts: 16
Joined: Wed Sep 18, 2019 12:47 pm

Re: MATLAB Scripting for CMC

Post by AUDE LEFRANC » Sun Nov 15, 2020 3:02 pm

Sounds great. Thank you so much!

POST REPLY