Problem running a Forward Dynamic simulation with only gravity

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Enrico Piovanelli
Posts: 5
Joined: Wed Aug 31, 2016 5:45 am

Problem running a Forward Dynamic simulation with only gravity

Post by Enrico Piovanelli » Tue Jul 02, 2019 7:20 pm

Dear All,

I am trying to run a Forward Simulation on a modified and scaled version of the MoBL_ARMS. I added 2 contact geometries to model the contact between a table and the arm. Other modification I made are the addition of translational and rotational DOFs to the thorax for the scaling and increased the angle range of the wrist deviation.

I managed to run the Forward Dynamics with only gravity on the unscaled model, but once I scale the model the same Forward Dynamics simulation just freeze after the "Integrating from 0 to x" message, and even if I try to stop it, it doesn't. So I have to close and open again OpenSim to run another simulation.

Can anyone help me or give me some advice? I attach my modified model

Thank you very much for the help!

Enrico
Attachments
MoBL_ARMS_contactForce_scaled.osim
(589.05 KiB) Downloaded 12 times

Tags:

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

Re: Problem running a Forward Dynamic simulation with only gravity

Post by jimmy d » Wed Jul 03, 2019 1:10 pm

You are missing geometry files that are required to open the model. Please attach a zip file that includes everything needed to run a simulation.

User avatar
Enrico Piovanelli
Posts: 5
Joined: Wed Aug 31, 2016 5:45 am

Re: Problem running a Forward Dynamic simulation with only gravity

Post by Enrico Piovanelli » Thu Jul 04, 2019 6:35 am

Oh, I am sorry..!
Here are the geometry files that I added to those of MoBL_ARMS model. Unfortunately I can't add all the Geometry folder because it is too big..

The Forward Dynamic Setup file is attached as well.
Attachments
MoBL_FD_gravityonly_Setup.xml
(4.2 KiB) Downloaded 14 times
additional_geometry.zip
(21.81 KiB) Downloaded 8 times

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

Re: Problem running a Forward Dynamic simulation with only gravity

Post by jimmy d » Fri Jul 05, 2019 8:47 am

Hi, Enrico-

I did see the same issue that you reported-- the model gets stuck, and nothing happens. There seemed to be several problems, and it took me a few hours to do a complete fix, so I thought I would outline my general approach for prosperity;

The model seems stuck, but you can output results and the time steps are super small. Which led me to initially believe that the model has very high forces, and the problem was extremely stiff. If that is true, then the best thing to do is take out all the forces (muscles, coordinate limit forces, and contact) and re-run the simulation.

After removing all the forces and performing FWD, I still saw the same issue-- the unlocked elbow coordinate didn't move. I unlocked all the model coordinates, ran fwd, and saw 'weird' results-- the model fell, but none of the other coordinates changed value. Additionally, I would see 'weird' numbers in the coordinate values and speeds of the GUI. At this point, I wanted to confirm that the original model, without additional DoFs about the thorax, had the same issue. If it didn't then it was something that had been added to the model that was causing the issue.

I downloaded the original model and successfully ran fwd with it-- so, at this point, I had narrowed it down to the new bodies and joints that were added. I did notice that the Thorax and armsupport had a large mass and no inertia, which is not good. Despite fixing those, there was still some issue, and it was in how the joint was defined. I couldn't see any apparent reason why the joint wasn't working, but at this point, I had been iterating for an hour or so and hadn't had enough coffee. The easiest way to fix this is to take a joint from a functioning model and transplant it to the original, working, model.

I copied the pelvis joint from a gait model and added it to the original, unedited, model, updating the names accordingly. I ran fwd and got successful results. I then systematically added back the complexity of the model-- armsupport, contact surfaces, muscles, coordinate limit forces-- running fwd after each addition to ensure that the model was still functioning. What I have left is a functioning model that works in FWD.

So the general answer for why it wasn't working is that the newly added bodies and joints were not correctly defined and made FWD crap itself. I am more surprised that you said that it worked before scaling since the issues are more related to model definition than anything that scaling would do. Regardless, you should be able to use this updated model and scale for each participant accordingly, or you could copy over the thorax and armsupport bodies and joints to the unscaled version and work from there.

Whenever you build or augment a model for simulation, the process is to go from simplest version and only add complexity when you are sure the current version works as expected-- this is also the way to debug a model. This can be tedious, but it ensures that when something goes wrong you know what the culprit is.

Two things to ponder now;
- The armsupport joint is relative to the ground-- you may want to make that relative to the thorax so when you move the thorax (or when the ScaleTool moves it), then the arm support will travel along for the ride.
- The model is super stiff, and the simulation time is VERY slow due to the coordinate limit forces. I suggest thinking about if you need them or not since you have the armsupport.
- I did this in OpenSim 4.0 and haven't tested it in 3.3.

Goodluck!
-J
Attachments
MoBL_ARMS_contactForce_scaled_jd.osim
(590.42 KiB) Downloaded 13 times

POST REPLY