Projectile Prediction with Acceleration & Delay

In summary, the conversation is about a private software project that involves predicting projectile positions. The code uses a coordinate system and sets the projectile as the origin and the target on the X axis. The algorithm works by setting the target's y velocity as the projectile's y velocity, using the Pythagorean theorem to find the projectile's x velocity, and calculating the time of impact. However, there are some errors and undefined variables in the problem description, such as the target's minVelocity being specified as a float but used as a vector in the code. It is also unclear what rules govern the target's evasion and the compensation for it.
  • #1
Orianna
Hello,

I'm working on a (private) Software Project and Part of that is finding a Way to Predict Projectile Positions. My thought's are explained from a Code View a little bit, but I tried to clarify everything so everyone could understand what's going on.

(It's my first time in this Forum, I hope i posted in the right Section)

Data Available

Target.Position (Vec3 x, y, z)
Target.minVelocity (float)
Target.maxVelocity (float)
Target.Accel (float)
Target.Width (integer/float)

Projectile.Position (Vec3 x, y, z)
Projectile.minVelocity (float)
Projectile.maxVelocity (float)
Projectile.Accel (float)
Projectile.Delay (integer)
Projectile.Range (integer; Only Relevant if Target Outruns Projectile)
Projectile.Width (integer/float)

Extra.Delay (integer, usually 1ms to 80ms)

Process
^This is what I've got so far.

targetDirection = Vector.Normalize(Target.Position - Projectile.Position)
targetVelocityOrth = Vector.Dot(Target.minVelocity, targetDirection) * targetDirection
targetVelocityTang = Target.minVelocity - targetVelocityOrth

float velSpeed = targetVelocityTang.Magnitude;

if (velSpeed > Projectile.minVelocity)
exit
else
float OrthSpeed = Sqrt(Projectile.Speed * Projectile.Speed - velSpeed * velSpeed)
Vec3 velOrth = targetDirection * OrthSpeed

Vec3 Result = targetVelocityTang + velOrth

float tCollision = ((Projectile.Position - Target.Position).Magnitude - Projectile.Width - Target.Width) / (velOrth.Magnitude-targetVelocityOrth.Magnitude)

Vec3 ProjectileVel = velOrth + targetVelocityTang
Vec3 PredictedPos = Projectile.Position + ProjectileVel * tCollision

"Problem"

Took me quite a while to figure out all of this (and a lot of Internet Searches) but now I'm stuck with a Solution that doesn't use Delay or Acceleration. How would one go further down the Road? I've read that Kinematic Equations are used for Acceleration, but which one exactly?

Basicly I'm just looking how to further progess with this algorithm/equation.
 
Physics news on Phys.org
  • #2
A bit more background on the problem would have been helpful. I had to read the code to even start to understand what you are talking about.

As written, the code assumes a target moving at its given initial ("minimum") velocity starting from its given initial position. The projectile is launched on an intercept course moving at its given initial ("minimum") speed starting from its given initial position. If an intercept is impossible, the code simply exits without making a prediction.

The algorithm you have chosen works by (implicitly) setting up a coordinate system with the projectile at the origin and the target positioned on the X axis. An inertial intercept requires that the projectile and target share the same y coordinate at all times. Thus, the target's y velocity (targetVelocityTang) immediately gives the projectile's y velocity. The Pythagorean theorem yields the projectile's x velocity. The closing rate between projectile and target is then given by the difference in x velocities (velOrth) and the time of impact is given by initial separation divided by closing velocity.

The collision position is then simply projectile position at the time of impact. Equivalently, it would be the target position at the time of impact.

There are some errors in the problem description and undefined variables in the code. In particular, the givens of the problem specify target.minVelocity as a float. but the program code uses target.minVelocity as a vector ( "Vector.Dot(Target.minVelocity, targetDirection)" ). Projectile.Speed is never defined.The full version of the problem about which you ask appears to assume a target that accelerates (according to a fixed evasion plan or according to a plan that must be actively countered?) We are left to guess at the constraints on these accelerations.

Target.delay = Delay in seconds after start of scenario before a period of acceleration can begin?
Target.maxVelocity = Maximum speed that can be attained, but thrusters can stay on forever? -- or --
Target.maxVelocity = Thrusters burn out after delta-V equal to Target.maxVelocity - Target.minVelocity

Presumably the projectile operates under similar constraints.

It is difficult to offer advice on a problem without a good problem statement. Offhand, this sounds like a challenging optimization problem.
 
  • #3
@jbrigs444

First of all thanks for your reply.

If an intercept is impossible, the code simply exits without making a prediction.

This is wanted Behavior. If an Intercept is Impossible the Projectile shouldn't be fired. (Prediction could also simply be Vec3(0,0,0))

target.minVelocity as a float

Since the Prediction happen's in 2D Space, I don't see why a Vector would be necessary here? The Projectile Moves Forward at a Fixed Speed (Unless Acceleration is in Place)

Projectile.Speed is never defined.
The Projectile Speed will be available at "Runtime" (so to speak (usually 800-2000 "Unit's" (meter per second, if that's easier))) a made up number in this Example could be 1400.

(according to a fixed evasion plan or according to a plan that must be actively countered?) We are left to guess at the constraints on these accelerations.

The Evasion of the Target must be "actively countered", the Acceleration is usually pretty small (Ranging from 5-40% for about 1-6 Seconds, In one Special Case it's 200%)

Target.delay = Delay in seconds after start of scenario before a period of acceleration can begin?
Target.maxVelocity = Maximum speed that can be attained, but thrusters can stay on forever? -- or --
Target.maxVelocity = Thrusters burn out after delta-V equal to Target.maxVelocity - Target.minVelocity

Delay = After Prediction has been made there's a (Example) 0.25 Second Delay before the Projectile is actually fired
Target.maxVelocity = Max. Velocity Possible, "Thrusters" Stay On Until Maximum Range is reached.

Hope that helps with clarification. Thank's again!
 
  • #4
Orianna said:
Since the Prediction happen's in 2D Space, I don't see why a Vector would be necessary here? The Projectile Moves Forward at a Fixed Speed (Unless Acceleration is in Place)
You used a dot product on it. So it must be a vector. There is no other choice.

As for countering the evasion, you have not given us the rules by which the evasion operates or is allowed to operate. Nor the rules by which our compensation is allowed to operate.
 
  • #5
jbriggs444 said:
You used a dot product on it. So it must be a vector. There is no other choice.

Getting the Projectile Speed as a Vector would be possible too in this Case (Just re-checked), So this shouldn't be a Problem.

As for countering the evasion, you have not given us the rules by which the evasion operates or is allowed to operate. Nor the rules by which our compensation is allowed to operate.

Which Type of Ruleset exactly?
The Target Can Evade On The X/Y Axis with his Speed for X Units (525 Speed = Can Move 525 Unit's Up, Down, Left, Right And Diagonal)
Compensation is not possible. Once the Projectile is Fired, It can't change any Variables expect Speed (with Acceleration, otherwhise not even that)
 
Last edited by a moderator:
  • #6
Orianna said:
Getting the Projectile Speed as a Vector would be possible too in this Case (Just re-checked), So this shouldn't be a Problem.
I did not say that it was a problem. It was, however, a bug in your code.

Which Type of Ruleset exactly?
The rules governing the target's evasion. If we do not know what he can do, and what we can do, how can we make an informed decision?
The Target Can Evade On The X/Y Axis with his Speed for X Units (525 Speed = Can Move 525 Unit's Up, Down, Left, Right And Diagonal)
Yes, I understand that it is a two dimensional intercept problem. That's a start.

He can evade for "X units". But that contradicts the problem statement. We are given an acceleration delay, an acceleration and a maximum speed. We are not given a variable named X. Nor had we been told anything that implies that his evasion capability depends on his Speed.

Can you please define the problem properly?
Compensation is not possible. Once the Projectile is Fired, It can't change any Variables expect Speed (with Acceleration, otherwhise not even that)
But previously you had stated:
Orianna said:
The Evasion of the Target must be "actively countered",
Let me see if I can put this into my own words.

The target launches. We wish to intercept. We have the option to launch immediately or to delay our launch. We can choose launch angle. We are locked into a launch speed of Projectile.minVelocity. After launch, our projectile will continue on a straight line course. However, we can optionally choose to accelerate up to Projectile.maxVelocity while in flight, provided we wait at least Projectile.delay before initiating an in-flight burn. It is not clear whether the Projectile is allowed to slow down in flight. It is not clear whether we can throttle back. It is not clear whether Projectile.delay is a delay imposed on all in-flight acceleration changes.

The target has the ability to accelerate (in which directions?) within the bounds imposed by Target.maxVelocity.

We already have an algorithm that can determine launch angle, time in flight and intercept position. You want to improve the algorithm to make use of in-flight acceleration. That means that we need an interception strategy. What do you have in mind for an interception strategy?
 
  • #7
It is not clear whether the Projectile is allowed to slow down in flight. It is not clear whether we can throttle back. It is not clear whether Projectile.delay is a delay imposed on all in-flight acceleration changes.

The projectile can't slow down only accelerate until it reaches maximum speed.

To elaborate a little bit more let me give an Example:
We have a Railgun. The Railgun needs 0.25 Seconds (<- Delay) to load a Shot (<- Projectile) but our Aiming Algorithm already Aim's before the Shot is loaded (Yes, bad product design, doesn't matter). The Projectile now fires at a fixed Speed (Let's say 500 Unit's per Second). Projectile can't accelerate.

Some of these's Projectile's are Special. We can overload our Railgun every 120 Seconds (Irrelevant, this is just to clarify that only a small amount of projectiles are accelerated during flight) to fire a Projectile which has a 200% Speed Increase Actually Irrelevant this is an Edge Case I will handle in Code.

Delay only happens when charging the Gun everything else is unaffected. Flight Path of the Projectile can't be changed in any way now.

The target has the ability to accelerate (in which directions?) within the bounds imposed by Target.maxVelocity.

Continuing the Analogy above:
During the Flight time of our now fired Projectile the Target has the Ability to Move. (It could try to "outrun" the Projectile, or trick the Prediction by starting to move backwards instead of forwards during the Flighttime of Projectile)

A simple example would be:

Projectile is fired with a speed of 1400 units per second after a delay of 0.25 seconds (in these 0.25 seconds the target can move already). The target can move 300 units per second in any direction and is 2100 units away from the projectile initial start point so during these 1.75 seconds of impact it can try to evade the projectile. The target can use this Exosuit (Imagination...) to accelerate for 10-50% for these 1.75 Seconds.

Achieved Result would be: Make the most accurate possible prediction where the target will be in the next 1.75 seconds and fire the projectile at this location

If the target can simply outrun the projectile (e.g. if the target could move out of the max range of the projectile in the next 1.75 seconds) no prediction will be made (this will be done code wise and isn't really important here).

He can evade for "X units". But that contradicts the problem statement. We are given an acceleration delay, an acceleration and a maximum speed. We are not given a variable named X. Nor had we been told anything that implies that his evasion capability depends on his Speed.

See Analogy Above. (X = 300 Unit's in this Case)
 
Last edited by a moderator:
  • #8
In the absence of a clear problem description including projectile capabilities, target capabilities and the quantity that you want to calculate, I cannot offer any assistance.
 
  • Like
Likes BvU

1. What is projectile prediction with acceleration and delay?

Projectile prediction with acceleration and delay is a scientific method used to predict the trajectory of a projectile, taking into account the effects of acceleration and delay on its motion. This method is often used in fields such as physics, engineering, and ballistics.

2. How does acceleration affect projectile motion?

Acceleration is the rate of change of velocity, and it has a significant impact on projectile motion. When a projectile experiences acceleration, its velocity changes, causing it to deviate from its original path. This can result in a curved trajectory instead of a straight line.

3. What is the role of delay in projectile prediction?

Delay refers to the interval of time between when a projectile is launched and when it reaches its target. During this delay, the projectile is affected by various factors such as air resistance, gravitational pull, and wind. These factors can alter the projectile's trajectory, making it crucial to consider in projectile prediction.

4. How is projectile prediction with acceleration and delay useful?

Projectile prediction with acceleration and delay is useful in a variety of applications, including military operations, sports, and space exploration. It allows for more accurate and precise calculations of a projectile's trajectory, which can lead to better performance and outcomes.

5. What are some limitations of projectile prediction with acceleration and delay?

Projectile prediction with acceleration and delay is based on mathematical models and assumptions, which may not always reflect real-world conditions accurately. Factors such as air resistance, wind, and surface conditions can also affect a projectile's motion, making it challenging to predict with 100% accuracy.

Back
Top