Skip to content
Plotly templates

Physics — Energy in SHM

Kinetic and potential energy versus displacement.

Template previewPlotly
Rendering…

Make it your own.

{
  "data": [
    {"type":"scatter","mode":"lines","name":"Kinetic energy","line":{"color":"#2563eb","width":3},
     "x":[-1,-0.8,-0.6,-0.4,-0.2,0,0.2,0.4,0.6,0.8,1],
     "y":[0,0.36,0.64,0.84,0.96,1.0,0.96,0.84,0.64,0.36,0]},
    {"type":"scatter","mode":"lines","name":"Potential energy","line":{"color":"#dc2626","width":3},
     "x":[-1,-0.8,-0.6,-0.4,-0.2,0,0.2,0.4,0.6,0.8,1],
     "y":[1.0,0.64,0.36,0.16,0.04,0,0.04,0.16,0.36,0.64,1.0]}
  ],
  "layout": {"title":"Energy in SHM vs displacement","xaxis":{"title":"displacement / amplitude"},"yaxis":{"title":"energy (relative)"}}
}