dynamic_2d_lanchester_solve
Simulate 2D Lanchester combat model to predict winner, survivors, and time to annihilation, with numerical trajectories and optional phase portrait.
Instructions
Simulate a Lanchester combat model x' = f(x,y), y' = g(x,y) with analytic time-to-annihilation.
Args: eq_x, eq_y: Math expressions (classic default is x'=-αy, y'=-βx). alpha, beta, gamma, epsilon, mu, delta: Greek parameter values. x0, y0: initial force sizes. t0, t_fin, h: simulation grid. plot: When True, also return a PNG phase portrait of the battle.
Returns:
Dict with the analytic winner/survivors, state equation and the
numerical trajectories. With plot=True a list [dict, Image] is
returned instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| h | No | ||
| mu | No | ||
| t0 | No | ||
| x0 | No | ||
| y0 | No | ||
| beta | No | ||
| eq_x | No | -α * y | |
| eq_y | No | -β * x | |
| plot | No | ||
| alpha | No | ||
| delta | No | ||
| gamma | No | ||
| t_fin | No | ||
| epsilon | No |