This time one is looking at the intensity of the B field within the cylinder as compared to outside the cylinder.
A decent way to 'measure' the magnetic field is to look at the density of the field lines. Or in my case I looked at the distance between two adjacent field lines.
The difficult one to observe is the strength, density of lines inside
the cylinder. Conveniently enough, there is always a field line that goes
straight through the cylinder, crossing its axis.
So to get the separation all one has to do is to measure the distance
the next one passes above the axis.
The relative field strength outside is easy. As we will see.
I made some changes to the 502 program: New program
There are a few key differences.
In particular right after the beginning of the FOR loop, there are four IF THEN statements having to do with the variable flag.
When the field line crosses the center axis, y = 0, flag is set to 1. That signals the computer to get to work the next time around. That next time being the field line that passes over the origin. On that pass, the WHILE loop checks to see if x is near zero. When it does, it prints out the y value and bingo I have my field line separation inside the cylinder. For some of the higher ms I found it wasn't giving me the correct y, but the y for the field line that passed through the origin. Which was of course zero (usually very near zero). So I had it print out the one that passes over the origin and then the one that passes over that. Which is why I have 3 IF THEN statements preceding the "IF flag lt 2 ..."
The external field strength is easy, that's just the separation of the y0s in the FOR loop, step.
So a, the sheilding factor, is step/(that y displacement). At the appropriate time, the program fires out that value.
Let's see how it did for various values of m. For these runs, the outer radius was 1 and the inner radius was .5.
m = 2, a=1.147

m = 10, a = 2.21:

m = 20, a = 2.56:

m = 50, a = 7.95 (Now I have to increase the number of field lines on the outside because so few manage to penetrate):

m = 200, a = 47.6 one has to even cut down the number of field lines shown because it takes so damn long.

m = 500, a = 142:

m = 1000, a = 233:

Next was to calculate the cheapest way to get a factor of 10 sheilding for a cylinder of inner radius 10cm.
For a material of m = 10. I found that one could attain a shielding factor of 12.7 if the outer radius was 14cm.

The mass (calculated in beginning of the program) would then be 238 kg/m or $476 per meter of length.
However, for the material of m = 100. One could attain a shielding factor of 13.3 if the outer radius was just 10.4cm

The mass would be just 20.2 kg/m or $404 per meter of length. Better sheilding, better price and less mass to haul around.