Use your program for the viscously damped spring to solve this problem. Make sur
ID: 1262252 • Letter: U
Question
Use your program for the viscously damped spring to solve this problem. Make sure you change the parameters as specified below.
A mass m=5 kg is attached to the end of a spring with a spring constant of k=18.2 N/m. The mass moves through a viscous damping medium with a damping constant b=1.8 kg/s giving a velocity dependent damping force Fdamp= -bv.
The motion occurs in zero gravity so set the force of gravity to ZERO in your program. Also set the equilibrium position L0=0. The mass is initially motionless and displaced from equilibrium by a distance yinitial=0.2 m.
What is the energy of the spring-mass system when the mass first passes through the equilibrium position? (you may wish to include a logical test to help you find when this occurs)
I do not have VPython, but my understanding is that the energy of the spring-mass system when the mass first passes through the equilibrium position lies where the total energy meets the first peak of kinetic energy
please dont round
here is the program referred to above
from __future__ import division
from visual import *
from visual.graph import *
scene.width=600
scene.height = 760
##constants and data
b = .2
g = 0 #m/s^2
mball =.45 # change this to the mass (in kg) from your experiment.
L0 = 0.1 # relaxed length of your spring in meters
ks = 20 # change this to the spring stiffness you measured (in N/m)
amp = 0.09 # amplitude of oscillation measured in m
yeq =-L0-mball*g/ks # equilibrium position of the spring in m
## Graphs
gdisplay(xtitle='Seconds', ytitle='Meters', x=600, y=0, width=600, height=300)
gdisplay(xtitle='Seconds',ytitle='Joules', x=500, y=0, width=800,height=500)
Kgraph = gcurve(color=color.magenta)
Ugraph = gcurve(color=color.blue)
Etotal = gcurve(color=color.red)
##ygraph = gcurve(color=color.yellow)
## objects
ceiling = box(pos=(0,0,0), size = (0.2, 0.01, 0.2))
ball = sphere(pos=(0,yeq-amp,0), radius=0.025, color=color.orange)
spring = helix(pos=ceiling.pos, axis=ball.pos-ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)
ball.trail = curve(color=ball.color)
## initial values
ball.m=mball #Do NOT change this value, change the variable mball
ball.v = vector(0,0,0)
ball.p = ball.m*ball.v
## improve the display
scene.autoscale = 0 ## don't let camera zoom in and out as ball moves
scene.center = vector(0,yeq,0) ## move camera to the equilibrium position
#Simulation Parameters
delta_t = .001
t = 0
simtime=10
while t < simtime:
rate(100)
#Forces
Fgrav = vector(0,-g*ball.m,0)
## calculate spring’s L_vector
L = ball.pos - spring.pos
Lmag = mag(L)
Lhat = L / Lmag
## calculate force of spring on the ball
stretch = Lmag-L0
F_bspring = vector(0, (ks * (stretch)), 0)
F_ball_liquid = -b * (ball.p/ball.m)
#Net Force
Fnet = Fgrav + F_bspring+F_ball_liquid
#Momentum Update
delta_p = Fnet*delta_t
ball.p = ball.p + delta_p
#Position Update
delta_r = ball.p/ball.m*delta_t
ball.pos = ball.pos + delta_r
pmag = mag(ball.p) ## magnitude of the ball
Explanation / Answer
Energy stored in a compressed spring = (1/2) * k * x^2
where x = compression length
hence
E = (1/2) * 18.9 * .2^2
E = .378 J
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.