lab07.py - GlowScript 2.4 VPython from_future import...

This preview shows page 1 out of 2 pages.

GlowScript 2.4 VPython from __future__ import division ## treat integers as real numbers in division from visual import * from visual.graph import * scene.width=600 scene.height = 760 ## Setup graphing windows gdisplay(width=500, height=250, x=600, y=1) gdisplay(width=500, height=250, x=600, y=300) gdisplay(width=500, height=250, x=600, y=1) ygraph=gcurve(color=color.yellow) pgraph=gcurve(color=color.green) fgraph=gcurve(color=color.magenta) ## constants and data g = 9.8 mball = .1443 ## change this to the Mass you used in the lab for the oscillation experiments L0 = 0.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 fnetscale=.25 t = 0 ## start counting time at zero ## objects ceiling = box(pos=vector(0,0,0), size = vector(0.2, 0.01, 0.2)) ## origin is at ceiling ball = sphere(pos=vector(-.1647,-.1014,-.1113), radius=0.025, color=color.orange) ## note: spring initially compressed spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) ## change the color to be your spring color
Image of page 1
You've reached the end of this preview.
  • Spring '08
  • UZER
  • Force

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern