Magnetic Pendulum Mathematica Simulation

In summary, the conversation discusses a lab assignment involving simulating a magnetic pendulum using Mathematica and extending the code to determine the endpoint for all starting positions and draw the fractal basin boundaries. The equations and constants needed for the simulation are provided. The individual has completed the first part of the assignment but is struggling with finding a way to plot the data points for the fractal basin boundary. They have attached their code for reference and are seeking help with this part of the assignment.
  • #1
Fuzzletop
4
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

  • chaotic pendulum.nb
    51.1 KB · Views: 423
  • pendulum fbb.nb
    9.4 KB · Views: 398
Physics news on Phys.org
  • #2
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.
 

1. What is a magnetic pendulum?

A magnetic pendulum is a device that consists of a pendulum bob with a magnet attached, suspended by a string or rod in the presence of a magnetic field. The magnet and the magnetic field interact to produce a swinging motion that is different from a traditional pendulum.

2. How does a magnetic pendulum work?

A magnetic pendulum works by utilizing the principles of magnetism and motion. The magnetic field from the magnet attached to the pendulum bob interacts with the external magnetic field, causing the bob to swing in a circular motion instead of a back and forth motion like a traditional pendulum.

3. What is the purpose of a magnetic pendulum simulation in Mathematica?

The purpose of a magnetic pendulum simulation in Mathematica is to visually demonstrate the behavior and motion of a magnetic pendulum under different conditions, such as changing the strength or direction of the magnetic field. This can help with understanding the principles of magnetism and motion in a hands-on way.

4. How accurate is a magnetic pendulum simulation in Mathematica?

The accuracy of a magnetic pendulum simulation in Mathematica depends on the accuracy of the input parameters and the simulation settings. With appropriate inputs and settings, the simulation can provide a close representation of the real-life behavior of a magnetic pendulum.

5. Can a magnetic pendulum simulation in Mathematica be used for scientific research?

Yes, a magnetic pendulum simulation in Mathematica can be used for scientific research. The simulation can be used to study the behavior of a magnetic pendulum under different conditions and can provide insights into the principles of magnetism and motion. However, the results should be validated with real-life experiments for accurate conclusions.

Similar threads

Replies
2
Views
1K
  • Advanced Physics Homework Help
Replies
5
Views
787
  • Advanced Physics Homework Help
Replies
19
Views
832
  • Advanced Physics Homework Help
Replies
19
Views
947
  • Advanced Physics Homework Help
Replies
3
Views
394
  • Advanced Physics Homework Help
Replies
2
Views
829
  • Advanced Physics Homework Help
Replies
1
Views
2K
  • Advanced Physics Homework Help
2
Replies
44
Views
3K
  • Advanced Physics Homework Help
Replies
3
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
1K
Back
Top