Get internal forces for a MobilizedBody

Simbody is useful for internal coordinate and coarse grained molecule modeling, large scale mechanical models like skeletons, and anything else that can be modeled as bodies interconnected by joints, acted upon by forces, and restricted by constraints.
User avatar
Simone Hendriks
Posts: 10
Joined: Thu Nov 16, 2023 6:31 am

Re: Get internal forces for a MobilizedBody

Post by Simone Hendriks » Tue Nov 21, 2023 6:08 am

Hi Sherm,

Thank you, with the documentation and the example I could create a minimal system that allocates an auto-update variable.

Now I am still trying to find a way to compute the needed reactions. Let me explain it again with the following basic system:

diagram.PNG
diagram.PNG (17.4 KiB) Viewed 777 times

The system consists of two sliders A and B, 1 kg each, and a gravity acceleration vector (0,0,-10). Upon A, a mobilizer force of 50 N is applied. Both sliders are constrained with a coordinate coupler so that the difference between both generalized coordinates is constant.
  • If I retrieve the mobilizer reaction forces, it will yield [25,0,10] for slider A and [25,0,10] for slider B.
  • The mobilizer reaction for slider A contains the generalized force, the coordinate coupler reaction and the reaction of the mobilizer alone.
  • However, I only wish the reaction forces due to the mobilizer and the coordinate coupler. Thus, I actually want to get [-25, 0, 10] for slider A (slider B opposes the motion).
These reaction will be computed in realizeAcceleration() within the custom force and stored in the cache of the auto-update variable. But how would you get the desired reaction force?

Best regards,
Simone

User avatar
Michael Sherman
Posts: 804
Joined: Fri Apr 01, 2005 6:05 pm

Re: Get internal forces for a MobilizedBody

Post by Michael Sherman » Tue Nov 21, 2023 4:01 pm

Oh, I think I understand now. If you don't want the generalized force Qa included in the reaction, have you considered applying it as a body force to A rather as a mobility force? Then all you would see in the reaction is the coordinate coupler force and the sliders' reactions to gravity.

Otherwise you could subtract it explicitly from the reaction, ideally using the same code you used to apply the force in the first place to ensure that both the applied and subtracted forces are identical.

Sherm

User avatar
Simone Hendriks
Posts: 10
Joined: Thu Nov 16, 2023 6:31 am

Re: Get internal forces for a MobilizedBody

Post by Simone Hendriks » Wed Nov 22, 2023 3:20 am

Hi Sherm,

Yes, I will apply it as body forces! The mobilizers are actually following a unit speed trajectory, so the equivalent body force should be along the tangent to the trajectory, with the same magnitude as the mobility force.

Moreover, I noticed (for example in a system with 1 slider along the x-axis) that applying a mobility force Q is not the same as applying a body force [Q,0,0]. The mobility force Q generates equivalent body reactions [Q,0,0] on the mobilized body and [-Q,0,0] on the parent. On the other hand, applying a body force [Q,0,0] generates null reactions (this is what I would expect). The way I think about it is that mobility forces are generated by an actuator, and therefore the parent must experience the opposite mobility force. On the other hand, applied body forces are "purely external". Is that the actual reasoning behind mobility forces, or why has it been conceived in this way?

Thank you!

Best regards,
Simone

User avatar
Michael Sherman
Posts: 804
Joined: Fri Apr 01, 2005 6:05 pm

Re: Get internal forces for a MobilizedBody

Post by Michael Sherman » Wed Nov 22, 2023 8:39 am

Right! Sorry I didn't think of that earlier. Mobilizer forces are conceived as being generated by a motor in the joint so act equal and opposite on the connected bodies.

User avatar
Simone Hendriks
Posts: 10
Joined: Thu Nov 16, 2023 6:31 am

Re: Get internal forces for a MobilizedBody

Post by Simone Hendriks » Wed Nov 22, 2023 10:28 am

Hi Sherm,

I am connecting the dots now, many thanks for your valuable help!

Best regards,
Simone

POST REPLY