-1

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.

Qmechanic
  • 220,844
iago-lito
  • 113

2 Answers2

1

I'm not quite sure I understand what you mean, but if you have an amount of energy to spend:

$$\Delta E = E_2 - E_1 = \frac{1}{2} m_1 v_2^2 - \frac{1}{2} m_1 v_1^2 = \frac{1}{2} m_1 \left( v_2^2 - v_1^2 \right)$$

Using this, you can calculate $v_2$ if $v_1$ is known.

The force to achieve this can be calculated by

$$m \Delta v = \Sigma F \Delta t $$

I'm not sure this is exactly what you want, but I hope it'll help

edit:

In the case of energy dissipation with work, as I'm not able to sustain large forces for a large period of time, this might be a good approach to model the force delivered by a humon. Perhaps you could make the Force applied a function of time. If you make it asymptoticaly decreasing over time, then you can use the value $\beta$ to scale it such that the integral will be equal to $E$.

The exact distribution of this energy depends on the problem. You're converting your initial energy budget to useful energy (work e.g. $F \cdot ds$) and useless energy (the cost of delivering a force). The problem is that the ratio between these two is dependent on the situation. If you stumble upon a rock, and no movement occurs it's only useless energy, whereas if not, you convert all your energy to work. I think you'll need to consider the instantenous state every time to see what case applies.

ROIMaison
  • 761
0

The amount of work done by a force is equal to

$$ dW = \vec{F} \cdot d\vec{x}, $$

however the displacement $d\vec{x}$ in the next time step it not known. If the total acceleration is low you can approximate the displaced distance with $d\vec{x} = \vec{v}\Delta t$. If not, then you also want to take the acceleration into account. I do not know what kind of time integration Chipmunk uses, it will probably look something like $d\vec{x} = \vec{v}\Delta t + \frac{1}{2}\vec{a}\Delta t^2$. Or you could even use an iterative method calculating the new position and calculate the new force according that that, but this is more computational expensive.

fibonatic
  • 5,916