# How to find the mathematical relationship between 2 variables?

I am trying to find an equation that semi-accurately describes the 1 psi blast range of a nuclear explosion given the yield. I am using Nukemap on nuclearsecrecy.com to find 1 psi blast range at different yields so I can establish a relationship.

Kilotons | 1 PSI blast range in meters
.0001 | 50
.0002 | 70
.0003 | 80
.0004 | 90
.0005 | 90
.0006 | 100
.0007 | 100
.0008 | 110
.0009 | 110
.001  | 120
.01   | 250
.1    | 550
1     | 1180
10    | 2530
100   | 5460
1000  |11800
10000 |25300
100000|54600


Can anyone help me establish the relationship between yield and blast radius given these numbers? I can see that blast radius increases roughly x10 when yield increases x1000

• Commented May 18, 2022 at 20:47
• Are you bounded by the given min & max values? If so, you might get a good enough approximation by using linear interpolation for each step. Commented May 18, 2022 at 22:26
• Yeah, I'm effectively bounded by the values. Commented May 18, 2022 at 22:28
• This seems like an XY problem, you can probably find formulas for the actual physics instead of reverse engineering Nukemap. Commented May 19, 2022 at 20:45

The same strategy I explained in this answer I showed you works here too.

Take your table of numbers and paste them into a spreadsheet. (I used Google Sheets for this example)

Select the two columns and graph them as a scatterplot. (Insert > Chart)

Select the data series and add a trend line, and fiddle with the type setting until you get a good fit. (Here I found the Power Series looked solid)

Show the equation on the chart.

From the equation, we can see the best fit line is something around
Range = 1172 * POWER(Kiloton, 0.334)

That 0.334 is basically 1/3, which makes sense. If the volume of the blast scales linearly with the kiloton rating, then the radius of the blast will be the cube root. That's also suggested by your observation that range increases x 10 when the kiloton rating goes up x 1000.

We can round the formula's output to the nearest 10, or the nearest 100 for the last three items, and play with the coefficient in the vicinity of 1172 until our rounded values come out as close as possible to the originals.

In this case, I found
Range = ROUND(1176 * POWER(Kiloton, 1/3))
reproduced the original table exactly.

• The rounding in the table is due to how Nukemap formats their distances, it seems to only print 3 significant figures. (10.0 km, 1.00 km, 0.10 km, ...) Knowing that the radius is based on some actual physics can help towards figuring out what the ~1170 coefficient should be without rounding. Commented May 19, 2022 at 20:53

You can get a rough approximation by finding the closest pair of known values that bound your value of interest and use linear interpolation to find the intermediate value. For instance, if you want to estimate the PSI for .000275 kilotons the bounding pair from the kiloton column is .0002, .0003 and the bounding pair from the PSI column is 70, 80. Since the value of interest is 75% of the way between the known kiloton values, calculate the corresponding value that would be 75% of the way between the known PSI values. In this case the result is 77.5 PSI.

The advantages of this approach are that it:

• it's easy to code & debug
• allows you to refine your tables as desired (just plug in more values)
• gives exact answers for known values

The disadvantage of this approach are that it the output is only as smooth as your lookup tables.

Here's a sample implementation in C#:

static double kilotonsToPSI(double k)
{
double[] kilotons = { .0001, .0002, .0003, .0004, .0005, .0006, .0007, .0008,
.0009, .001, .01, .1, 1, 10, 100, 1000, 10000, 100000 };
double[] psi = { 50, 70, 80, 90, 90, 100, 100, 110, 110, 120, 250, 550,
1180, 2530, 5460, 11800, 25300, 54600 };
if(k < kilotons[0])
{
return psi[0];
}
if(k >= kilotons[kilotons.Length - 1])
{
return psi[psi.Length - 1];
}
int index = 0;
while(kilotons[index+1] < k)
{
index++;
}

double lowerK = kilotons[index];
double upperK = kilotons[index + 1];
double percentage = (k - lowerK) / (upperK - lowerK);

double lowerPsi = psi[index];
double upperPsi = psi[index + 1];
double diffPsi = upperPsi - lowerPsi;

return diffPsi * percentage + lowerPsi;
}


For large tables, consider loading the data from file rather than hardcoding the values.