How can I add force to analyze tool using Matlab scripting.

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Hari S
Posts: 29
Joined: Fri Oct 21, 2016 10:38 pm

How can I add force to analyze tool using Matlab scripting.

Post by Hari S » Thu May 11, 2017 10:27 pm

I want to add external force to the model. How do I add the xml file that contains the force details to the model when I am using matlab?

analyzeTool.setName(name);
analyzeTool.setResultsDir(results_folder);
analyzeTool.setCoordinatesFileName([ik_results_folder motIKCoordsFile]);
analyzeTool.setInitialTime(initial_time);
analyzeTool.setFinalTime(final_time);

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: How can I add force to analyze tool using Matlab scripting.

Post by Dimitar Stanev » Fri May 12, 2017 1:48 am

You will load the model (.osim) file. Then you have to add a PrescribedForce (model.addForce()) to the model. Then you provide the model to the AnalysisTool (in the constructor).

https://simtk.org/api_docs/opensim/api_ ... Force.html

Best

POST REPLY