More and more OpenSim users are using the MATLAB scripting interface for research. In this workshop, the OpenSim team will use a hands-on example to introduce the new features of OpenSim 4.0 that make scripting in MATLAB more powerful and user-friendly. The new OpenSim API (Application Programming Interface) in version 4.0 has been improved to simplify building model components, running simulations, performing analyses, and working with data files.
A hands-on example will teach participants how to build models and run simulations through the MATLAB scripting interface, by working with a simple computational model of a person jumping. The workshop will feature a friendly competition between participants to optimize the jumper's performance in a simulation.
The workshop will last three-hours and is designed for those who are familiar with both OpenSim and MATLAB. Participants who have not used OpenSim, but have a strong background with computational modeling and simulation of the musculoskeletal system, are also welcome to participate.
Preparing for the workshop
- Download the files here.
- Windows, 64-bit MATLAB
- Windows, 32-bit MATLAB
- Mac
- The example requires MATLAB 2014b. If you have an older version, you can team up with others or download a free trial of MATLAB.
- Unzip the files to a location of your choice; perhaps C:\opensim-core-tgcs (on Windows).
- If you use Windows, edit your PATH environment variable to include the bin directory (e.g., C:\opensim-core-tgcs\bin). See here for instructions. Make sure to remove any previous OpenSim installations from your PATH (alternatively, rename the folder containing the previous OpenSim installation).
- Configure OpenSim with MATLAB by starting MATLAB and running configureOpenSim.m. This file is located in:
- Windows: sdk/Scripts/Matlab
- Mac: share/doc/OpenSim/Scripts/Matlab
- After the script completes, restart MATLAB and test the configuration by checking the timestamp from running org.opensim.modeling.opensimCommon.GetVersionAndDate() in the MATLAB command window; the date should be in July 2017.
Test that the visualizer is working by running the following, after which you should see an empty visualizer window.
>> m = org.opensim.modeling.Model() >> m.setUseVisualizer(true); >> m.initSystem();
Contact Chris Dembia with any questions.