• HOME
  • YEAR 9
    • Assessment System
    • Inheritance
    • Plants >
      • Kitchen Garden Project
    • Acids and Alkalis
    • Energetic Reactions
    • Energy Resources
    • Mechanics
    • Environmental Science
  • IGCSE
    • Forces and Motion
    • Energy and Energy Resources
    • Solids, Liquids and Gases
    • Waves
    • Astrophysics
    • Electricity
    • Magnetism
    • Nuclear Physics
    • IGCSE revision
  • Physics I
    • Kinematics >
      • Variables and Units
      • Describing Motion
      • Equations of Motion
      • Problem Solving
      • Projectiles
      • Kinematics Animations
    • Dynamics >
      • Forces
      • Static Equilibrium
      • Newton's Laws
      • Friction
      • Advanced Problems
    • Gravitation and Orbits >
      • Circular Motion
      • Vertical Circles
      • Universal Gravitation
      • Orbits
      • Circular Motion Animation
    • Energy >
      • Work
      • Springs
      • PE and KE
      • Conservation of Energy
      • Work-Energy Theorem
    • Linear Momentum >
      • Impulse
      • Conservation of Momentum
      • Types of Collision
      • 2-D Collisions
    • Simple Harmonic Motion >
      • Mass on Spring
      • Pendulums
      • SHM Animations
    • Rotational Mechanics >
      • Torque
      • Rotational Kinematics
      • Rotational Dynamics
      • Angular Momentum
      • Rotational Energy
    • Mechanical Waves >
      • Waves on a String
      • Sound
    • AP-1 Revision
    • AP Physics C (Mechanics)
  • Physics II
    • Fluid Mechanics
    • Thermal Physics
    • Electrostatics
    • Magnetic Fields >
      • EM Induction
    • Interference and Diffraction
    • Optics
    • Modern Physics
    • AP 2 Revision
  • OCEANOGRAPHY
    • The World Ocean >
      • What is Oceanography
      • History
      • Lat and Long
      • Size and Origin
      • Plate Tectonics
    • Seawater >
      • A Salty Sea
      • Measuring Salinity
      • Thermal Properties
      • Density Profiles
      • Drinking Seawater
    • Circulation and Climate >
      • Global Heating
      • Coriolis Effect
      • Surface Currents
      • Vertical Motion
      • Thermohaline Circulation
      • El Nino
      • Carbon Cycle
    • Waves and Tides >
      • Wave Motion
      • Formation of Waves
      • Beaches
      • Tsunamis
      • Tides
    • Observation Systems >
      • Challenges
      • The CTD
      • Moorings
      • Sound Waves
      • Robotics
      • Satellites
    • Weather and Navigation >
      • Weather Systems
      • Weather Forecasting
      • Hurricanes
      • Navigation
      • Life at Sea
    • Oceans and Mankind >
      • Ocean Acidification
      • Pollution
      • Fish Stocks
      • Climate Change
      • Energy Resources
    • Atlantic Explorer Cruise
    • ROVs
  • COLLEGE
    • College Physics I
    • College Physics II
  • CONTACT
Island Physics

CODING FOR PHYSICS

Home >> Coding >> SHM Animations

Currently having issues with this.  At first glance it seems ok, but the amplitude of the oscillation increases with time.  This is not right.  I am not sure why at the moment.

The set up uses Hooke's Law as the accelerating force on the mass.  This acceleration is then used with the kinematics equation to produce the new position of the ball.

Update: figured out the problem.  The time interval \(\Delta t\) is too long.  If it is reduced from \(\Delta t=0.1 \rightarrow 0.01\) the problem almost goes away completely.  This is, of course, the key to how calculus works!  The accuracy is only achieved when the \(\Delta t\rightarrow 0\).  However, the animation slows to a crawl as it is an online app that runs through the web. 

Perhaps using low masses and low spring constants may be a happy medium?  The other option is to change from the kinematics approach to that of the single harmonic oscillator and use \(a=-\omega^{2}x\) or \(x=A\cos\left ( \sqrt{\frac{k}{m}} t\right )\)  instead.  After all, calculus was used to derive the equations from Hooke's Law.
Picture
PhysGL Animations
Python
  • HOME
  • YEAR 9
    • Assessment System
    • Inheritance
    • Plants >
      • Kitchen Garden Project
    • Acids and Alkalis
    • Energetic Reactions
    • Energy Resources
    • Mechanics
    • Environmental Science
  • IGCSE
    • Forces and Motion
    • Energy and Energy Resources
    • Solids, Liquids and Gases
    • Waves
    • Astrophysics
    • Electricity
    • Magnetism
    • Nuclear Physics
    • IGCSE revision
  • Physics I
    • Kinematics >
      • Variables and Units
      • Describing Motion
      • Equations of Motion
      • Problem Solving
      • Projectiles
      • Kinematics Animations
    • Dynamics >
      • Forces
      • Static Equilibrium
      • Newton's Laws
      • Friction
      • Advanced Problems
    • Gravitation and Orbits >
      • Circular Motion
      • Vertical Circles
      • Universal Gravitation
      • Orbits
      • Circular Motion Animation
    • Energy >
      • Work
      • Springs
      • PE and KE
      • Conservation of Energy
      • Work-Energy Theorem
    • Linear Momentum >
      • Impulse
      • Conservation of Momentum
      • Types of Collision
      • 2-D Collisions
    • Simple Harmonic Motion >
      • Mass on Spring
      • Pendulums
      • SHM Animations
    • Rotational Mechanics >
      • Torque
      • Rotational Kinematics
      • Rotational Dynamics
      • Angular Momentum
      • Rotational Energy
    • Mechanical Waves >
      • Waves on a String
      • Sound
    • AP-1 Revision
    • AP Physics C (Mechanics)
  • Physics II
    • Fluid Mechanics
    • Thermal Physics
    • Electrostatics
    • Magnetic Fields >
      • EM Induction
    • Interference and Diffraction
    • Optics
    • Modern Physics
    • AP 2 Revision
  • OCEANOGRAPHY
    • The World Ocean >
      • What is Oceanography
      • History
      • Lat and Long
      • Size and Origin
      • Plate Tectonics
    • Seawater >
      • A Salty Sea
      • Measuring Salinity
      • Thermal Properties
      • Density Profiles
      • Drinking Seawater
    • Circulation and Climate >
      • Global Heating
      • Coriolis Effect
      • Surface Currents
      • Vertical Motion
      • Thermohaline Circulation
      • El Nino
      • Carbon Cycle
    • Waves and Tides >
      • Wave Motion
      • Formation of Waves
      • Beaches
      • Tsunamis
      • Tides
    • Observation Systems >
      • Challenges
      • The CTD
      • Moorings
      • Sound Waves
      • Robotics
      • Satellites
    • Weather and Navigation >
      • Weather Systems
      • Weather Forecasting
      • Hurricanes
      • Navigation
      • Life at Sea
    • Oceans and Mankind >
      • Ocean Acidification
      • Pollution
      • Fish Stocks
      • Climate Change
      • Energy Resources
    • Atlantic Explorer Cruise
    • ROVs
  • COLLEGE
    • College Physics I
    • College Physics II
  • CONTACT