Magnetic Pendulum Fractal Basin Boundaries in Mathematica

Click For Summary
SUMMARY

The discussion focuses on determining the fractal basin boundaries of a magnetic pendulum using Mathematica. The user successfully plotted a single path but seeks to expand their code to compute multiple endpoints for various starting points. They propose using a Do loop with NDSolve to automate the process, iterating through coordinates from {-5,-5} to {5,5} in increments of 0.1. The equations governing the pendulum's motion incorporate air resistance, spring constants, and the influence of three magnets positioned beneath the pendulum.

PREREQUISITES
  • Familiarity with Mathematica programming
  • Understanding of differential equations and NDSolve function
  • Knowledge of chaotic systems and fractal geometry
  • Basic concepts of magnetic forces and pendulum dynamics
NEXT STEPS
  • Explore advanced Mathematica functions for optimizing loops and performance
  • Study the implementation of NDSolve in complex systems
  • Research fractal basin boundaries and their significance in chaotic systems
  • Learn about numerical methods for solving differential equations in Mathematica
USEFUL FOR

Students and researchers in physics, mathematics, and engineering, particularly those working on chaotic systems and simulations involving pendulums and magnetic forces.

majinsock
Messages
11
Reaction score
0

Homework Statement



Hey all, this is for a laboratory. I need to determine the fractal basin boundaries for a magnetic pendulum swinging chaotically about 3 other magnets underneath. I was able to plot a single path for the pendulum in Mathematica, but now I need to expand my code to determine each endpoint for each starting point. I'm thinking that a Do loop involving lists might work, but for the life of me I can't figure out how to incorporate the functions NDSolve, List and Do. I COULD do each path individually and record the results, but I really don't think that's practical.


Homework Equations


y''[t] + r y'[t] - Ʃ(Yi-y[t])/√((Xi-x[t])^2 + (Yi-y[t])^2 + d^2)^3 + c y[t] ==0

The sum is for Y1, Y2 and Y3 (and X1, X2 and X3) which are the coordinates of the magnets. The other equation for the displacement of x[t] is the same as for y[t], so I don't see the need to write it twice.

r,c,d are all constants, where r is air resistance, d is the distance between the pendulum and the sitting magnets if it were directly over it. c is the spring constant of the pendulum.

I've attached a couple notebooks so that you can see more clearly what I'm doing.

The Attempt at a Solution


My attempt at the solution is to make a Do loop in which Mathematica uses NDSolve for each starting coordinate from {-5,-5} to {5,5} in increments of 0.1 and outputs the endpoint at around 100 seconds when the pendulum is basically circling a single magnet. I understand what I have to find out, but for the life of me I can't figure out how to make it work!
 

Attachments

Physics news on Phys.org
Any help would be greatly appreciated! Here's what I have so far: Do[ {X1, Y1} = {-5, -5}; {X2, Y2} = {0, 5}; {X3, Y3} = {5, -5}; eqns = {y''[t] + r y'[t] - Sum[(Yi - y[t])/Sqrt[(Xi - x[t])^2 + (Yi - y[t])^2 + d^2]^3 + c y[t] == 0, {i, 1, 3}], x''[t] + r x'[t] - Sum[(Xi - x[t])/Sqrt[(Xi - x[t])^2 + (Yi - y[t])^2 + d^2]^3 + c x[t] == 0}, {x[0], y[0]} = {0, 0}, {x'[0], y'[0]} = {xstart, ystart}, {x[100], y[100]}]; soln = NDSolve[eqns, {x[t], y[t]}, {t, 0, 100}]; {xend, yend} = {x[100], y[100]} /. soln; Print[{xstart, ystart} -> {xend, yend}], {xstart, ystart} = {xstart + 0.1, ystart + 0.1}, {xend, yend} < {5, 5}]
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
9
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K