Page 1 of 1

change mot file while adding external force

Posted: Sun Jun 02, 2019 2:40 am
by saeedaram
Hello
Is it possible to change .MOT file of default model while adding external force? ( I want to change .mot file of gait2392 while adding external force by Matlab and see the results of changing muscle forces)
also, I don't have any experimental data to create new .MOT file

Re: change mot file while adding external force

Posted: Mon Jun 03, 2019 9:02 am
by jimmy
Hi-

You can edit the .mot file in a text editor and in Matlab. What editing are you trying to perform? It isn't clear from your description of what you are trying to do and with what files.

-J

Re: change mot file while adding external force

Posted: Wed Jun 05, 2019 3:07 am
by saeedaram
jimmy wrote:
Mon Jun 03, 2019 9:02 am
Hi-

You can edit the .mot file in a text editor and in Matlab. What editing are you trying to perform? It isn't clear from your description of what you are trying to do and with what files.

-J
Thanks for your response
I know that i can edit .mot file in a text editor and in matlab but my main question is that i want to change angular displacement and GRF of motion manually due to i have not enough facilities to get experimental data. after edit .mot file i want to add external force to model by matlab and then load .mot file on model and plot tendon forces to time to take results.

my question is very important to continue my research so I am waiting to your exact response.
best regards

Re: change mot file while adding external force

Posted: Wed Jun 05, 2019 5:20 pm
by jimmy
If you want to make your own data, you will have to use something like Matlab or Excel to define the motion and force curves. Once you have the curves, you could edit the .mot file in Excel-- copying and pasting the data into the correct columns-- or in Matlab to generate a OpenSim TimesSeriesTable and write the data to file using the STOFileAdapter().

Once you have the force file, I would suggest using the InverseDynamicsTool(), and the ExternalLoads() classes to perform the dynamics analysis you need. There is some example code of the Inverse Dynamics pipeline written in Jython here that can be converted to Matlab very easily. You would just then need to add code that altered the External Loads file.

Re: change mot file while adding external force

Posted: Thu Jun 06, 2019 10:37 am
by saeedaram
jimmy wrote:
Wed Jun 05, 2019 5:20 pm
If you want to make your own data, you will have to use something like Matlab or Excel to define the motion and force curves. Once you have the curves, you could edit the .mot file in Excel-- copying and pasting the data into the correct columns-- or in Matlab to generate a OpenSim TimesSeriesTable and write the data to file using the STOFileAdapter().

Once you have the force file, I would suggest using the InverseDynamicsTool(), and the ExternalLoads() classes to perform the dynamics analysis you need. There is some example code of the Inverse Dynamics pipeline written in Jython here that can be converted to Matlab very easily. You would just then need to add code that altered the External Loads file.
thank you very much for your exact response
that was really useful