Skip to content

How to calculate the magnetic force between several fixed magnets and one moving magnet? #760

Answered by OrtnerMichael
feldnerd asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @feldnerd

here is an example how to use the code:

from mforce import getFTcube
import magpylib as magpy

# all inputs and output in SI units

cube1 = magpy.magnet.Cuboid(
    dimension=(1,1,1),
    polarization=(1,1,1),
)
cube2 = cube1.copy(position=(1,0,2))
cube2.mesh = (10,10,10)

F,T = getFTcube(cube1, [cube2, cube2.copy()], anchor=(0,0,0))
print(F)
print(T)

sure it would be faster to use a dipole approximation - which is the same as using cube2.mesh = (1,1,1) ;).

Whats your use case ? If you explain I can maybe tell you which approximation would be justified.

Replies: 7 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@feldnerd
Comment options

@OrtnerMichael
Comment options

@feldnerd
Comment options

Answer selected by feldnerd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants