Question: Task 2 (of 2) Sinusoids can be used to model simple harmonic motion of an object attached to a spring as illustrated in the figure



Task 2 (of 2) Sinusoids can be used to model simple harmonic motion of an object attached to a spring as illustrated in the figure below. If we assume no loss of energy, the displacement of the object looks like a cosine wave. For this task, we will assume the oscillations are un-damped (i.e. continue indefinitely). O Assuming simple harmonic motion, the displacement of the object, p, is given by: p(t) = A cos M *t A = Initial Displacement of object K = Spring Constant (N/m) M II Mass of suspended object and spring (kg) t Time (s) The velocity of the object is the derivative of displacement with respect to time: v (t ) = _ dp(t) K dt M sin The acceleration of the object is the derivative of velocity with respect to time: a(t ) = - dv(t) AK K dt M COS M The kinetic energy and potential energy of the object at time t, both in units of Joules (J), are computed as follows: KE(t) = =Mv(t)2 PE(t) = =Kp(t)2Open the file and add a VBA macro called Spring_Motion that does the following: Accesses the values from the worksheet for the initial displacement (A), spring constant (K), mass (M), and the time (t) Utilizes the formulas above to calculate the displacement (p), velocity (v), acceleration (a), kinetic energy (KE), and potential energy (PE) of the object at the specified time . Displays the calculated values for the values listed above (p, v, a, KE, and PE) in the appropriate cells on the worksheet Test Case: Inputs: A = 5 m, K = 1000 N/m, M= 10 kg, t= 3 s Outputs: p(t) =0.77 m, v(t) = 49.4 m/s, a(t) = -77.13 m/s', KE(t) = 12202.6 J, PE(t) = 297.4 J Notes: The values in the equations specified above within the trigonometric functions are already in units of radians, so there is no need to convert them The square root command in VBA is sqr () Think about the differences between a mathematical notation and a programming notation when dealing with the equations above (ie. what does (t) mean in math vs. programming?)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
