Engee documentation
Notebook

A model of interaction between a permanent magnet and an iron surface

This example demonstrates a way of modelling the forces that act between a magnet and an iron plate, such as a wall. The interaction between the magnetic domain and the linear displacement domain is modelled using the blocks PermanentMagnet and ReluctanceForceActuator.

Model description

The unit ReluctanceForceActuator allows modelling the processes occurring between a permanent magnet and an iron wall due to the fact that its magnetic resistance and the linearly directed force it generates depend on the size of the gap between the poles of the magnet and the wall.

image.png

The subsystem Управление усилием defines the profile of the external force acting to move the magnet away from the wall.

Running the model and interpretation

Let's run the model and study the observed phenomena.

In [ ]:
modelName = "permanent_magnet_on_wall";

model = modelName in [m.name for m in engee.get_all_models()] ? engee.open( modelName ) : engee.load( "$(@__DIR__)/$(modelName).engee");
data = engee.run( modelName, verbose=false )
Out[0]:
Dict{String, DataFrames.DataFrame} with 4 entries:
  "Управление усилием.F"    => 2001×2 DataFrame…
  "Измерение перемещения.V" => 2001×2 DataFrame…
  "Измерение перемещения.F" => 2001×2 DataFrame…
  "Измерение перемещения.P" => 2001×2 DataFrame

At the beginning of the model simulation, the magnet is in contact with the wall. Then block Управление усилием gradually increases the value of the force aimed at moving the block away from the wall. At the moment when the separation force exceeds a critical value, the Управление усилием block stops applying the force so that the magnet does not move too far away from the wall, and then, at t=1.1 the force stops. The profile of the variation of this force is found empirically.

After the force to disengage the magnet and plate has ceased, the magnet is reattached to the iron surface and occupies its former position.

In [ ]:
plot(
    plot( data["Управление усилием.F"].time, 1e3.*data["Управление усилием.F"].value,
            title="Внешняя сила\n", ylabel="Сила, мН",
            titlefont=font(10), guidefont=font(8) ),
    plot( data["Измерение перемещения.F"].time, 1e3.*data["Измерение перемещения.F"].value,
            title="Сумма сил\n", ylabel="Сила, мН",
            titlefont=font(10), guidefont=font(8), lc=2 ),
    plot( data["Измерение перемещения.V"].time, 1e3.*data["Измерение перемещения.V"].value,
            title="Скорость перемещения магнита\n", ylabel="Скорость<br>мм/с",
            titlefont=font(10), guidefont=font(8), lc=3 ),
    plot( data["Измерение перемещения.P"].time, 1e3.*data["Измерение перемещения.P"].value,
            title="Расстояние от стены\n", xlabel="Время, с", ylabel="Смещение<br>мм",
            titlefont=font(10), guidefont=font(8), lc=4 ),
    layout=(4,1), legend=:false, size=(400,500)
)
Out[0]:

The permanent magnet model realised with the PermanentMagnet block allows the properties to be set either through the permeability value (permeability) or through the coercivity (coercivity). The choice depends on the magnet parameters specified in the manufacturer's documentation.

Run with other parameters

If we change the parameters, we will see a different behaviour of the model.

In [ ]:
engee.get_param( "permanent_magnet_on_wall/Управление усилием/Saturation" )
Out[0]:
BlockParameters(
  LowerLimit => 0,
  UpperLimit => 265e-3,
)

Let's increase the maximum value of the force that will be directed to separate the magnet from the wall.

In [ ]:
engee.set_param!( "permanent_magnet_on_wall/Управление усилием/Saturation",
    "UpperLimit"=>350e-3 )
In [ ]:
data = engee.run( modelName, verbose=false )
Out[0]:
Dict{String, DataFrames.DataFrame} with 4 entries:
  "Управление усилием.F"    => 2001×2 DataFrame…
  "Измерение перемещения.V" => 2001×2 DataFrame…
  "Измерение перемещения.F" => 2001×2 DataFrame…
  "Измерение перемещения.P" => 2001×2 DataFrame
In [ ]:
plot(
    plot( data["Управление усилием.F"].time, 1e3.*data["Управление усилием.F"].value,
            title="Внешняя сила\n", ylabel="Сила, мН",
            titlefont=font(10), guidefont=font(8) ),
    plot( data["Измерение перемещения.F"].time, 1e3.*data["Измерение перемещения.F"].value,
            title="Сумма сил\n", ylabel="Сила, мН",
            titlefont=font(10), guidefont=font(8), lc=2),
    plot( data["Измерение перемещения.V"].time, 1e3.*data["Измерение перемещения.V"].value,
            title="Скорость перемещения магнита\n", ylabel="Скорость<br>мм/с",
            titlefont=font(10), guidefont=font(8), lc=3 ),
    plot( data["Измерение перемещения.P"].time, 1e3.*data["Измерение перемещения.P"].value,
            title="Расстояние от стены\n", xlabel="Время, с", ylabel="Смещение<br>мм",
            titlefont=font(10), guidefont=font(8), lc=4 ),
    layout=(4,1), legend=:false, size=(400,500)
)
Out[0]:

At these settings, the magnet is too far away from the wall and the field strength is no longer sufficient to bring it back.

Conclusion

We have built a model that allows us to calculate the force required to remove a magnet from an iron surface, as well as to see in dynamics the change in the value of the force of attraction of a permanent magnet to an iron surface.