Figuring out force required to get an object from A to B

  • Thread starter Thread starter newcomma
  • Start date Start date
  • Tags Tags
    Force
Click For Summary
SUMMARY

This discussion focuses on calculating the force required to move an object from position A to position B within a specified time T in a video game context. The user references the damping formula F(t) = -k*(x(t) - xmouse(t)) - c*v(t), where k is the spring constant and c is the viscous damping coefficient. Key challenges include constraining the damping formula to ensure the object reaches the target position within time T and matching both target position and velocity while maintaining smooth motion. The user also considers using kinematic equations for displacement and acceleration to achieve the desired outcome.

PREREQUISITES
  • Understanding of kinematic equations, specifically displacement and acceleration.
  • Familiarity with damping forces in physics, including spring constants and viscous damping coefficients.
  • Basic knowledge of iterative processes for real-time calculations in game development.
  • Concept of relative motion and prediction of moving targets.
NEXT STEPS
  • Research "Kinematic equations for variable acceleration" to understand how to adjust acceleration dynamically.
  • Explore "Predictive targeting algorithms" to improve accuracy in aiming for moving targets.
  • Study "Physics-based motion in game development" to implement realistic movement mechanics.
  • Investigate "Numerical methods for iterative calculations" to refine the approach for real-time adjustments.
USEFUL FOR

Game developers, physics simulation engineers, and anyone involved in creating realistic motion mechanics in interactive environments.

newcomma
Messages
2
Reaction score
0
I'm trying to work out as part of video game how to do the following:

  • I have an object A with a current 3D position and velocity
  • I have a target B with a different position and velocity
  • I need to match the position and velocity within a target time T

I want to calculate how to get from A to B within T, or I guess what force I should be adding at each time step. I took a look at a similar question

https://www.physicsforums.com/threa...e-an-object-from-one-point-to-another.327804/
F(t)=−k∗(x(t)−xmouse(t))−c∗v(t)

The undefined symbols are:
xmouse(t)=
position of the mouse at time t
k = "Spring" constant, force of attraction between object and mouse
c = "Viscous damping coefficient", force that slows the object down​

And whilst the damping formula provided here allows nice smooth motion for an object to reach the other, I'm unsure how to

1.) Constrain this damped formula so that I can guarantee that the object will be at the target position within a given amount of time.
2.) Match both the target position and velocity, whilst ideally still having some damping coeffecients to control how nice the curvature is.

I could calculate getting to the position in the correct time using suvat equations and constant acceleration, but this of course doesn't compensate for the velocity change either.

My physics knowledge is relatively basic, I'd appreciate any help!

Thanks in advance.
 
Last edited:
Physics news on Phys.org
I think calculating the force is the least of your problems. This sounds difficult to me.

For example you could start by working out how long it takes the missile to reach the target based on their current relative positions... but in the time it takes to get there the target will have moved. So you need to predict where they target will be and aim for that spot. However it might take longer to get to that spot and the missile will have moved even further. I think you might need some sort of iterative process just to arrive at an aiming point.
 
Thanks for the response. So I can figure out how to get from A to B at time T using the kinematic displacement equation, or more specifically:

where V_0 and P_0 are initial velocity and initial position.

P(t) = P_0 + t*V_0 + 0.5*(t^2)*Accel

So I know after T seconds the position is P_1 (or destination position), this allows me to rearrange this kinematic equation to basically find a constant acceleration that gets A to B in time T.

If B is moving then I can keep recomputing this at each time step so it's iterative.

However the velocity it's traveling at is not the velocity I want it to end up at, which I guess requires variable acceleration somehow so I don't think this kinematic equation is useful here. Hence why I was looking at that damping equation as it smoothly gets A to B, but no time constraints.
 

Similar threads

Replies
3
Views
991
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
12
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
5
Views
2K