exporting models for use in matlab
Posted: Wed Apr 23, 2008 12:58 am
Hi,
I agree that the applications that can be run under the OpenSim framework are very useful but would be somewhat difficult to develop in this environment from scratch. In my experience, Matlab is the best tool to play around and experiment with various algorithms (such as CMC or NMT) and once they do the job, then they could potentially be coded in c++ as opensim applications.
In particular, I'm looking at a few contact algorithms between the tibia and femur, where I need to isolate parts of the EoM. Is there any way to 'export' or use the opensim models in a matlab environment.
Let me give an example: with skeletal dynamics models (created in sdfast), the resulting model is output as a dll file which can then be used in matlab and simulink through a simple s-function which allows you to configure the inputs, operations and outputs. So if we wanted to return say the mass matrix at any given time for example, we would create an s function with generalised coords, and velocities as the input, then call a function within SDFAST to return the mass matrix, and direct the result to the s function output. This way, we can not only get internal parameters, but also use these models in Simulink which is much easier to experiment with algorithms.
Since openSim uses Simbody (and not SDFAST), i was wondering if such a feature exists for either skeletal dynamics, muscular dynamics, or both?
Cheers,
Tim
I agree that the applications that can be run under the OpenSim framework are very useful but would be somewhat difficult to develop in this environment from scratch. In my experience, Matlab is the best tool to play around and experiment with various algorithms (such as CMC or NMT) and once they do the job, then they could potentially be coded in c++ as opensim applications.
In particular, I'm looking at a few contact algorithms between the tibia and femur, where I need to isolate parts of the EoM. Is there any way to 'export' or use the opensim models in a matlab environment.
Let me give an example: with skeletal dynamics models (created in sdfast), the resulting model is output as a dll file which can then be used in matlab and simulink through a simple s-function which allows you to configure the inputs, operations and outputs. So if we wanted to return say the mass matrix at any given time for example, we would create an s function with generalised coords, and velocities as the input, then call a function within SDFAST to return the mass matrix, and direct the result to the s function output. This way, we can not only get internal parameters, but also use these models in Simulink which is much easier to experiment with algorithms.
Since openSim uses Simbody (and not SDFAST), i was wondering if such a feature exists for either skeletal dynamics, muscular dynamics, or both?
Cheers,
Tim