Magnetic Pendulum Mathematica Simulation

Click For Summary
SUMMARY

This discussion focuses on simulating a magnetic pendulum using Mathematica, specifically with three magnets influencing the pendulum's motion. The user successfully implemented the basic simulation but encountered challenges in generating the fractal basin boundaries. The equations governing the motion, including damping and spring constants, were provided, and the user is seeking guidance on using a Do loop to create a table of data points for plotting the final positions based on initial conditions.

PREREQUISITES
  • Proficiency in Mathematica programming
  • Understanding of differential equations and their applications in physics
  • Knowledge of fractal geometry and basin boundaries
  • Familiarity with numerical methods for solving equations
NEXT STEPS
  • Explore Mathematica's Table and Do functions for data generation
  • Learn about plotting techniques in Mathematica for visualizing fractal basin boundaries
  • Investigate numerical integration methods suitable for differential equations in Mathematica
  • Study the principles of chaos theory as they relate to pendulum motion
USEFUL FOR

Students and researchers in physics, particularly those interested in dynamical systems, as well as Mathematica users looking to enhance their simulation skills and understand complex motion patterns.

Fuzzletop
Messages
4
Reaction score
0

Homework Statement


This is for a lab, which I'm working on at home. There are two parts: using Mathematica to simulate a magnetic pendulum with 3 magnets by plotting the path of the bob and then extend my code to determine where the bob endpoint for all starting positions and draw the fractal basin boundaries.

Homework Equations


x''[t] == -R x'[t] + ((
X[1] - x[t])/(Sqrt[(X[1] - x[t])^2 + (Y[1] - y[t])^2 + d^2])^3 + (
X[2] - x[t])/(Sqrt[(X[2] - x[t])^2 + (Y[2] - y[t])^2 + d^2])^3 + (
X[3] - x[t])/(Sqrt[(X[3] - x[t])^2 + (Y[3] - y[t])^2 + d^2])^3) -
c x[t]

and likewise for y''[t] (copy-pasted from Mathematica)
where R is the damping constant of the air, and c is the "spring" constant of the pendulum, since we approximate this using Hooke's Law. X, Y are the x and y positions of the magnets.

The Attempt at a Solution


The first part, simulating the pendulum's path was very easy. The equation(s) above was basically given to me; I just had to fine-tune the constants R and c. My problem is now getting the fractal basin boundary.

I'm trying to get a Do loop to output a Table of data points that includes the initial and final positions, and from there plot these points in different colours based on where the final position is. I know there must be some way to do this, but I have no idea how.

For reference, I've attached my .nb's. pendulum fbb.nb is what I've got so far for the second part, but it doesn't really do anything right now. Any help I could get with this would be awesome!
 

Attachments

Physics news on Phys.org
Any help? Short of running 400+ calculations to find the y value of the pendulum for each set of x0 and y0 from -2 to 2 in 0.1 steps, I'm lost.
 

Similar threads

Replies
19
Views
3K
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K