Source code for pyleecan.Methods.Slot.HoleM57.comp_surface_magnet_id
# -*- coding: utf-8 -*-
[docs]def comp_surface_magnet_id(self, index):
"""Compute the surface of the hole magnet of the corresponding index
Parameters
----------
self : HoleM57
A HoleM57 object
index : int
Index of the magnet to compute the surface
Returns
-------
Smag: float
Surface of the Magnet [m**2]
"""
# all magnet has the same surface
label = "magnet_" + str(index)
if index in [0, 1] and getattr(self, label) is not None:
return self.H2 * self.W4
return 0