Lab 08 - Ball

Lab 08 - Ball - from _future_ import division # treat...

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 ## constants and data g = 9.8 mball = .7 ## change this to Mass 2 (in kg) for your spring color L0 = 0.25 ## this is an approximate relaxed length of your spring in meters ks = 32.667 ## change this to the spring constant you measured (in N/m) deltat = 6.42e-4 ## change this to be about 1/1000 of your measured period when you used Mass 2 t = 0 ## start counting time at zero ## objects ceiling = box(pos=(0,0,0), size = (0.2, 0.01, 0.2)) ## origin is at ceiling ball = sphere(pos=(0,-L0,0), radius=0.025, color=color.orange) ## note: spring initially compressed spring = helix(pos=ceiling.pos, color=color.blue, thickness=.003, coils=40, radius=0.015) ## change the color to be your spring color spring.axis = ball.pos - ceiling.pos #ygraph = gcurve(color=color.yellow) ## initial values ball.p = mball*vector(0,0,0) Kgraph=gcurve(color=color.yellow)
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

Lab 08 - Ball - from _future_ import division # treat...

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