Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

language: Python Problem 5.4. Oscillating spring A rock of mass m is hung from a spring, and pulled down a length A. When released, the

language: Python

image text in transcribed

image text in transcribed

Problem 5.4. Oscillating spring A rock of mass m is hung from a spring, and pulled down a length A. When released, the rock will oscillate up and down with a vertical position given by y(t) = Ae=7* cos (V) Here, y is the vertical position of the rock, k is the spring constant, and is a friction coefficient representing air resistance. Set k = 4 kg 8-2 and 7 = 0.15 s-, m = 9 kg, and A = 0.3 m. a) Create arrays t_array and y-array of size 101, both initially filled with zeros. Use a for loop to fill them with time values in the range from 0 to 25 seconds, and the corresponding y(t) values. b) Vectorize your program by using the NumPy's linspace function to gen- erate the t_array, and send it into a function y(t) to generate the y-array. Your program should now be free of for loops. paragraphe) Plot the position of the rock against time in the given time interval. Use the arrays from both exercise a) and b), and confirm that they give the same result. Put the correct units on both axes

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

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

4, [s underload as stressful as overload'! Why or why nm'?

Answered: 1 week ago

Question

Summarize the economic impact of safety.

Answered: 1 week ago

Question

Summarize the prevalence of unions.

Answered: 1 week ago