Lethality has been computed using the equation detailed in Fighter Combat, Tactics and Maneuvering, by Robert Shaw in Chapter 1, Fighter Weapons. Essentially, the lethality of a gun can be measured by multiplying the destructive power of its projectile and the number of hits. For nonexplosive projectiles, destructive qualities are generally proportional to Kinetic Energy: One half the mass of the projectile times the square of the velocity. To be more technically correct, the velocity used should be the relative impact velocity, but for comparison purposes, muzzle velocity will do. All rankings are computed in kilo-Joules, the SI unit for energy.
--------------------------------------------------------------------------------
Energy(k) = Kinetic Energy = 1/2 * ( Mass ) * (Velocity ) ^2
Mass = Total mass of projectiles hitting the target in one second = Weight of Fire
Weight of Fire = ( Rate of Fire {#/sec} * Projectile Mass {grams/#} ) / 1000
Velocity = Muzzle Velocity ( meters/sec)
E(k) = 1/2 ( Weight of Fire {kg/sec} ) * ( Muzzle Velocity {meters/second} ) ^2
--------------------------------------------------------------------------------
Cannon are a somewhat different case, since much of the lethality of these weapons are derived from their explosive shells. When computing the lethality of a cannon, an additional amount of Energy from the explosive component of the shell must be added to the Kinetic Energy. The Kinetic Energy is calculated as above.
Total Energy = Explosive Energy + Kinetic Energy
E(t) = E(x) + E (k)
Explosive Energy, E(x), can be calculated by determining: (1.) the type of explosive, (2.) how much explosive is in each projectile, (3.) and the Energy yield per mass of explosive.
(1.) Many different types of explosives were used in cannon shells during the Second World War, such as TNT, Amatol, RDX, HBX, PETN, and Tetryl. The most commonly used by far was TNT. It was used by all the major combatants as their primary shell loading explosive due to its ease of manufacture, stability, low cost, and wide availability. Therefore, it is assumed that for these calculations that TNT is the explosive used in the bursting charge of the cannon shells. Source: Explosives, 4th Edition. By Rudolph Meyer. ISBN: 1-56081-266-4
(2.) The amount of explosive per cannon shell, varies slightly from shell type to shell type, and country to country. However, the percent weight of explosive compared to the total weight of the shell is fairly constant. Since data for each countries shell types is not available, a representative shell for each class was found and its percent mass of explosive was used for the calculations.
20mm Class: (this includes all 20mm & 23mm Cannon Shells)
The US Army's 20mm High Explosive/Incindiary cannon shell used during WWII has the following characteristics.
Total Projectile Mass = 1565 grains
Explosive Mass = 165 grains of TNT
% Mass of Explosive = 10.54 %
Therefore, it is assumed that all 20mm cannon shells contains explosives equal to 10.54 % of their total mass.
Source: US Army's Small Arms Ammunition Pamphlet, 23-1 SSA. August 1968. Picktany Arsenal. Or alternatively, US Army Ammunition Data Sheets, Small Caliber Ammuntion. TM 43-0001
30mm Class: (this includes all 30mm & 37mm Cannon Shells)
The US Army's 30mm High Explosive/Incindiary cannon shell used during WWII has the following characteristics.
Total Projectile Mass = 2295 grains
Explosive Mass = 600 grains of TNT, plus 70 grains of RDX
% Mass of Explosive = 29.19 %
Therefore, it is assumed that all 30mm cannon shells contains explosives equal to 29.19 % of their total mass.
Source: US Army's Small Arms Ammunition Pamphlet, 23-1 SSA. August 1968. Picktany Arsenal. Or alternatively, US Army Ammunition Data Sheets, Small Caliber Ammuntion. TM 43-0001
(3.) The explosive yield of TNT is reported as 1080 kCalories / kilogram of mass, or as 4.10 kJoules/ gram of mass. Since we are working with the Unit of joules already, the second factor will be used here. Source: Explosives, 4th Edition. By Rudolph Meyer. ISBN: 1-56081-266-4
--------------------------------------------------------------------------------
Explosive Energy = (Explosive yield) * (Mass of explosive), therefore
E(x) = 4.10 kJ * (Weight of Fire* 10.54%) for 20mm class shells
E(x) = 4.10 kJ * (Weight of FIre * 29.19%) for 30mm class shells
So, TOTAL ENERGY =
[ 1/2 ( Weight of Fire {kg/sec} ) * ( Muzzle Velocity {meters/second} ) ^2 ] + [ 4.10 kJ * (Weight of Fire (grams/sec) * 10.54%) ]

The normal order when trying too understand this.