ForwardTool - Specify Controls File
Posted: Thu May 16, 2013 8:49 am
Hi All,
I am trying to write a Matlab script that runs a forward dynamics simulation using a specific controls file. I can run the simulation just fine, but it does not use the controls in the file that I specify. The controls all remain at their default values (= 0.0). When I do the same thing in the GUI, the simulation runs as intended using the controls in the specified file. Here is the relevant section of code from my Matlab script:
tool = ForwardTool();
tool.setModel(osimModel);
tool.setStartTime(0);
tool.setFinalTime(1);
tool.setSolveForEquilibrium(true);
tool.setResultsDir(ResultsDirPath);
tool.setControlsFileName('myControls.sto');
tool.setName('mySimulation');
tool.run();
My assumption was that the command "tool.setControlsFileName('myControls.sto');" would cause the tool to use the controls in that file, but that does not appear to be the case. There are no errors or warnings, the simulation runs, but the controls in the specified file are not used. I am running version 3.1 beta, but I had similar results in version 3.0.1. Any thoughts or suggestions are greatly appreciated!
Best,
Brian
I am trying to write a Matlab script that runs a forward dynamics simulation using a specific controls file. I can run the simulation just fine, but it does not use the controls in the file that I specify. The controls all remain at their default values (= 0.0). When I do the same thing in the GUI, the simulation runs as intended using the controls in the specified file. Here is the relevant section of code from my Matlab script:
tool = ForwardTool();
tool.setModel(osimModel);
tool.setStartTime(0);
tool.setFinalTime(1);
tool.setSolveForEquilibrium(true);
tool.setResultsDir(ResultsDirPath);
tool.setControlsFileName('myControls.sto');
tool.setName('mySimulation');
tool.run();
My assumption was that the command "tool.setControlsFileName('myControls.sto');" would cause the tool to use the controls in that file, but that does not appear to be the case. There are no errors or warnings, the simulation runs, but the controls in the specified file are not used. I am running version 3.1 beta, but I had similar results in version 3.0.1. Any thoughts or suggestions are greatly appreciated!
Best,
Brian