Prescribed movement in Forward Dynamic

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Gabor Piskoty
Posts: 10
Joined: Mon Nov 16, 2015 7:52 am

Prescribed movement in Forward Dynamic

Post by Gabor Piskoty » Mon May 08, 2017 6:25 am

Dear All

I kindly ask you for help to solve the following problem.

I built a simple pendulum model, consisting of the following 2 rigid bodies (see attachment "pendulum.osim"):
- HEAD of the pendulum; visualized as a block
- ARM of the pendulum, visualized as a sphere in the mass center of the ARM

There are 2 joints in the model:
- The HEAD is connected to a ground with an free joint, whereas only the X-transnational movement is allowed.
- The ARM is is connected to the HEAD with an free joint, whereas only the Z-rotational movement is allowed.


My intention is to give a predefined transnational movement for the pendulum's HEAD in x-direction in function of the time, and calculate/simulate the corresponding rotational oscillation of the ARM with Forward Dynamic. For the definition of the movement of the HEAD, I would prefer a text file, providing the position in a given time step. I attached an example ("required motion of the pendelum head.txt").

As an alternative, less convenient solution a function for the x-movement of the HEAD could be defined, according to the attachment "predefinded motion.pdf". However, unfortunately I have no clue how such a function can be defined. Please tel me the "secret", if you know it.

I appreciate your help very much.

Best regards

Gabor
Attachments
predefinded motion.pdf
screen capture of the GUI
(126.18 KiB) Downloaded 18 times
required motion of the pendelum head.txt
example for movement
(1.09 KiB) Downloaded 15 times
pendulum.osim
model
(21.54 KiB) Downloaded 9 times

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Prescribed movement in Forward Dynamic

Post by jimmy d » Mon May 08, 2017 4:41 pm

Hi, Gabor-

It is not clear what you are asking help for? Did you want OpenSim to read your text file and produce a model with prescribed values for Head-ground_xR? You would have to write your own script for that. There is a utility script for prescribing motions to a model from a .mot file that is part of the OpenSim distribution; you can see the 4.0 version here.

Cheers,
-James

User avatar
Gabor Piskoty
Posts: 10
Joined: Mon Nov 16, 2015 7:52 am

Re: Prescribed movement in Forward Dynamic

Post by Gabor Piskoty » Mon May 08, 2017 11:59 pm

Dear James

Thank you for your reply. Yes, you understood my intention correctly. I assumed that I can run a Forward Dynamic with a prescribed movement for a particular DOF without scripting. For example, in Static Optimization we can simply link a motion file using the GUI of OpenSim. No scripting is required and it works. I assumed that an analogous simple method is available for Forward Dynamic.

So, I will study the script according to your link. Unfortunately, I never used scripts for OpenSim - I see it is time to start with them :).

Do you know how is to define the "Object" in the GUI according to the attachment ? May be, it would be a more easy way to predefine a DOF, even if it would be less flexible than using a text file for the predefined time-position relationship of the particular DOF.

Thank you for your kind help!

Best regards

Gabor
Attachments
predefinded motion.pdf
(126.18 KiB) Downloaded 13 times

User avatar
Gabor Piskoty
Posts: 10
Joined: Mon Nov 16, 2015 7:52 am

Re: Prescribed movement in Forward Dynamic

Post by Gabor Piskoty » Wed May 10, 2017 7:53 am

Dear James

With the help of the script proposed by you I was able to solve the problem!

Thank you very much!

Best regards

Gabor

POST REPLY