Simple Energy Question based on SHM

  • Thread starter Thread starter RJLiberator
  • Start date Start date
  • Tags Tags
    Energy Shm
Click For Summary
SUMMARY

This discussion focuses on analyzing simple harmonic motion (SHM) through numerical methods, specifically Euler, Euler-Cromer, and Runge-Kutta. The user graphed theta versus time and energy versus time, noting discrepancies in energy calculations, particularly with the Euler method leading to infinite energy. The user confirmed that the energy calculations for the Runge-Kutta and Euler-Cromer methods should remain constant, and adjustments to the code improved the accuracy of the energy curves, aligning them with the expected motion graphs.

PREREQUISITES
  • Understanding of simple harmonic motion (SHM)
  • Familiarity with numerical methods: Euler, Euler-Cromer, and Runge-Kutta
  • Basic knowledge of energy conservation in oscillatory systems
  • Proficiency in graphing techniques for motion and energy analysis
NEXT STEPS
  • Study the implementation of the Euler-Cromer method in detail
  • Learn about energy conservation principles in damped and driven harmonic oscillators
  • Explore advanced numerical methods for solving differential equations
  • Investigate the effects of damping and driving forces on energy in SHM
USEFUL FOR

Students and educators in physics, particularly those focusing on mechanics and oscillatory motion, as well as anyone interested in numerical methods for solving differential equations related to SHM.

RJLiberator
Gold Member
Messages
1,094
Reaction score
63

Homework Statement


I am taksed with putting some simple harmonic motion (in this case linear harmonic motion) into graphs.
For my first graph, I am graphing theta vs. time and analyzing three different numerical methods for the solution (Euler, Euler-cramer, Runge Katta).
For my second graph, I am looking at the Energy vs. time based on these results.
Attached in the solutions are my results.

Homework Equations

The Attempt at a Solution



MOTION:
motion.JPG


ENERGY:
energy.JPG


Unfortuantely the labels are hard to read from jpg format. But the Euler method= black, the euler-cromer = red = runge-kutta method = blue.

My question is this: I know that my linear harmonic oscillator graph for motion is correct. I have a feeling my energy calculation is wrong, which is why I am posting here.
My energy calculation for euler method seems consistent. The energy continues to grow, infinite energy! Which is the problem with the Euler method here.

But my energy calculation for Runge-kutta and Euler-cromer method, I would have thought, were supposed to be a constant.
Or is my interpretation wrong and my graph actually correct?
 
Physics news on Phys.org
I am going to post my second problem as it is highly related:
For this code, I am graphing Ideal Motion (red), Motion with dampening (black) , and then motion with dampening and a driving force (blue).

The energy calculations should be the same from my initial post, which is why it is relevant.

As we see, the black energy curve flatlines, which seems consistent with the graph of its motion. However, should it be flatlining at the 1800 mark like it does, or at the 0 mark? That's confusing to me.

Similiarly, red and blue don't seem to be losing or gaining much energy in the graph of motion, but they shoot up linearly quite fast.
3times.JPG
 
I think I might have solved it while I was creating the post above!
I deleted a part of my code for my energy calculation, and I get this:
So the red curve we see a consistent energy which works with it's graph of motion.
The blue energy curve also works with the motion seen as at first it starts high then goes consistent.
The black curve now 0's out.

Looking good?

captur3333.JPG
 

Similar threads

  • · Replies 20 ·
Replies
20
Views
4K
Replies
2
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
6
Views
1K
  • · Replies 4 ·
Replies
4
Views
900
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 30 ·
2
Replies
30
Views
4K
  • · Replies 13 ·
Replies
13
Views
5K