Search found 807 matches

by Michael Sherman
Wed Mar 13, 2024 7:44 am
Forum: OpenSim
Topic: computing jacobian: matlab and c++ api difference #3735
Replies: 3
Views: 5423

Re: computing jacobian: matlab and c++ api difference #3735

A quick look suggests you need to get a reference to the existing SimbodyMatterSubsystem rather than a copy:

Code: Select all

const SimbodyMatterSubsystem& smss = model->getMatterSubsystem();
Regards,
Sherm
by Michael Sherman
Wed Nov 22, 2023 8:39 am
Forum: Simbody: SimTK multibody dynamics API
Topic: Get internal forces for a MobilizedBody
Replies: 14
Views: 19211

Re: Get internal forces for a MobilizedBody

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.
by Michael Sherman
Tue Nov 21, 2023 4:01 pm
Forum: Simbody: SimTK multibody dynamics API
Topic: Get internal forces for a MobilizedBody
Replies: 14
Views: 19211

Re: Get internal forces for a MobilizedBody

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 ...
by Michael Sherman
Mon Nov 20, 2023 6:13 pm
Forum: Simbody: SimTK multibody dynamics API
Topic: Get internal forces for a MobilizedBody
Replies: 14
Views: 19211

Re: Get internal forces for a MobilizedBody

You can read about auto update state variables in the doxygen for State::allocateAutoUpdateStateVariable() . Basically you get a state variable and a matching cache entry. You write to the cache entry and then that gets used to update the state variable at the end of every step. There are several ex...
by Michael Sherman
Mon Nov 20, 2023 11:54 am
Forum: Simbody: SimTK multibody dynamics API
Topic: Get internal forces for a MobilizedBody
Replies: 14
Views: 19211

Re: Get internal forces for a MobilizedBody

Hi, Simone. A few thoughts: - To get reaction force dependent friction, it makes sense to use the previous-step reactions to avoid an intractable mutual dependence among forces & accelerations. That means you need to remember the previous-step reaction forces, and memory == state! The best way to do...
by Michael Sherman
Thu Nov 16, 2023 2:31 pm
Forum: Simbody: SimTK multibody dynamics API
Topic: Get internal forces for a MobilizedBody
Replies: 14
Views: 19211

Re: Get internal forces for a MobilizedBody

Yes, the coordinate coupler will only produce mobility forces. Those forces will already be included in the mobilizer reaction forces (converted to spatial forces) so you might not need to get them explicitly. (Mobility forces from any source are always included in reaction forces.) If you want to s...
by Michael Sherman
Thu Nov 16, 2023 9:53 am
Forum: Simbody: SimTK multibody dynamics API
Topic: Get internal forces for a MobilizedBody
Replies: 14
Views: 19211

Re: Get internal forces for a MobilizedBody

Hi, Simone. I don't think there is a pre-existing function that would provide exactly the quantity you want. That might be a nice addition! However I can think of a few ways to get it: - thinking of a free-body diagram, use F=MA to obtain the net spatial force F from the body's spatial inertia M and...
by Michael Sherman
Tue Oct 31, 2023 7:40 am
Forum: Simbody: SimTK multibody dynamics API
Topic: Modal Analysis
Replies: 3
Views: 1292

Re: Modal Analysis

:facepalm: yes of course you're right. You want partial(acceleration)/partial(state). Simbody can provide acceleration(state) (fast) but you would have to differentiate that numerically to get the matrix. That's easy to do by hand or using Simbody's Differentiator class.

Sherm
by Michael Sherman
Mon Oct 30, 2023 7:48 am
Forum: Simbody: SimTK multibody dynamics API
Topic: Modal Analysis
Replies: 3
Views: 1292

Re: Modal Analysis

You can obtain the system Jacobian using

SimbodyMatterSubsystem::calcSystemJacobian(). I believe the manual is referring to the eigenvalues of this matrix as the system modes.

Sherm