Main Content

Permanent Magnet Attached to Iron Wall

This example shows how to model the forces acting on a magnet that is attached to an iron wall. You can define the interaction between the magnetic and translational motion domains using a Permanent Magnet block and a Reluctance Force Actuator block.

Model Overview

A Reluctance Force Actuator block models the interaction between a permanent magnet and an iron wall by generating reluctance and translational force according to the size of the gap between the poles of the magnet and the wall. The Force Input subsystem exerts force on the magnet.

myModel = "PermanentMagnetOnWall";
open_system(myModel);

Simulate Model and Plot Results

When you start the simulation, the magnet touches the wall. The Force Input block gradually increases the force on the magnet until the magnet detaches from the wall. When the force on the magnet exceeds the critical force, the Force Input block stops raising the applied force to prevent the magnet from moving too far from the wall. At a simulation time of 3 seconds, the Force Input block stops applying the external force, causing the magnet to reattach to the wall.

sim(myModel);
time = PermanentMagnetOnWallSimlog.Reluctance_Force_Actuator.x.series.time;
position = PermanentMagnetOnWallSimlog.Reluctance_Force_Actuator.x.series.values;
velocity = PermanentMagnetOnWallSimlog.Mass.v.series.values;
totalForce = PermanentMagnetOnWallSimlog.Mass.f.series.values;
appliedForce = -PermanentMagnetOnWallSimlog.Load_Force.f.series.values;

Animate the movement of the magnet and plot the velocity, total force, and applied force

frames = PermanentMagnetOnWallAnimate(time,position,velocity,totalForce,appliedForce);
hFig1 = figure(Name="PermanentMagnetOnWallFigure");
movie(hFig1,frames,1,20);

Change Magnet Parameterization

Some manufacturers define the magnetization curve using the remanent flux density and coercivity of the magnet. Change the parameterization type.

set_param(myModel+"/Permanent Magnet","remanent_field_parameters","2");

The default remanent flux density is 0.1 T and the default relative permeability is 1.05. Calculate the equivalent coercivity.

coercivityEquivalent = 7.5788e4;
set_param(myModel+"/Permanent Magnet","hC","coercivityEquivalent");
sim(myModel);
time = PermanentMagnetOnWallSimlog.Reluctance_Force_Actuator.x.series.time;
position = PermanentMagnetOnWallSimlog.Reluctance_Force_Actuator.x.series.values;
velocity = PermanentMagnetOnWallSimlog.Mass.v.series.values;
totalForce = PermanentMagnetOnWallSimlog.Mass.f.series.values;
appliedForce = -PermanentMagnetOnWallSimlog.Load_Force.f.series.values;

Animate the movement of the reparameterized magnet and plot the velocity, total force, and applied force. The magnet now moves too far from the wall and cannot reattach because of the small error introduced in the approximation of the coercivity.

frames = PermanentMagnetOnWallAnimate(time,position,velocity,totalForce,appliedForce);
hFig2 = figure(Name="PermanentMagnetOnWallFigure");
movie(hFig2,frames,1,20);

See Also

Topics