Uploaded May 2021 | Updated September 2026, 2 weeks ago
In this next series of videos, I will explain to you exactly the steps I took to simulate the ferrocell as I showed in the previous teaser video. NOTE: the volume of this video might be lower than usual since I accidentally recorded with the system microphone and not the better mic that I have and so you may need to turn up your volume for this one.
Here is a link to the paper on MagPyLib:
sciencedirect.com/science/article/pii/S2352711020300170
Here is a link to the MagPyLib quick start guide:
magpylib.readthedocs.io/en/latest
Here is my Python code for generating the magnetic moments:
import random
from magpylib.source.magnet import Cylinder
magnet_Height= 25
magnet_Diameter= 20
magnet_Strength = 14800
ferrocell_Diameter = 50
ferrocell_Height = 10
ferrocell_Half = 5
thickness = 0.001
s = Cylinder( mag = [0,0,magnet_Strength], dim = [magnet_Diameter,magnet_Height])
f = open('c:/Magnets/MagneticField_300000_2.txt', 'a')
for x in range(300000):
x = (random.random() *ferrocell_Diameter) -ferrocell_Diameter/2
y = (random.random() *ferrocell_Diameter) -ferrocell_Diameter/2
z =magnet_Height +ferrocell_Half + (random.random() * thickness)
v = s.getB([x,y,z])
f .write(str(x) + " " + str(y) + " " + str(z) + " " + str(v[0]) + " " + str(v[1]) + " " + str(v[2]) + "\n")
f.close()
In this next series of videos, I will explain to you exactly the steps I took to simulate the ferrocell as I showed in the previous teaser video. NOTE: the volume of this video might be lower than usual since I accidentally recorded with the system microphone and not the better mic that I have and so you may need to turn up your volume for this one.
Here is a link to the paper on MagPyLib:
sciencedirect.com/science/article/pii/S2352711020300170
Here is a link to the MagPyLib quick start guide:
magpylib.readthedocs.io/en/latest
Here is my Python code for generating the magnetic moments:
import random
from magpylib.source.magnet import Cylinder
magnet_Height= 25
magnet_Diameter= 20
magnet_Strength = 14800
ferrocell_Diameter = 50
ferrocell_Height = 10
ferrocell_Half = 5
thickness = 0.001
s = Cylinder( mag = [0,0,magnet_Strength], dim = [magnet_Diameter,magnet_Height])
f = open('c:/Magnets/MagneticField_300000_2.txt', 'a')
for x in range(300000):
x = (random.random() *ferrocell_Diameter) -ferrocell_Diameter/2
y = (random.random() *ferrocell_Diameter) -ferrocell_Diameter/2
z =magnet_Height +ferrocell_Half + (random.random() * thickness)
v = s.getB([x,y,z])
f .write(str(x) + " " + str(y) + " " + str(z) + " " + str(v[0]) + " " + str(v[1]) + " " + str(v[2]) + "\n")
f.close()










