Search found 809 matches

by Michael Sherman
Mon Jun 24, 2024 6:00 pm
Forum: Simbody: SimTK multibody dynamics API
Topic: Fixed step size and end-of-step event
Replies: 3
Views: 8191

Re: Fixed step size and end-of-step event

Hi, Simone. Apologies for the delayed reply. (b) There is currently no provision in Simbody to call a function at step completion. This would be a nice addition to the TimeStepper class in case anyone would like to submit a Simbody PR! (a) This is a great question. It's not clear to me whether a fix...
by Michael Sherman
Wed Mar 13, 2024 7:44 am
Forum: OpenSim
Topic: computing jacobian: matlab and c++ api difference #3735
Replies: 3
Views: 6784

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 Mar 13, 2024 7:44 am
Forum: OpenSim
Topic: computing jacobian: matlab and c++ api difference #3735
Replies: 3
Views: 6784

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: 21113

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: 21113

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: 21113

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: 21113

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: 21113

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: 21113

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...