{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW3_ENED1090_AUTUMN_2016.docx

HW3_ENED1090_AUTUMN_2016.docx - Homework#3 P=ENED 1090...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework #3 P=ENED 1090: Engineering Models I Homework Assignment #3 Due: September 23, 2016 at 5:00pm Problem 1: Simple Harmonic Motion Sinusoids are used to model simple harmonic motion as illustrated in the figure below that shows a mass attached to a spring. If we assume no loss of energy, the displacement of the mass looks like a cosine wave. In this lab, we will assume the oscillations are undamped. Assuming simple harmonic motion, the displacement of the mass is given by: A = Initial Displacement of Mass (m) (how much spring is compressed initially) K = Spring Constant (N/m) M = Mass of suspended mass and spring (kg) t = Time (s) The velocity of the mass is the derivative of displacement with respect to time: The kinetic energy and the potential energy (both in units of Joules) can be calculated as follows: (m/s) 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Homework #3 Write a script file that does the following: 1. Prompts the user using input statements for initial displacement, A, spring constant, K, and the mass, M. 2. Calculates the frequency of oscillation: 3. Calculates the period, T. 4. Uses fprintf statements to output the frequency of oscillation and the period with four places behind the decimal point for each. Include units in your output statements. 5. Creates a vector of values for time, t, that starts at 0 and ends at 3T. 6. Calculates position, p, velocity, v, kinetic energy, KE, and potential energy, PE, for the time vector created in step 5.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}