Simulating differential games (specifically pursuit/evasion scenarios) using python.
Differential equations
source: Fundamentals of Aerospace Navigation and Guidance by Kabamba & Girard
Differential equation solver
Python/Scipy solv_ivp
or could implement as a discrete time system...
Player strategy ideas (for choosing heading angles)
- Minimize/maximize distance
- Move in tangential direction of attacker
- Knowing previous history of other player or not
- Neural network / machine learning for creating strategy using sklearn libraries (maybe...)
Pursuer strategies
phiCalcSingleState
- calculates the requiredphi
to reach the evader using a single snapshot (issues witharctan2
range wrap)phiCalcThetaHistory
- calculates the requiredphi
to reach the evader using previoustheta
history (solves thearctan2
wrap issue)
Evader strategies
randomPsi
- random direction changes every 20 steps
Algorithms
- Initialize with some set of parameters.
- Simulate first step using ODE solver.
- Choose heading angles using strategy.
- Repeat 2 and 3 until time runs our or collision occurs.
Notes
- wavy behavior exhibited when using
phiCalcSingleState
is solved usingnp.unwrap
with previous history inphiCalcThetaHistory
- not sure if this is a bug or not: whenever the pursuer misses, it makes a loop.