Page 1 of 1

Prescribed movement in Forward Dynamic

Posted: Mon May 08, 2017 6:25 am
by gabor
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

Re: Prescribed movement in Forward Dynamic

Posted: Mon May 08, 2017 4:41 pm
by jimmy
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

Re: Prescribed movement in Forward Dynamic

Posted: Mon May 08, 2017 11:59 pm
by gabor
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

Re: Prescribed movement in Forward Dynamic

Posted: Wed May 10, 2017 7:53 am
by gabor
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