Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

from __future__ import division, print_function from visual import * scene.width = 400 scene.height = 760 ## constants and data g = 9.8 mball = 0.03

from __future__ import division, print_function from visual import * scene.width = 400 scene.height = 760 ## constants and data g = 9.8 mball = 0.03 L0 = 0.26 ks = 1.8 deltat = .01 ## objects (origin is at ceiling) ceiling = box(pos=vector(0,0,0), length=0.2, height=0.01, width=0.2) ball = sphere(pos=vector(0,-0.3,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.010) ## initial values pball = mball*vector(0,0,0) Fgrav = mball*g*vector(0,-1,0) t = 0 ## improve the display scene.autoscale = False ## turn off automatic camera zoom scene.center = vector(0,-L0,0) ## move camera down scene.waitfor('click') ## wait for a mouse click ## calculation loop while t <10: rate(100) Fnet = Fgrav pball = pball + Fnet*deltat ball.pos = ball.pos + (pball/mball)*deltat spring.axis = ball.pos - ceiling.pos t = t + deltat

so im coding for a lab for vpython and I dont know why I keep getting invalid syntax when I try to run this thing here is some questions it wants me to answer:

Now run the program. What, if anything, is missing from the program? Modify the program so it is an accurate model of a spring-mass system. How can you tell that the model is correct?

Modify your program to graph the y-component of the balls position as a function of time. Why doesnt the graph cross zero? What is the period of the oscillations shown on the graph? (You will find it easier to read the period off the graph if you change the while statement to make the program quit after a small number of oscillations. Note that you can use the mouse to drag crosshairs on a graph.) What does the analytical solution for a spring-mass oscillator predict for the period?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago