## 3 Model and Simulation  
Model and simulation of the electromagnetic pump were performed using the Finite Element Method Magnetics (FEMM) software package (version FEMM 4.2 Magnetics, creator [PERSON] from Waltham, MA 02451-1196), used for solving electromagnetic problems. In particular, the simulation had been performed to establish the size of the chamber and the distance of the electromagnet in the electromagnetic pump in order to maximise the magnetic force. In the conducted simulation, the cross-section model of electromagnetic pump's chamber presents the permanent magnet located in the middle of two steel frame structures of electromagnets that attract and repel the permanent magnet, as in Figure 4a. The boundary conditions are listed within a group of ready-made functions located under the FEEM solver and related to the Dirichlet boundary conditions. The grid is also optimized by a function built into the FEMM program. The model structure presents as geometrical parameters the length (\(\phi\)) and height (\(h\)) of the permanent magnet, and the distance (\(\delta\)) of the permanent magnet and electromagnet frames change the force in the electromagnet. In the calculation model, Figure 4b, the distance \(\delta\) between the  
Figure 3: (**a**) Control cabinet mounted on the electromagnetic diaphragm pump. (**b**) Nextion display located in the electromagnetic diaphragm pump.  
electromagnet frames and permanent magnet varies in the range of 5 mm to 40 mm, as reported in Figure 5.  
Therefore, the force from the Maxwell stress tensor, the force of attraction of the frame by the electromagnet and, consequently, the pump's suction force, were calculated. Simulations were carried out and the core material was determined in accordance with the catalog note steel in FEEM, and the parameters of the coil were set at 2300 turns of copper wire with a cross-section of 0.3 mm and current of 2 A. The core is made of iron with the dimensions shown in Figure 5a. The permanent magnet will be attracted and repelled by the electromagnet frames over a shorter distance (5 mm) that that obtained by the simulation. The magnetic force is greater than 150 N when the permanent magnet is located at the end position or attached or closer to the first or second electromagnet. The voltage varies continuously and applied to the first and second electromagnet in the pumping chamber. The minimum and maximum force are useful to establish the size of the chamber. In Figure 5, the simulation results exhibit the relation of the magnetic force and the geometrical parameter as the dimension of chamber and the distance \(\delta\) between the electromagnet frames and the permanent magnet in the electromagnetic diaphragm pump. The maximum magnetic force is obtained for the dimension \(\delta\) of 5 mm.  
Figure 4: (**a**) Design structure of electromagnetic diaphragm pump (**b**) Magnetic flux density distribution of the electromagnetic pump with a permanent magnet and two electromagnets in FEMM software.  
Figure 5: Force depends on the distance (\(\delta\)) and the shape (size \(\phi\) and height \(h\)) of the magnets.  
Analyzing the results, an insufficient force is associated with the increase on the diaphragm stroke. The increment of the force during the suction and compression of liquids is essential. So, the metal frame was replaced with a permanent magnet. The distance value \(\delta\) is set as a function of the dimension of the compression and pressing chambers. The N42 neodymium magnet was used as a permanent magnet. Then, simulations were performed to select the size and shape of pellet in order to maximize the magnetic force. Starting from the simulation model, the permanent magnet with dimensions of 25 \(\times\) 10 mm was selected depending on the size pellets, the elasticity of the membrane and the strength force and stroke. The use of permanent magnets and the electromagnets can provide changes in the force and stroke membranes with proper control, which significantly increases the compression force generated by the pump.