set external force in matlab and opensim compute new state

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Maryam khamar
Posts: 4
Joined: Wed Nov 18, 2015 4:52 am

set external force in matlab and opensim compute new state

Post by Maryam khamar » Tue Oct 25, 2016 11:32 am

I want to set external force in matlab and opensim compute force and new state after this force. I compile c++ code and define a mex file. But I don’t know how define external force in opensim. I want to use external force class in opensim but it’s get information from storage file. How I can set external force in matlab and define as input in opensim "compute force" function

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

Re: set external force in matlab and opensim compute new state

Post by Dimitar Stanev » Wed Oct 26, 2016 1:46 am

Maybe you are interested in PrescribedForce:

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

Best

User avatar
Maryam khamar
Posts: 4
Joined: Wed Nov 18, 2015 4:52 am

Re: set external force in matlab and opensim compute new state

Post by Maryam khamar » Thu Oct 27, 2016 1:44 am

Yes, do you say use these function of prescribedforce:
SetTorqueFunction
SetPointFunctions
I define a header file that define this class and this function and then define a source file that define function and define mex file?
After define mex file and compile it, in matlab use the function SetTorqueFunction and SetPointFunction?

POST REPLY