README
Math::SalvoCombatModeling
Raku package for the mathematical representation of missile battles. Certain battles involving drones and continuous fire can be also represented.
Installation
zef install Math::SalvoCombatModelingDetails
The original salvo combat model provides a mathematical representation of anti-ship missile battles between modern warships, [Wk1].
The Heterogeneous Salvo Combat Model (HSCM) extension of the original model allows more detailed and comprehensive modeling of missile, drone, and continuous fire combat scenarios.
The package provides functions for building HSCMs and -- very importantly -- functions reviewing the variables and definitions used in HSCMs.
A model generated with the package function
heterogeneous-salvo-modelgives matrix-based formulas for computing the damage inflicted on the forces.The package has also functions for damage calculations using standard, summation formulas.
The implementation of the Raku package "Math::SalvoCombatModeling" closely follows the implementation of the Wolfram Language (WL) paclet "SalvoCombatModeling", [AAp1].
Since WL has (i) symbolic builtin computations and (ii) a mature notebook system the salvo models computation, representation, and study with WL is much more convenient.
Usage examples
Here we generate a homogeneous salvo combat model:
use Math::SalvoCombatModeling;
my $m = heterogeneous-salvo-model(['A', 2], ['B', 1])# {A => {defense-matrix => [[(((gamma(A,B,1,1))*(delta(A,B,1,1))*(capitaltheta(A,B,1,1))*(tau(A,B,1,1)))/(zeta(A,1))) 0] [0 (((gamma(A,B,2,1))*(delta(A,B,2,1))*(capitaltheta(A,B,2,1))*(tau(A,B,2,1)))/(zeta(A,2)))]], offense-matrix => [[((beta(B,A,1,1))*((sigma(B,A,1,1))*(tau(B,A,1,1))*(rho(A,B,1,1)))*(capitalpsi(B,A,1,1)))/(zeta(A,1))] [((beta(B,A,1,2))*((sigma(B,A,1,2))*(tau(B,A,1,2))*(rho(A,B,2,1)))*(capitalpsi(B,A,1,2)))/(zeta(A,2))]], units => [A[1] A[2]]}, B => {defense-matrix => [[(((gamma(B,A,1,1))*(delta(B,A,1,1))*(capitaltheta(B,A,1,1))*(tau(B,A,1,1)))/(zeta(B,1))) + (((gamma(B,A,1,2))*(delta(B,A,1,2))*(capitaltheta(B,A,1,2))*(tau(B,A,1,2)))/(zeta(B,1)))]], offense-matrix => [[((beta(A,B,1,1))*((sigma(A,B,1,1))*(tau(A,B,1,1))*(rho(B,A,1,1)))*(capitalpsi(A,B,1,1)))/(zeta(B,1)) ((beta(A,B,2,1))*((sigma(A,B,2,1))*(tau(A,B,2,1))*(rho(B,A,1,2)))*(capitalpsi(A,B,2,1)))/(zeta(B,1))]], units => [B[1]]}}The following table shows model variables and descriptions using salvo-variable-rules:
use Data::Translators;
salvo-variable-rules(['A',1], ['B', 2])
andthen .map({ <variable description> Z=> [$_.key, $_.value] })ยป.Hash
andthen .&to-html(field-names=> <variable description>, align => 'left')Scope
Colors or emoji characters (like flags) can be used to designate the forces. For example, here is generated a model for "Red vs. Blue":
my $m = heterogeneous-salvo-model(['๐ฅ', 2], ['๐ฆ', 2]);# {๐ฅ => {defense-matrix => [[(((gamma(๐ฅ,๐ฆ,1,1))*(delta(๐ฅ,๐ฆ,1,1))*(capitaltheta(๐ฅ,๐ฆ,1,1))*(tau(๐ฅ,๐ฆ,1,1)))/(zeta(๐ฅ,1))) + (((gamma(๐ฅ,๐ฆ,1,2))*(delta(๐ฅ,๐ฆ,1,2))*(capitaltheta(๐ฅ,๐ฆ,1,2))*(tau(๐ฅ,๐ฆ,1,2)))/(zeta(๐ฅ,1))) 0] [0 (((gamma(๐ฅ,๐ฆ,2,1))*(delta(๐ฅ,๐ฆ,2,1))*(capitaltheta(๐ฅ,๐ฆ,2,1))*(tau(๐ฅ,๐ฆ,2,1)))/(zeta(๐ฅ,2))) + (((gamma(๐ฅ,๐ฆ,2,2))*(delta(๐ฅ,๐ฆ,2,2))*(capitaltheta(๐ฅ,๐ฆ,2,2))*(tau(๐ฅ,๐ฆ,2,2)))/(zeta(๐ฅ,2)))]], offense-matrix => [[((beta(๐ฆ,๐ฅ,1,1))*((sigma(๐ฆ,๐ฅ,1,1))*(tau(๐ฆ,๐ฅ,1,1))*(rho(๐ฅ,๐ฆ,1,1)))*(capitalpsi(๐ฆ,๐ฅ,1,1)))/(zeta(๐ฅ,1)) ((beta(๐ฆ,๐ฅ,2,1))*((sigma(๐ฆ,๐ฅ,2,1))*(tau(๐ฆ,๐ฅ,2,1))*(rho(๐ฅ,๐ฆ,1,2)))*(capitalpsi(๐ฆ,๐ฅ,2,1)))/(zeta(๐ฅ,1))] [((beta(๐ฆ,๐ฅ,1,2))*((sigma(๐ฆ,๐ฅ,1,2))*(tau(๐ฆ,๐ฅ,1,2))*(rho(๐ฅ,๐ฆ,2,1)))*(capitalpsi(๐ฆ,๐ฅ,1,2)))/(zeta(๐ฅ,2)) ((beta(๐ฆ,๐ฅ,2,2))*((sigma(๐ฆ,๐ฅ,2,2))*(tau(๐ฆ,๐ฅ,2,2))*(rho(๐ฅ,๐ฆ,2,2)))*(capitalpsi(๐ฆ,๐ฅ,2,2)))/(zeta(๐ฅ,2))]], units => [๐ฅ[1] ๐ฅ[2]]}, ๐ฆ => {defense-matrix => [[(((gamma(๐ฆ,๐ฅ,1,1))*(delta(๐ฆ,๐ฅ,1,1))*(capitaltheta(๐ฆ,๐ฅ,1,1))*(tau(๐ฆ,๐ฅ,1,1)))/(zeta(๐ฆ,1))) + (((gamma(๐ฆ,๐ฅ,1,2))*(delta(๐ฆ,๐ฅ,1,2))*(capitaltheta(๐ฆ,๐ฅ,1,2))*(tau(๐ฆ,๐ฅ,1,2)))/(zeta(๐ฆ,1))) 0] [0 (((gamma(๐ฆ,๐ฅ,2,1))*(delta(๐ฆ,๐ฅ,2,1))*(capitaltheta(๐ฆ,๐ฅ,2,1))*(tau(๐ฆ,๐ฅ,2,1)))/(zeta(๐ฆ,2))) + (((gamma(๐ฆ,๐ฅ,2,2))*(delta(๐ฆ,๐ฅ,2,2))*(capitaltheta(๐ฆ,๐ฅ,2,2))*(tau(๐ฆ,๐ฅ,2,2)))/(zeta(๐ฆ,2)))]], offense-matrix => [[((beta(๐ฅ,๐ฆ,1,1))*((sigma(๐ฅ,๐ฆ,1,1))*(tau(๐ฅ,๐ฆ,1,1))*(rho(๐ฆ,๐ฅ,1,1)))*(capitalpsi(๐ฅ,๐ฆ,1,1)))/(zeta(๐ฆ,1)) ((beta(๐ฅ,๐ฆ,2,1))*((sigma(๐ฅ,๐ฆ,2,1))*(tau(๐ฅ,๐ฆ,2,1))*(rho(๐ฆ,๐ฅ,1,2)))*(capitalpsi(๐ฅ,๐ฆ,2,1)))/(zeta(๐ฆ,1))] [((beta(๐ฅ,๐ฆ,1,2))*((sigma(๐ฅ,๐ฆ,1,2))*(tau(๐ฅ,๐ฆ,1,2))*(rho(๐ฆ,๐ฅ,2,1)))*(capitalpsi(๐ฅ,๐ฆ,1,2)))/(zeta(๐ฆ,2)) ((beta(๐ฅ,๐ฆ,2,2))*((sigma(๐ฅ,๐ฆ,2,2))*(tau(๐ฅ,๐ฆ,2,2))*(rho(๐ฆ,๐ฅ,2,2)))*(capitalpsi(๐ฅ,๐ฆ,2,2)))/(zeta(๐ฆ,2))]], units => [๐ฆ[1] ๐ฆ[2]]}}The sub heterogeneous-salvo-model takes an optional parameter-function argument.
Without that parameter function being specified the salvo model is returned as hashmap of strings (as above.)
If the parameter function is specified the corresponding numeric computations are done.
For complete worked example see the notebook "Battle-of-Coronel.ipynb"
or the corresponding script "Battle-of-Coronel.raku".
To see the combat salvo modeling definitions in Bulgarian, English, or Russian, the sub salvo-notion-definitions can be used:
salvo-notion-definitions('English')
==> to-html(align => 'left')References
Articles, theses
[MJ1] Michael D. Johns, Steven E. Pilnick, Wayne P. Hughes, "Heterogeneous Salvo Model for the Navy After Next", (2000), Defense Technical Information Center.
[TB1] Thomas R. Beall, "The Development of a Naval Battle Model and Its Validation Using Historical Data", (1990), Defense Technical Information Center.
[Wk1] Wikipedia entry, Salvo combat model.
Packages, paclets
[AAp2] Anton Antonov, SalvoCombatModeling, Wolfram Language paclet, (2024), Wolfram Language Paclet Repository.