### Author Topic: A pendulum connected to a spring  (Read 16220 times)

#### concord

• Full Member
• Posts: 125
##### A pendulum connected to a spring
« on: August 21, 2005, 09:09:59 pm »
A pendulum connected to a spring:

http://mw.concord.org/modeler1.3/mirror/mechanics/pendulum3.html

[img:d1e99b7f8c]http://mw.concord.org/modeler1.3/mirror/mechanics/pendulum3.gif[/img:d1e99b7f8c]

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### Re: A pendulum connected to a spring
« Reply #1 on: February 17, 2010, 05:35:53 pm »
The following is an EJS version of the above applet (with more options)

You can drag the spring, particle and the rod with mouse click/drag.
You can change spring constant k, mass m , spring length L, and damping constant b.
Enjoy it!

Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
• Please feel free to post your ideas about how to use the simulation for better teaching and learning.
• Post questions to be asked to help students to think, to explore.
• Upload worksheets as attached files to share with more users.
Let's work together. We can help more users understand physics conceptually and enjoy the fun of learning physics!

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### Re: A pendulum connected to a spring
« Reply #2 on: October 24, 2011, 01:51:49 pm »
Equation used in the above simulation.
Assume angle \$   heta\$ for the pendulum, angular velocity \$omega=frac{d   heta}{dt}\$
And \$frac{domega}{dt}=calAplha(   heta)+ gcos   heta+ -bomega/m\$
where \$caAplha(   heta)\$ calculate spring force and find it tangential component.

public double calAlpha (double c) {
cs=Math.cos(c);
sc=Math.sin(c);
x=x2-R*cs;
y=y2-R*sc;
L=Math.sqrt((x-x1)*(x-x1)+(y-y1)*(y-y1));
f=-k*(L-L0); fx=f*(x-x1);
fy=f*(y-y1);
n=-fx*cs-fy*sc;
nx=-n*cs;
ny=-n*sc;
fx=fx-nx;
fy=fy-ny;
if(c>0)sign=-1;
else sign=1;
return sign*Math.sqrt(fx*fx+fy*fy)/I; // where I is the momentum of initial
}