Magnetic Pendulum Mathematica Simulation

AI Thread Summary
The discussion focuses on simulating a magnetic pendulum using Mathematica, specifically plotting the pendulum's path and determining the fractal basin boundaries. The user has successfully simulated the pendulum's motion but is struggling with generating a Do loop to create a table of initial and final positions for plotting. They seek assistance in efficiently calculating and visualizing the final positions based on various starting points without resorting to excessive calculations. The user has shared their current Mathematica notebook for reference and is looking for guidance on improving their code. The goal is to visualize the fractal basin boundaries effectively.
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.
 
Thread 'Help with Time-Independent Perturbation Theory "Good" States Proof'
(Disclaimer: this is not a HW question. I am self-studying, and this felt like the type of question I've seen in this forum. If there is somewhere better for me to share this doubt, please let me know and I'll transfer it right away.) I am currently reviewing Chapter 7 of Introduction to QM by Griffiths. I have been stuck for an hour or so trying to understand the last paragraph of this proof (pls check the attached file). It claims that we can express Ψ_{γ}(0) as a linear combination of...
Back
Top