CustomExternalForce defined functions....
- Kasra Momeni
- Posts: 23
- Joined: Sat Nov 14, 2009 12:06 pm
CustomExternalForce defined functions....
How can I define an external force which varies as a function of simulation time?
- Peter Eastman
- Posts: 2564
- Joined: Thu Aug 09, 2007 1:25 pm
RE: CustomExternalForce defined functions....
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
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
- Saurabh Belsare
- Posts: 32
- Joined: Sat Aug 14, 2010 8:43 am
Re: CustomExternalForce defined functions....
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.
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.
- Peter Eastman
- Posts: 2564
- Joined: Thu Aug 09, 2007 1:25 pm
Re: CustomExternalForce defined functions....
The cost of doing that should be pretty small. Global parameters are designed to be efficient to update.
Peter
Peter
- Saurabh Belsare
- Posts: 32
- Joined: Sat Aug 14, 2010 8:43 am
Re: CustomExternalForce defined functions....
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.
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.