Engee documentation
Notebook

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

This example demonstrates a way to simulate 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 modeled using blocks PermanentMagnet and ReluctanceForceActuator.

Description of the model

Block ReluctanceForceActuator It allows you to simulate the processes occurring between a permanent magnet and an iron wall due to the fact that its magnetic resistance and the linearly directed force created by it depend on the size of the gap between the poles of the magnet and the wall.

image.png

Subsystem Управление усилием sets the profile of the effect of an external force aimed at moving the magnet away from the wall.

Model launch 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 simulation of the model, the magnet comes into contact with the wall. Then the block Управление усилием gradually increases the value of the force aimed at moving the block away from the wall. At the moment when the disconnection force exceeds the critical value, the unit Управление усилием stops applying force so that the magnet does not move too far away from the wall, and then, at the moment t=1.1 the effort stops. The profile of the change in this force is found empirically.

After the termination of the force aimed at separating the magnet and the plate, the magnet is reattached to the iron surface and takes its former place.

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]:

A permanent magnet model implemented using a block PermanentMagnet, allows you to set properties both through the value of permeability (permeability) and through coercivity (coercivity). The choice depends on the magnet parameters specified in the manufacturer's documentation.

Running with other parameters

Once we change the parameters, we will see a different behavior of the model.

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

We will increase the maximum value of the force that will be directed at separating 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]:

With these settings, the magnet moves too far away from the wall and the field strength is no longer enough 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 the dynamic change in the value of the force of attraction of a permanent magnet to an iron surface.