3D_Spring - from _future_ import division in division from...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
from __future__ import division ## treat integers as real numbers in division from visual import * from visual.graph import * scene.width=600 scene.height = 760 s ## Setup graphing windows #gdisplay(width=500, height=250, x=600, y=1) ##gdisplay(width=500, height=250, x=600, y=300) ##ygraph = gcurve(color=color.yellow) ##pgraph = gcurve(color=color.yellow) # ## constants and data g = 9.8 mball = 0.2498 ## change this to the Mass you used in the lab for the oscillation experiments L0 = .3 ## use the relaxed length from your previous lab ks = 12 ## change this to the spring constant you measured (in N/m) deltat = 1e-3 ## change this to be about 1/1000 of your measured period when you used Mass 2 Fg = mball*g*vector(0,-1,0) t = 0 ## start counting time at zero pscale = 1 fscale = .25 f ## objects ceiling = box(pos=(0,0,0), size = (0.2, 0.01, 0.2)) ## origin is at ceiling ball = sphere(pos=(-0.1146,-0.0909,-0.132), radius=0.025, color=color.orange) ## note: spring initially compressed spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

3D_Spring - from _future_ import division in division from...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online