How to model a magnetic force in sim mechanics

18 views (last 30 days)
Hello,
I want to model magnetic force between two rigid bodies (electromagnet and piece of steel) in simmechanics. Magnetic force has form F=k(i+a)/(x+b). k,a and b are constants. i is current, x is gap between magnet and piece of steel.
I looked at inverse square law force in sim mechanics. but it asks only for one constant.
Please help.

Answers (1)

Sebastian Castro
Sebastian Castro on 9 Feb 2016
I would implement the force from scratch using
  • Transform Sensor block: To measure the relative position between the two coordinate frames in question. If you're doing this in 2D or 3D you can get the X, Y, Z distances and do a sum-of-squares thing.
  • External Force and Torque blocks: To apply forces between these same frames. Again, these can apply force in one direction or all 3 (X, Y, and Z)
  • Blocks from the Simscape > Foundation Library > Physical Signals library to implement the force relationship in between the first two sets of blocks. I'd recommend these blocks because they don't go out to Simulink signals and therefore won't cause algebraic loops. Your force law is simple enough that these blocks will work fine.
- Sebastian

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!