Slow simulations

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Jan Willem van Dijk
Posts: 1
Joined: Tue Jun 10, 2014 3:30 am

Slow simulations

Post by Jan Willem van Dijk » Tue Jun 10, 2014 12:52 pm

Hello all,

I try to simulate to motion of system i created (a simple 2D crankshaft example), but the simulation runs very slow. When i slide a bar in the coordinates window the model moves very slowly and not directly to the position i set it too. I have to move the slider back and forth on a certain position to move the system to that position. I`ve checked the DOFs several times, but i seem to have no under or over constraints.

Is this because my computer is slow ? (a few years old?)

Actually i just want to analyse the kinematics of the system (no reaction forces/dynamics), which function of opensim should i use?

Regards,

JW

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

Re: Slow simulations

Post by jimmy d » Wed Jun 11, 2014 11:23 am

Hi Jan,

Have you tried to run this on a different machine to see if the issue is localized?

-jmaes

User avatar
Laura Peeters
Posts: 11
Joined: Thu Nov 28, 2013 9:12 am

Re: Slow simulations

Post by Laura Peeters » Mon Jun 23, 2014 12:54 am

Hi!

Sorry for the late reply, but it took a while to find a computer which was faster than the one we used.
Unfortunately, the issue wasn't solved running the model on a different machine. The simulation was still very slow! When we move the slider, in the coordinates window, back and forth on a certain position the model obtains eventually the right position. When you move the slicer to a certain position and just wait, the model doesn't move at all.

Any other suggestions we could try, how we could fix the problem or what the problem might be?

Thanks!


Regards,

Laura

User avatar
Laura Peeters
Posts: 11
Joined: Thu Nov 28, 2013 9:12 am

Re: Slow simulations

Post by Laura Peeters » Wed Jul 30, 2014 9:10 am

My problem of the slow simulation is solved!! The problem was probably within the assemblySolver which could not solve the kinematics due to too many coordinates and constraints. James gave me two main design advices which solved my problem:
1. model the joints as gimbal, slider, pin or weld joints instead of free joints with locked coordinates.
2. Use the tag <is_free_to_satisfy_constraints>true</is_free_to_satisfy_constraints> which tells the assemblySolver that the coordinate can take on any value in order to satisfy the constraints.

The detailed explanation of point two by James:
"When you change a coordinate in OpenSim the underlying assemblySolver() adjusts the models coordinates to satisfy both the coordinates and the constraints.

When you have many (coordinates and constraints) it makes it computationally difficult for the assemblySolver() to satisfy. In this case its import to identify the coordinates that are of real importance to you. For those important coordinates, you can add the tag <is_free_to_satisfy_constraints> true </is_free_to_satisfy_constraints>. This tells the assemblySolver() that the coordinate can take on any value in order to satisy the constraints and there is no cost for doing it. Otherwise, it assumes the value associated with the coordinate is important and the solver tries to minimize the weighted square of the change. By default each coordinate has a weight of 1.

For example, in some of the knee models we use that have a patella (and patella constraints), we will add the satisy_constraints tag (true) to the knee rotation coordinate. Otherwise when we want a knee angle of 25 degrees we may only get 21 because the solver couldn't satisfy. "

POST REPLY