Page 1 of 1
CustomExternalForce defined functions....
Posted: Wed Jun 09, 2010 11:46 am
by kasra
How can I define an external force which varies as a function of simulation time?
RE: CustomExternalForce defined functions....
Posted: Wed Jun 09, 2010 11:50 am
by peastman
If you want it to explicitly be a function of the time, that isn't possible. It's a good suggestion though, so go ahead and enter it into the feature request tracker.
What you can do, though, is define a global parameter and make the force depend on that. Then over the course of your simulation, you can periodically update it by calling setParameter() on the Context.
Peter
Re: CustomExternalForce defined functions....
Posted: Tue Sep 29, 2015 1:19 pm
by saurabhbelsare
Hi Dr. Eastman,
Has this feature been implemented? If not, if I use the global parameter, as you have suggested, is there a cost associated with setting the parameter at, say each time step?
Thank you.
Re: CustomExternalForce defined functions....
Posted: Tue Sep 29, 2015 2:12 pm
by peastman
The cost of doing that should be pretty small. Global parameters are designed to be efficient to update.
Peter
Re: CustomExternalForce defined functions....
Posted: Wed Sep 30, 2015 11:50 am
by saurabhbelsare
Hi Dr. Eastman,
I think I've been able to add the force I'm looking for using the global parameter update, as you've suggested.
Thank you.