In the previous sections, we used the current-loop interactions to gain qualitative understanding of the situation with real magnets; however, to gain a quantitative picture, we need to consider properties of real magnets and model them carefully. This will be achieved using Comsol Multiphysics modeling.
In this section, we will introduce the procedures of using Comsol Multiphysics in details and show how to combine Comsol with MATLAB for a flexible parametric analysis of the suspension system.
Modeling Procedures
Take the single suspended magnet for example, the procedures are the following:
(i) Choosing the corresponding module in Comsol:
The corresponding model is built by choosing "AC/DC module>Statics, Magnetic>Magnetostatic, No currents". There is an example in the Comsol Model Library from which one can see how magnetic force is calculated. It is in "AC/DC Module>Tutorial Models>rod and permanent magnet".
(ii) Creating objects:
We then need to create two cylinder magnets. In addition, a large block needs to surround the two magnets to simulate the air. These can be produced in the "Draw" menu of the graphic interface of the Comsol.
The dimension of the magnets is identical to commercially available ones. Specifically, the dimension of the top magnet is 3 inch in diameter and 1/2 inch in height. The suspended magnet is 1.5 inch in diameter and 1/4 inch in height. The resulting model figure is shown by the following:
(iii) Specifying the physical property of the magnets:
Next step is to specify the physical property of the magnets. We need to choose "Physics>Subdomain Settings" where we can specify the permeability and the magnetization of the magnets which are also chosen to be identical to the real magnets. For the magnets, we choose , and the recoil permeability and remanance of the top and suspended magnets are
and
, respectively. In addition, we define a force variable for the suspended magnet as "sus" in the "Subdomain Settings>Forces>Electromagnetic force variables".
(iv) Specifying the boundary condition:
A further step is to specify the boundary conditions in "Physics> Boundary settings". Since no magnetic field extends to infinity, there is no magnetic field lines go through the infinity boundary. Therefore, to simulate this condition, we require that the magnetic fields should be tangential to all block surfaces, namely .
(v) Creating the mesh:
The next step is to mesh the domain. In order to decrease the numerical errors, the mesh of the magnets need to be treated specially. We require that the minimal mesh size on the magnets to be 0.005. We leave the mesh for the block with its default value. The resulting mesh is shown in the figure below.
(v) Solving the problem:
Then we are ready to solve the problem simply by pressing the "=" icon. If one wants to specify the solver and meshing method, one can look at "Solve>Solver Parameters" for more details and change some of the specifications. Here we use the adaptive meshing to improve the accuracy. The resulting magnetic potential is shown in the figure below. The Comsol file for this model is also included.
(vi) Postprocessing:
To obtain the z-direction force of the suspended magnet, we can simply look at the "Postprocessing>Data display>Global", and then enter the expression sus_forcez_emnc. The force is about 22 N.
COMSOL with Matlab
Given the Comsol model file, one can only change the configuration once at a time, which is very time consuming. In order to try different configurations and evaluate the corresponding magnetic force, we need to connect Comsol to Matlab which in turn uses the functions in Comsol for evaluations. Firstly, we save the Comsol model as a Matlab m.file. Secondly, we connect Comsol with Matlab in "File>Client/Sever/MATLAB>Connect to MATLAB". This will automatically start Matlab. Finally, we need to identify parts of the script that model the configuration, and then we can add "for" loops to change the configurations. The following is the modified script for finer mesh model.
