Calculating the energy needed to apply a force to an object I am working on a 2D game that has a shield in it (think scifi energy shield) that can apply a force to objects intersecting the shield boundary, to slow them down, or accelerate them however it wants. This can be thought of as a collision that occurs between the object and the shield boundary with a coefficient of restitution that may be <0 or >1, because the shield will experience the equal and opposite force it applies to the object. My overarching goal is to put a price-tag (in Joule) on forces/impulses that the shield applies to objects. That price-tag should obey two properties:

*

*It should be at least equal to the amount of energy added to the system (when the restitution coefficient is <-1 or >1) to not break conservation of energy

*It should increase with the change in momentum, because energy is a resource in my game, and the more work the shield does, the more it should cost.

I identified two calculations I need to be able to do in order to reach my goals:

*

*Find the amount of energy necessary to slow an incoming object to a given target speed in a given amount of time.

*Find the resulting speed that an object can be slowed down to for a given amount of energy in a given amount of time (the inverse). This is necessary because the shield requests energy but might not get everything, which means the target speed might not be reached.

3 simplifications can be made:

*

*The problem is 2D in my game, but since I only apply forces and consider speed along the shield normal, this can be treated as 1D without loss of generality.

*The forces may be applied off-center, so torque is involved, but again, there are ways to precompute this, so it can be treated as if there were only linear motion involved.

*In the game, when the shield pushes on the object the object pushes back, so there are two bodies that change motion. I think this can be disregarded, one can just talk about relative velocities and so on, and treat the sield as not-moving, but not 100% sure about that.

So far I was not able to find a solution for the second calculation (energy->speed)
My first approach was to just use the change in kinetic energy of the body when decelerated to target speed as the energy cost, but I am not sure if this is correct: Finding the resulting velocity for a given amount of energy has two solutions, since an object with 10 m/s has equal energy to an object with -10 m/s. I implemented this and I encountered cases where it was unclear to me which of the two solutions is the correct one. My takeaway from this was that the delta in kinetic energy did simply not represent the price tag I am looking for: For $0J$ cost the shield can theoretically send an incoming object in any direction it wants, as long as the speed of that object stays the same. That doesn't make sense.
My second approach was to find the work the shield was doing. To my understanding, I can use $W = Fs$ (Work is Force applied over distance) for that: If I can figure out what distance the object travelled while the shield was applying the force to it, I know how much work was done, and since work and energy have the same unit, I also know how much energy this consumes (assuming 100% efficiency and that this magical device somehow does its job).
Given
$$s = v t + \frac{1}{2}at^2$$
$$F = ma$$
$$W = Fs$$
I can construct the following equation
$$s = vt + \frac{Wt^2}{2sm}$$
multipying with s and rearranging gives
$$0 = -s^2 + vts + \frac{Wt^2}{2m}$$
I thought solving for s would give me the distance, and then I can plug s and the given W into $F = \frac{W}{s}$ to find the force, but plotting this equation and playing around with possible values made me realize that this doesn't behave in the way I thought it would. For example, for the parameterisation v = -2, t = 1, m = 1 (see the plot), with W = 0, solutions are s=-2 (which makes sense because it travels at -2 m/s and the velocity doesn't change) and s=0 (not sure what this solution represents?), but with W = 1 solutions are now s<-2 (it got faster??) and s>0 (still...?). I thought maybe I got some sign wrong with W, (e.g. for W=-3 there is a solution s~-1.5 which looks plausible for a deceleration), but for W=-5 there simply are no solutions anymore, which absolutely doesn't make sense to me. So I think I have a fundamental misunderstanding about what this equation expresses, or maybe of the problem as a whole.
I hope someone can point out where I am going wrong here, and what the actual solution looks like. Is the basic goal of putting a price-tag in Joule on what is basically a collision even achievable?
 A: In my opinion your problem is a misunderstanding in the definition of work. If you want to slow down a car, it is not you who does work on the car, but the car does work on you. Let's say the car goes towards the right and you are pushing it to the left. By definition you are doing a negative work, because the dot product of the force (pointing to the left) and the displacement (pointing to the right) is negative. Now when you accelerate this car (after it has stopped moving) the same product of the force and displacement is positive, meaning that now you do work on the car, increasing its kinetic energy.
The fact that the total change in the kinetic energy of the car is zero is of no surprise: first the car does positive work on you and then you do the same amount of positive work on the car. Think about this as a ball colliding with a spring. First the ball slows down by the force that the spring applies to it, but the spring does negative work on the ball. It is the ball that does positive work on the spring. After the ball stopped the spring now starts to push it back and does positive work on it. At the end of the day, the kinetic energy of the ball is the same while the potential energy in the spring is zero. Energy conservation is happy.
Hope this helps.
A: The time taken to slow down the object is irrelevant. Start with
$$v^2-u^2=2as$$
If the object is being slowed down then $W=-Fs$ and you have
$$v^2 - u^2 = - \frac {2W} m
\\ \Rightarrow W = \frac 1 2 m (u^2 - v^2)$$
In other words, work done on object = decrease in kinetic energy. You can either set $v=0$ and find the energy needed to stop an object with initial speed $u$, or fix $W$ at some value less than $\frac 1 2 mu^2$ and find the final speed of the object after work $W$ is done on it
A: Ahh it seems (at least in part) that you are struggling with the difference between change in momentum vs change in kinetic energy.  This is a problem that haunted me for years!!!   Until finally I came to understand that momentum is a vector quantity whereas kinetic energy is a scalar quantity.
Here is a good post which sheds light on the subtleties:  Kinetic energy vs. momentum?
So the delta in momentum ( mass * velocity ) is probably going to be part of your answer.
A ball changes momentum by (mass * velocity * 2) when it bounces perfectly elastically off of another object.
So the momentum of your shield+body should change by the opposite value of the projectiles ‘ delta in momentum..
Say if ball weighs one pound, with vel. 10 m/s,
and if body+shield weighs 10lbs, then the body+shield momentum should change by an equal and opposite amount: 0.2 m/s.
I don’t have equations to answer to your question, and I’m inclined to think that you are going to have a system of differential equations in the end.  (Someone else will likely point to the equations and/or source code you’ll need).  A quick google search of “source code for solving for collision between 2 bodies momentum kinetic energy 2d elastic collision.”  revealed some promising codebases.
