Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6f3e3d8

Browse files
Improve holding force example (#830)
* improve holding-force example * fix langage and typos (modelling -> modeling, haftkraft -> holding_force --------- Co-authored-by: Alexandre Boisselet <[email protected]>
1 parent 2d6cd33 commit 6f3e3d8

13 files changed

+23
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Improved docstrings by adding examples where missing and by using rounding in all examples to avoid doctest fails
55
- Fixed a bug where a core getH would return the B-field
66
- Input `in_out` is by default set to `"auto"` for collections to avoiding ambiguities.
7+
- Improve documentation ([#829](https://github.com/magpylib/magpylib/issues/829))
78

89
## [5.1.1] - 2024-10-31
910
- Included magpylib-force version 0.3.1 in documentation

docs/_pages/user_guide/docs/docs_classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Magpylib objects span a local reference frame, and all object properties are def
5959
(docu-magnet-classes)=
6060
## Magnet classes
6161

62-
All magnets are sources. They have the <span style="color: orange">**polarization**</span> attribute which is of the format $\vec{J}=(J_x, J_y, J_z)$ and denotes a homogeneous magnetic polarization vector in the local object coordinates in units of T. Alternatively, the magnetization vector can be set via the <span style="color: orange">**magnetization**</span> attribute of the format $\vec{M}=(M_x, M_y, M_z)$. These two parameters are codependent and Magpylib ensures that they stay in sync via the relation $\vec{J}=\mu_0\cdot\vec{M}$. Information on how this is related to material properties from data sheets is found in {ref}`examples-tutorial-modelling-magnets`.
62+
All magnets are sources. They have the <span style="color: orange">**polarization**</span> attribute which is of the format $\vec{J}=(J_x, J_y, J_z)$ and denotes a homogeneous magnetic polarization vector in the local object coordinates in units of T. Alternatively, the magnetization vector can be set via the <span style="color: orange">**magnetization**</span> attribute of the format $\vec{M}=(M_x, M_y, M_z)$. These two parameters are codependent and Magpylib ensures that they stay in sync via the relation $\vec{J}=\mu_0\cdot\vec{M}$. Information on how this is related to material properties from data sheets is found in {ref}`examples-tutorial-modeling-magnets`.
6363

6464

6565
### Cuboid

docs/_pages/user_guide/docs/docs_units_types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Up to version 4, Magpylib was unfortunately contributing to the naming confusion
3333
```
3434

3535
```{note}
36-
The connection between the magnetic polarization J, the magnetization M and the material parameters of a real permanent magnet are shown in {ref}`examples-tutorial-modelling-magnets`.
36+
The connection between the magnetic polarization J, the magnetization M and the material parameters of a real permanent magnet are shown in {ref}`examples-tutorial-modeling-magnets`.
3737
```
3838

3939
(guide-docs-io-scale-invariance)=

docs/_pages/user_guide/examples/examples_app_halbach.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ plt.show()
8181
```
8282

8383
```{warning}
84-
Magpylib models magnets with perfect polarization. However, such magnets do not exist in reality due to fabrication tolerances and material response. While fabrication tolerances can be estimated easily, our [tutorial](examples-tutorial-modelling-magnets) explains how to deal with material response.
84+
Magpylib models magnets with perfect polarization. However, such magnets do not exist in reality due to fabrication tolerances and material response. While fabrication tolerances can be estimated easily, our [tutorial](examples-tutorial-modeling-magnets) explains how to deal with material response.
8585
```

docs/_pages/user_guide/examples/examples_force_haftkraft.md renamed to docs/_pages/user_guide/examples/examples_force_holding_force.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
(examples-force-haftkraft)=
1+
(examples-force-holding-force)=
22

33
# Magnetic Holding Force
44

55
The examples here require installaion of the [magpylib-force package](https://pypi.org/project/magpylib-force/). See also the [magpylib-force documentation](docs-magpylib-force).
66

7-
With Magpylib-force it is possible to compute the holding force of a magnet attached magnetically to a soft-ferromagnetic plate.
7+
With Magpylib-force it is possible to compute the holding force of a magnet attached magnetically to a soft-ferromagnetic plate. The "pull-force" is the opposing force that is required to detach the magnet from the surface.
88

9-
```{figure} ../../../_static/images/examples_force_haftkraft.png
9+
```{figure} ../../../_static/images/examples_force_holding_force.png
1010
:width: 40%
1111
:align: center
1212
:alt: Sketch of holding force.
@@ -27,7 +27,7 @@ m1 = magpy.magnet.Cuboid(
2727
dimension=(5e-3, 2.5e-3, 1e-3),
2828
polarization=(0, 0, 1.33),
2929
)
30-
m1.meshing = (10,5,2)
30+
m1.meshing = 100
3131
3232
# Mirror magnet
3333
m2 = m1.copy(position=(0,0,1e-3))
@@ -37,4 +37,4 @@ print(f"Holding Force: {round(F[2]*100)} g")
3737
# Holding Force: 349 g
3838
```
3939

40-
Magnet dimensions and material from this example are taken from the [web](https://www.supermagnete.at/quadermagnete-neodym/quadermagnet-5mm-2.5mm-1.5mm_Q-05-2.5-1.5-HN). The remanence of N45 material lies within 1.32 and 1.36 T. The computation confirms what is stated on the web-page, that the holding force of this magnet is about 350 g.
40+
Magnet dimensions and material from this example are taken from the [web](https://www.supermagnete.at/quadermagnete-neodym/quadermagnet-5mm-2.5mm-1.5mm_Q-05-2.5-1.5-HN). The remanence of N45 material lies within 1.32 and 1.36 T which corresponds to the polarization, see also the ["Modeling a real magnet"](examples-tutorial-modeling-magnets) tutorial. The computation confirms what is stated on the web-page, that the holding force of this magnet is about 350 g.

docs/_pages/user_guide/examples/examples_index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
:img-bottom: ../../../_static/images/examples_icon_tutorial_custom.png
3939
:::
4040

41-
:::{grid-item-card} {ref}`examples-tutorial-modelling-magnets`
41+
:::{grid-item-card} {ref}`examples-tutorial-modeling-magnets`
4242
:text-align: center
43-
:link: examples-tutorial-modelling-magnets
43+
:link: examples-tutorial-modeling-magnets
4444
:link-type: ref
4545
:link-alt: link to example
46-
:img-bottom: ../../../_static/images/examples_icon_tutorial_modelling_magnets.png
46+
:img-bottom: ../../../_static/images/examples_icon_tutorial_modeling_magnets.png
4747
:::
4848

4949
::::
@@ -231,12 +231,12 @@
231231
:img-bottom: ../../../_static/images/examples_icon_force_force.png
232232
:::
233233

234-
:::{grid-item-card} {ref}`examples-force-haftkraft`
234+
:::{grid-item-card} {ref}`examples-force-holding-force`
235235
:text-align: center
236-
:link: examples-force-haftkraft
236+
:link: examples-force-holding-force
237237
:link-type: ref
238238
:link-alt: link to example
239-
:img-bottom: ../../../_static/images/examples_icon_force_haftkraft.png
239+
:img-bottom: ../../../_static/images/examples_icon_force_holding_force.png
240240
:::
241241

242242
:::{grid-item-card} {ref}`examples-force-floating`
@@ -258,7 +258,7 @@ examples_tutorial_paths.md
258258
examples_tutorial_field_computation.md
259259
examples_tutorial_collection.md
260260
examples_tutorial_custom.md
261-
examples_tutorial_modelling_magnets.md
261+
examples_tutorial_modeling_magnets.md
262262
263263
examples_vis_magnet_colors.md
264264
examples_vis_animations.md
@@ -282,7 +282,7 @@ examples_app_coils.md
282282
examples_app_scales.md
283283
284284
examples_force_force.md
285-
examples_force_haftkraft.md
285+
examples_force_holding_force.md
286286
examples_force_floating.md
287287
```
288288

docs/_pages/user_guide/examples/examples_misc_inhom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ kernelspec:
1616

1717
# Inhomogeneous Magnetization
1818

19-
The analytical expressions implemented in Magpylib treat only simple homogeneous polarizations. When dealing with high-grade materials that are magnetized in homogeneous fields this is a good approximation. However, there are many cases where such a homogeneous model is not justified. The tutorial {ref}`examples-tutorial-modelling-magnets` and the user-guide {ref}`guide-physics-demag` provide some insights on this topic.
19+
The analytical expressions implemented in Magpylib treat only simple homogeneous polarizations. When dealing with high-grade materials that are magnetized in homogeneous fields this is a good approximation. However, there are many cases where such a homogeneous model is not justified. The tutorial {ref}`examples-tutorial-modeling-magnets` and the user-guide {ref}`guide-physics-demag` provide some insights on this topic.
2020

2121
Here we show how to deal with inhomogeneous polarization based on a commonly misunderstood example of a cylindrical quadrupol magnet. While graphical representations of such magnets usually depict only four poles, see {ref}`examples-vis-magnet-colors`, such magnets exhibit complex polarization given by the magnetization device that is used to magnetize them.
2222

docs/_pages/user_guide/examples/examples_tutorial_modelling_magnets.md renamed to docs/_pages/user_guide/examples/examples_tutorial_modeling_magnets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
(examples-tutorial-modelling-magnets)=
1+
(examples-tutorial-modeling-magnets)=
22

3-
# Modelling a real magnet
3+
# Modeling a real magnet
44

55
Whenever you wish to compare Magpylib simulations with experimental data obtained using a real permanent magnet, you might wonder how to properly set up a Magpylib magnet object to reflect the physical permanent magnet in question. The goal of this tutorial is to explain how to extract this information from respective datasheets, to provide better understanding of permanent magnets, and show how to align Magpylib simulations with experimental measurements.
66

docs/_pages/user_guide/examples/examples_vis_magnet_colors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The polarization direction of a permanent magnet is often graphically displayed
2222
Magpylib uses the DIN Specification 91411 (soon 91479) standard as default setting. The tri-color scheme has the advantage that for multi-pole elements it becomes clear which north is "connected" to which south.
2323

2424
```{hint}
25-
The color schemes often seem to represent homogeneous polarizations, referred to as "ideal typical" magnets in DIN Specification 91479. However, they often just represent general "pole patterns", i.e. rough sketches where the field goes in and where it comes out, that are not the result of homogeneous polarizations. On this topic review also the examples example {ref}`examples-misc-inhom`, and the tutorial {ref}`examples-tutorial-modelling-magnets`.
25+
The color schemes often seem to represent homogeneous polarizations, referred to as "ideal typical" magnets in DIN Specification 91479. However, they often just represent general "pole patterns", i.e. rough sketches where the field goes in and where it comes out, that are not the result of homogeneous polarizations. On this topic review also the examples example {ref}`examples-misc-inhom`, and the tutorial {ref}`examples-tutorial-modeling-magnets`.
2626
```
2727

2828
With Magpylib users can easily tune the magnet color schemes. The `style` options are `tricolor` with north, middle and south colors, and `bicolor` with north and south colors.

docs/_pages/user_guide/guide_resources_01_physics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ Demagnetization factors can be used to compensate a large part of the demagnetiz
5656

5757

5858
(phys-remanence)=
59-
### Modelling a datasheet magnet
59+
### Modeling a datasheet magnet
6060

6161
The material remanence, often found in data sheets, simply corresponds to the material magnetization/polarization when not under the influence of external fields. This can never happen, as the material itself generates a magnetic field. Such self-interactions result in self-demagnetization that can be approximated using the demagnetization factors and the material permeability (or susceptibility).
6262

6363
For example, a cube with 1 mm sides has a demagnetization factor is 0.333, see [magpar.net](http://www.magpar.net/static/magpar/doc/html/demagcalc.html). When the remanence field of this cube is 1 T, and its susceptibility is 0.1, the magnetization resulting from self-interaction is reduced to 1 T - 0.3333*0.1 T = 0.9667 T, assuming linear material laws.
6464

65-
A [tutorial](examples-tutorial-modelling-magnets) explains how to deal with demagnetization effects and how real magnets can be modeled using datasheet values.
65+
A [tutorial](examples-tutorial-modeling-magnets) explains how to deal with demagnetization effects and how real magnets can be modeled using datasheet values.
6666

6767
It must be understood that the change in magnetization resulting from self-interaction has a homogeneous contribution which is approximated by the demagnetization factor, and an inhomogeneous contribution which cannot be modeled easily with analytical solutions. The inhomogeneous part, however, is typically an order of magnitude lower than the homogenous part. You can use the Magpylib extension [Magpylib material response](https://github.com/magpylib/magpylib-material-response) to model the self-interactions.
6868

0 commit comments

Comments
 (0)