1
$\begingroup$

I would like to create a basic electromagnetism simulation in blender; just two separate coils attracting each other (they slide and touch).

I'm good for modelling this, just not sure how to set up the physics.

$\endgroup$
3
$\begingroup$

This can be modeled using blender physics. The animation was generated in Blender 2.76b from the attached .blend file. It uses the built-in physics. It shows attraction (blue-red), followed by repulsion (red-red).

enter image description here

  1. Create a scene with a plane and two cylinders above the plane. Add two empties.
  2. Parent an empty to each cylinder. The forces will be driven through the empties.
  3. Select the plane and go to the physics tab. Enable rigid body physics for the the plane. Specify the plane will be animated. This will prevent movement of the plane, but give the cylinders something to slide on.

plane physics setting

  1. For each cylinder, on the physics tab, enable rigid body physics. This will let the cylinder collide with the plane and each other.

enter image description here

  1. For each empty, enable forces in the physics tab. Set the forces to -100. You may need to adjust the forces depending on the spacing. The negative values indicate that the empties will attract each other. Positive values will cause the empties to push each other apart.

enter image description here

  1. Run the animation to see the result.

A blender file illustrating this approach:

This solution is similar to the approach described in this question: How to have rigid-bodies and charge fields interact?

$\endgroup$
  • $\begingroup$ Thank you for be so thorough. Does this simulate the N/S poles of an em coil as well? As in, objects behind the coils are also affected. $\endgroup$ – Karric Nov 30 '15 at 16:35
  • $\begingroup$ This approach does not simulate N-S attraction. It emulates the effect of N/S attraction using forces. Another approach will be needed to simulate N/S. $\endgroup$ – Ed Tate Dec 20 '15 at 15:45
0
$\begingroup$

I'd suggest using the Limit Distance Constraint. You can set it up reciprocally on both coils (each one set up with the other coil as the target object).

By animating the Distance value you can visualize magnetic attraction between the two objects.

enter image description here

If your unfamiliar with constraints, this is a good intro. To add a Limit Distance constraint, select your object, then go to the Constraints (chain icon) tab in the Properties Window, then: Add Object Constraint > Transform > Limit Distance.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.