Page 1 of 1

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

Posted: Thu May 11, 2017 10:27 pm
by harisarkar
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);

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

Posted: Fri May 12, 2017 1:48 am
by mitkof6
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