I am using Chipmunk's physics engine to simulate 2D classical mechanics of solid polygons (excellent by the way!). The only way you can alter the spontaneous behaviour of the the simulated objects is to apply forces and impulses to them.
I am given a certain amount $E$ of energy to spend (= to input into the system) over a certain period of time $\Delta T$, that I need to use to alter the motion of a given body. By the time I need to do so, it is rather difficult to access its mass, instantaneous speed, kinetic moment, energy, or other forces applied to it..
(I can still track its shape, position and rotation.)
However, I feel like I don't need to access all these to actually spend this energy and alter its motion (with the only tools I am given) provided I decide I will do it by applying a single force $F$ to it over the period $\Delta T$, and provided I give myself an application point $P$ and a direction $d$ (both relative to the body's actual position and rotation).
To be more precise about "my feeling": no matter the actual situation of the body, I will apply this force and spend this energy over $\Delta T$:
- if it turns out to be a very heavy object, then it won't move a lot
- if it turns out to be in a super-fast race against $d$, then its speed won't change a lot
- if it turns out to be blocked under a stone, then it won't move a lot
- if it turns out to be free, light, resting.. then the change will be visible..
(I am aware that the concept of force might be the wrong one to consider here, so I just want to make sure we'll agree about what I am talking about, whatever it might be. It is exactly like this body had a certain amount of energy to spend and used it to move itself without actually knowing anything about the world around.)
If I was right about this feeling that I do have everything I need to perform this alteration without spending more than $E$, then how would I compute the actual intensity of $F$ to be applied?
If I was wrong, then what information am I missing?
[EDIT]: It turns out from the discussion that I actually need to give myself a certain cost of applying a force $\beta\ (m.s^{-1})$, inspired from biophysics. Then the actual energy spent is simply $$E = \beta \int_{\Delta t} F(t) \mathrm{d}t,$$ and I just have to take care that it will never be lower than the actual work $W$ done by $F$ over $\Delta t$.
To achieve this, one solution seems to keep constantly track of the actual useful energy spent, which is difficult but.. not undoable.