Skip to content

Commit e6f6394

Browse files
committed
small doku fix
1 parent 59adf92 commit e6f6394

File tree

4 files changed

+50
-28
lines changed

4 files changed

+50
-28
lines changed

docs/_pages/0_documentation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _docu:
22

33
******************************
4-
Documentation v2.0.1b
4+
Documentation v2.3.0b
55
******************************
66

77
The idea behind magpylib is to provide a simple and easy-to-use interface for computing the magnetic field of magnets, currents and moments. The computations are based on (semi-)analytical solutions found in the literature, discussed in the :ref:`physComp` section.

docs/_pages/4_contguide.rst

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
**********************
2-
Credits & Contribution
3-
**********************
1+
*********************************
2+
Credits, Contribution & Citation
3+
*********************************
44

55

66

@@ -18,9 +18,21 @@ Maintainers & Contact
1818

1919

2020

21+
Credits
22+
########
23+
24+
We want to thank a lot of ppl who have helped to realize and advance this project over the years. The project was supported by CTR-AG and is now supported by the `Silicon Austria Labs <https://silicon-austria-labs.com/>`_ public research center.
25+
26+
27+
2128
Contributions
2229
#############
2330

24-
We want to thank a lot of ppl who have helped to realize and advance this project.
31+
We welcome any feedback (Bug reports, feature requests, comments, really anything 😃) via email `[email protected] <mailto:[email protected]>`_ or through `gitHub <https://github.com/magpylib/magpylib/issues>`_ channels.
32+
33+
34+
35+
Citation
36+
########
2537

26-
We welcome any feedback (Bug reports, feature requests, comments, really anything 😃) via email `[email protected] <mailto:[email protected]>`_ or through `gitHub <https://github.com/magpylib/magpylib/issues>`_ channels.
38+
A fundamental paper on Magpylib is being published in SoftwareX the moment. Details coming soon.

docs/index.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
What is magpylib ?
6+
What is Magpylib ?
77
##################
88

99
- Free Python package for calculating magnetic fields of magnets, currents and moments (sources).
1010
- Provides convenient methods to create, geometrically manipulate, group and visualize assemblies of sources.
11-
- The magnetic fields are determined from underlying analytical solutions which results in fast computation times and requires little computation power.
11+
- The magnetic fields are determined from underlying analytical solutions which results in fast computation times and requires little computation power, memory and background knowledge.
1212
- For high performance computation (e.g. for multivariate parameter space analysis) all functions are also available in vectorized form.
1313

1414
.. image:: _static/images/index/sourceFundamentals.png
1515
:align: center
1616

17+
When can you use Magpylib ?
18+
###########################
19+
20+
The analytical solutions are only valid if there is little or no material response. This means that whenever there is a lot of demagnetization in permanent magnets or soft magnetic materials like magnetic shields or transformer cores, these computations cannot be used. Magpylib is at its best dealing with air-coils and permanent magnet assemblies (Ferrite, NdFeB, SmCo or similar materials).
21+
22+
1723
Quickstart
1824
##########
1925

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
1-
# imports
21
import numpy as np
32
import matplotlib.pyplot as plt
4-
import magpylib as magpy
5-
6-
# create figure
7-
fig = plt.figure(figsize=(8,4))
8-
ax1 = fig.add_subplot(121, projection='3d') # this is a 3D-plotting-axis
9-
ax2 = fig.add_subplot(122) # this is a 2D-plotting-axis
3+
from magpylib.source.magnet import Box,Cylinder
4+
from magpylib import Collection, displaySystem
105

116
# create magnets
12-
s1 = magpy.source.magnet.Box(mag=[0,0,600],dim=[3,3,3],pos=[-4,0,3])
13-
s2 = magpy.source.magnet.Cylinder(mag=[0,0,500], dim=[3,5])
14-
15-
# manipulate magnets
16-
s1.rotate(45,[0,1,0],anchor=[0,0,0])
17-
s2.move([5,0,-4])
7+
s1 = Box(mag=(0,0,600), dim=(3,3,3), pos=(-4,0,3))
8+
s2 = Cylinder(mag=(0,0,500), dim=(3,5))
189

1910
# create collection
20-
c = magpy.Collection(s1,s2)
11+
c = Collection(s1,s2)
2112

22-
# display system geometry on ax1
23-
magpy.displaySystem(c,subplotAx=ax1,suppress=True)
13+
# manipulate magnets individually
14+
s1.rotate(45,(0,1,0), anchor=(0,0,0))
15+
s2.move((5,0,-4))
16+
17+
# manipulate collection
18+
c.move((-2,0,0))
2419

2520
# calculate B-field on a grid
26-
xs = np.linspace(-10,10,29)
27-
zs = np.linspace(-10,10,29)
28-
Bs = np.array([[c.getB([x,0,z]) for x in xs] for z in zs])
21+
xs = np.linspace(-10,10,33)
22+
zs = np.linspace(-10,10,44)
23+
POS = np.array([(x,0,z) for z in zs for x in xs])
24+
Bs = c.getB(POS).reshape(44,33,3) #<--VECTORIZED
25+
26+
# create figure
27+
fig = plt.figure(figsize=(9,5))
28+
ax1 = fig.add_subplot(121, projection='3d') # 3D-axis
29+
ax2 = fig.add_subplot(122) # 2D-axis
30+
31+
# display system geometry on ax1
32+
displaySystem(c, subplotAx=ax1, suppress=True)
2933

3034
# display field in xz-plane using matplotlib
3135
X,Z = np.meshgrid(xs,zs)
3236
U,V = Bs[:,:,0], Bs[:,:,2]
33-
ax2.streamplot(X, Z, U, V, color=np.log(U**2+V**2),density=2)
37+
ax2.streamplot(X, Z, U, V, color=np.log(U**2+V**2))
3438

3539
plt.show()

0 commit comments

Comments
 (0)