Top Banner
Chapter 10 Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture - Simulation of Simple Harmonic Motion In this lesson, we will create a simulation to predict the simple harmonic motion of a spring- mass system. In order to conduct this simulation, we will create a computer program, using a popular engineering analysis tool known as MATLAB. This engineering analysis tool may be used to create simulations of many mechanical engineering systems, including every experiment that we have conducted during this course! MATLAB is a sophisticated engineering analysis tool that you will use throughout your academic program and is commonly used by engineers in many companies and government agencies. The MATLAB engineering analysis tool may be used in two ways: (1) in an interactive mode, where the user enters discrete commands to get step by step results, much in the way that a graphing calculator is used and (2) in a programmable mode, where the user stores a set of commands in a file, called a “script” or “m file”, so that the exact same set of commands can be executed repeatedly for solving problems that the engineer encounters on a frequent basis. The benefit of the interactive mode is that it is convenient and easy to use. The benefit of the programmable mode is that complex and repetitive tasks can be completed easily without the tedium of operating a graphing calculator to solve similar problems over and over. We will learn how to use the MATLAB engineering analysis tool both in the interactive mode and in the programmable mode. You will then be able to use this analysis tool throughout your study of mechanical engineering. 10.1.1 Formulate It is convenient to learn MATLAB in the context of a familiar engineering problem. So, we will re-visit the oscillatory spring-mass problem from our previous lab. We are going to do essentially the same analysis that we conducted previously with Excel, this time using the MATLAB engineering analysis tool. 334
29

Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

Mar 19, 2018

Download

Documents

lykhuong
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

Chapter 10

Simulation - Matlab Simulation ofSimple Harmonic Motion

10.1 Lecture - Simulation of Simple Harmonic Motion

In this lesson, we will create a simulation to predict the simple harmonic motion of a spring-mass system. In order to conduct this simulation, we will create a computer program,using a popular engineering analysis tool known as MATLAB. This engineering analysis toolmay be used to create simulations of many mechanical engineering systems, including everyexperiment that we have conducted during this course!

MATLAB is a sophisticated engineering analysis tool that you will use throughout youracademic program and is commonly used by engineers in many companies and governmentagencies. The MATLAB engineering analysis tool may be used in two ways: (1) in aninteractive mode, where the user enters discrete commands to get step by step results, muchin the way that a graphing calculator is used and (2) in a programmable mode, where theuser stores a set of commands in a file, called a “script” or “m file”, so that the exact same setof commands can be executed repeatedly for solving problems that the engineer encounterson a frequent basis. The benefit of the interactive mode is that it is convenient and easyto use. The benefit of the programmable mode is that complex and repetitive tasks canbe completed easily without the tedium of operating a graphing calculator to solve similarproblems over and over. We will learn how to use the MATLAB engineering analysis toolboth in the interactive mode and in the programmable mode. You will then be able to usethis analysis tool throughout your study of mechanical engineering.

10.1.1 Formulate

It is convenient to learn MATLAB in the context of a familiar engineering problem. So, wewill re-visit the oscillatory spring-mass problem from our previous lab. We are going to doessentially the same analysis that we conducted previously with Excel, this time using theMATLAB engineering analysis tool.

334

Page 2: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

State the Problem

Given a mass m suspended from a linear elastic spring having a spring constant K developa computer simulation to predict the transient response of the vertical position of the massz(t) when it is released from a position z

1

away from neutral position of the spring. Usingyour simulation predictions, plot the vertical displacement z(t) of the mass as a function oftime t. Also, plot the potential energy of the mass PE(t), kinetic energy of the mass KE(t),and the elastic potential energy of the spring SE(t), as a function of time t. Neglect themass of the spring.

State the Known Information

The following information is provided

m = [kg] � Mass of Dead Weight (Constant) (10.1)

K = [N/m] � Spring Constant of the spring (10.2)

z1

= [m] � Initial Displacement of the mass from neutral (10.3)

State the Desired Information

Upon conclusion of the experiment and analysis, we shall be required to report the followingitems associated with the mass, m, suspended from the spring:

z(t) = ? [m] � Vertical displacement of m vs. time (10.4)

Vz(t) = ? [m/s] � Vertical velocity of m vs. time (10.5)

KE(t) = ? [J ] � Kinetic energy of m vs. time (10.6)

PE(t) = ? [J ] � Gravitational potential energy of m vs. time (10.7)

SE(t) = ? [J ] � Elastic potential energy of spring vs. time (10.8)

10.1.2 Assume

The assumptions are identical to those used in the previous week. They are repeated herefor convenience. Please refer to the previous chapter for the justifications.

mspring = 0 [N ] � Neglect mass of spring (10.9)

g = GmE

R2

E

⇡ 9.81 [m/s2] � Standard Gravity Near Earth (10.10)

Qmi!f = 0 [J ] � Neglect heat transfer (10.11)

Wmi!f = 0 [J ] � Neglect frictional work (10.12)

z = 0 [m] � Origin at neutral position (10.13)

z(t < 0) = z0

[m] � System previously at equilibrium (10.14)

335

Page 3: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

Vz1

= Vz(t = 0) = 0 [m/s] � Released from rest (10.15)

Vx(t) = 0 8 t [m/s] � Neglect horizontal motion (10.16)�!F = K�!x [N ] � External Force (10.17)

�!F R = �K�!x [N ] � Restorative Force (10.18)

10.1.3 Chart

The schematic diagram and free body diagrams are identical to the configuration used inthe previous week. They are repeated here for convenience.

10.1.4 Execute

If :�!F Net = 0 Then : �!a = 0 Newton’s 1st Law (10.19)

�!F Net = lim

�t!0

��!p�t

= lim�t!0

�(m�!V )

�t

=d(m

�!V )

dt

=d�!pdt

Newton’s 2nd Law (10.20)

�!F Action = ��!

F Reaction Newton’s 3rd Law (10.21)�!F g = g ·m # Newton’s Law of Gravity near Earth (10.22)

E2

� E1

= Q1!2

�W1!2

Work Energy Theorem (10.23)

336

Page 4: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

From the FBD we can write Newton’s Second Law,

Fs �mg = mdVz

dt(10.24)

[kgm/s2]� [kg][m/s2] = [kg][m/s]

[s]Basic Units

Substituting Fs = �Kz from Hooke’s Law Equation results in

�Kz �mg = mdVz

dt(10.25)

[N/m][m]� [kg][m/s2]� [kg][m/s2] = [kg][m/s]

[s]Basic Units

Notice that the signs in Equation 10.25 are consistent with the assumed direction of theforce on the FBD, and makes intuitive sense. If the mass is displaced above the system’sneutral axis, then z will be a positive value resulting in a negative value of Fs. A negativevalue of Fs means that Fs is acting in the direction opposite to the direction assumed on theFDB. For example, when the spring is compressed, the restorative force, Fs will be negativeor down, the same direction as gravity. When the spring is extended, the deflection z willbe a negative value resulting in a positive value of Fs. The restorative force will then be up,in the opposite direction of gravity. Thus far in the derivation we have considered two signconventions: (1) the assumed directions of forces from the FBD relative to our definition ofpositive z and (2) the definition of restorative force.

Re-arrange Equation 10.25, using a forward di↵erence approximation for the derivative:

Vzi+1

� Vzi

�t⇡ dVz

dt=

�1

m(Kzi +mg) (10.26)

[m/s]

[s]=

[�]

[kg]

�[kgm/s2]� [kg][m/s2]

�Basic Units

Notice that, if the spring displacement is down (�zk) then the force exerted by the springupon the mass is up (Fs = +Kzk). Also, from the definition of velocity, we can write

dz

dt⇡ zi+1

� zi�t

= Vzi (10.27)

Now, let’s rearrange Equations 10.26 and 10.27 so that all of the terms from time step i areon the right hand side, and all of the terms from time step i+ 1 are on the left hand side:

Vzi+1

= Vzi ��t

m(Kzi +mg) (10.28)

zi+1

= zi +�tVzi (10.29)

We know the initial position and initial velocity as:

Vzi=1

= 0 (10.30)

zi=1

= z1

(10.31)

337

Page 5: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

Equations 10.28 through 10.31 provide us with a convenient algorithm for creating a theo-retical simulation of this physical system. We will use these equations to solve the initialvalue problem. This method is known as “Euler’s Method.” Please note that the correctpronunciation of the name “Euler” sounds like “Oiler”.

10.1.5 Test

The units of this system are valid. As we complete our computer simulation, we shouldcompare the simulation results against our experimental data from the previous lab.

338

Page 6: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

10.2 Lab - Introduction to Matlab (Interactive Mode)

10.2.1 Scope

This week we will learn the basics of using the MATLAB engineering simulation tool. Youwill use this commercial product throughout your curriculum, and you may be asked to useit on co-op work assignments.

We will not meet in the engineering mechanics lab to take any data this week. Rather,you should use the Lab meeting time to proceed to a computer studio and complete the workdescribed below. It is very important that you complete the exercises to become familiarwith using the MATLAB engineering analysis tool in “interactive mode” during your Labperiod before coming to the Studio session later in the week. You are expected to completethe interactive mode activities on your own, without faculty guidance.

After your complete the interactive session with MATLAB independently during your Labperiod, you will be ready to begin learning how to use the MATLAB engineering analysistool in programmable mode during your Studio class period. We will use the programmablemode of the MATLAB engineering analysis tool to develop an engineering simulation thatcan predict the transient response of a spring-mass system when subjected to an initialdisturbance. Each member of the lab team will develop a separate simulation “script” or “mfile”, and will use their program to simulate the unique transient response for their particularspring-mass system that was conducted previously in Lab.

Goal

The goals of this week’s activities are to:

1. learn how to use the MATLAB engineering analysis tool in interactive mode duringthe Lab period,

2. learn how to use the MATLAB engineering analysis tool in programmable mode duringthe Studio period,

3. understand rudimentary methods for creating computer simulations of physical sys-tems,

4. develop a computer simulation script of a physical system using the work - energytheorem, and

5. predict the oscillatory response of a simple harmonic system.

Units of Measurement to use

Your MATLAB interactive commands and programmable scripts should be written usingthe SI system of units. It is your responsibility as the engineer to ensure that you use thecorrect units in the MATLAB engineering analysis tool. Just as it is your responsibility to use

339

Page 7: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

correct units when doing calculations with a hand-held calculator, you must be conscientiousabout proper units when using MATLAB.

Quantity Basic units Derived units

Length [m] [m]Mass [kg] [kg]Time [s] [s]

Velocity [m/s] [m/s]Force [kgm/s

2] [N ]Energy [kgm2

/s

2] [J ] or [N ][m]Impulse [kgm/s] [N ][s]

Momentum [kgm/s] [N ][s]Work [kgm2

/s

2] [J ] or [N ][m]

Table 10.1: Units of measurement to be used for oscillatory spring mass system.

10.2.2 Reference Documents

The following documents may be helpful.

• The on-line Help Information within the MATLAB environment is excellent. Whenyou go to a computer lab to perform the interactive exercises, you should begin bywatching the ?Getting started with MATLAB” using the link found in the Week 10Content on myCourses. There are also links to other resources that you may find helpfulincluding an in depth tutorial course by Lynda.com o↵ered through RIT?s library. The“Getting started” video demonstrates how to use the MATLAB engineering analysistool in interactive mode. You will likely find it useful to watch the video while followingalong in MATLAB, pausing it as needed so that you can complete each task, typingyour own commands in your MATLAB Command Window as the video demonstrates.It is essential that you do these interactive MATLAB activities prior to your Studioperiod. The Lynda.com course “Up and Running with MATLAB” for which a link isprovided in the Week 10 Content of myCourses also has several exercise files for usewhile watching the tutorial videos that can be downloaded.

10.2.3 Terminology

The following terms must be fully understood in order to achieve the educational objectivesof this laboratory and studio experiment.

340

Page 8: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

Measurement Modeling SimulationInterpreter Script m-fileString Variable arrayWorkspace Command indexcounter Comment Functiongrid Axes LegendFigure Plot SubplotHandle

10.2.4 Summary of Test Method

This Lab, which you are to complete independently, will help you learn how to use theMATLAB engineering analysis tool in interactive mode. During Lab you will be asked tocomplete several tasks. These tasks will help you learn how to use MATLAB as an interactivetool.

10.2.5 Apparatus

Each student will need access to a computer with a MATLAB Student License. All Stu-dio computers in the Mechanical Engineering Department have valid license. Students arewelcome to use these computers during class period and during open studio hours.

Students may choose to purchase a student license for MATLAB to use on their ownpersonal computer, since the pricing is highly reduced for students. Please note that youare not required to purchase their own license for MATLAB, and there are many computersavailable in the ME department with the software installed. If a student is interested inpurchasing MATLAB, we recommend that they get advice from one of the instructors firstregarding which package to purchase.

10.2.6 Sampling, Test Specimens

During the Studio portion of this activity, each student should use the mass and initialdisplacement that reflects the data they acquired during the experiment in the previousweek. You do not need to collect any additional data this week.

10.2.7 Preparation of Apparatus

The software is already installed on the mechanical engineering department computers.

10.2.8 Calibration and Standardization

We will confirm that the MATLAB program works properly by using it to solve a wide rangeof example problems that we already know the answer for.

341

Page 9: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

10.2.9 Procedure - Lab Portion

Please complete these activities after the Lecture period and before the Studio period. Sincethere is no experimental data collection this week, you are strongly encouraged to use theLab period to do this work independently, without faculty guidance.

1. Login to a computer in a mechanical engineering department computer studio.

2. Start the MATLAB program, by clicking on the appropriate icon.

3. The MATLAB program will come up on your screen and has several sub-windows, asillustrated below.

4. Use the pull down menu to navigate to the “Help - Demos”. A new window will popup,similar to that shown below.

5. Watch the video “Getting Started” If your version of MATLAB does not have menuoptions for these MATLAB videos you can access them on YouTube.

6. Follow along with the video tutorial, and execute the commands that you see beingperformed in the tutorial.

7. After completing the interactive video demo, please clear the Command Window, Com-mand History and Workspace variables. Then follow the tasks outlined below usingthe MATLAB Command Window.

8. Create three variables, and assign them values as a = 1, b = �3, and c = 2.

342

Page 10: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

9. Compute the sum d = a+ b+ c.

10. Compute the quotient e = b/c.

11. Compute f = 4 ⇤ atan(1.0).

12. Solve for the roots of the quadratic equation x2 � 3x + 2 = 0. Find the solution byfactoring the equation in your logbook, and then find the numerical solution usingthe quadratic formula in MATLAB. HINT: you will have to create a vector for thepolynomial equations coe�cients as A = [1,�3, 2]. Then use the command roots(A) tocalculate the roots of the polynomial. You can type help roots to get more informationin the Command Window on the roots command.

13. Create an array of numbers, and assign them values as A array = [0.0, 0.5, 1.0, 2.0, 3.0]

14. Create an array of numbers, and assign them values asB array = [0.0, 0.25, 1.0, 4.0, 9.0]

15. Plot the two arrays against one another, with A array on the horizontal axis, andB Array on the vertical axis. plot(A array,B array)

16. Place a title, and axis labels on the plot. Use the following commands xlabel(’X titlehere’); ylabel(’Y title here’); title(’Plot title here’);

17. Add two arrays together: C array = A array +B array

18. Multiply an array by a constant C array = 2.5⇥C array. Notice that we are replacingthe contents of C array in-place with a value 2.5 times the original value. This is calledan assignment expression, common to most programming languages. An assignmentexpression is not a mathematical equality in the sense of a mathematical equation. Inreading this expression, it should be interpreted to mean “Set the value of each elementof the array C to two and half times the values stored in each corresponding elementof the array C.”

19. We can also refer to individual elements of an array. For example make the assignmentg = A array(1) +B array(3) to add the first element of array A to the third elementof array B, and assign the result to the scalar, g.

20. Next, let’s do a calculation of the spring mass simple harmonic motion that was ob-served in lab last week. We will use the analytical solution to the di↵erential equationhere, which is a fairly simple calculation. We begin by calculating the time array usingthe MATLAB command linspace. Type the following to define time as an array of 300time values from 0 to 3: t = linspace(0,3,300);. Note, the semicolon that was addedto end of the line. This tells MATLAB to not echo the command and it’s calculationto the Command Space window. This is particularly useful when calculating largerarrays such as this 300 value vector.

343

Page 11: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

21. Before we can calculate the array for the elevation with respect to time, we need todefine a couple values related to the motion of the spring-mass system. Define theamplitude (A = 0.0887;), mass (m = 0.19;), acceleration due to gravity (g = 9.81;),spring constant (K = 11.3;), angular velocity (omega = sqrt(m/K);). Now, type thefollowing to calculate the elevation: z = A*cos(omega*t ) - m*g/K;.

22. Plot the results by typing plot(t,z). Note, if you didn’t close the previous plot, thenew one created by this command may be hidden behind the main MATLAB window.Check for it by minimizing the main window.

23. Use the command key combination “Control-Alt-PrintScreen” to capture an image ofyour MATLAB workspace, showing that you have completed the tasks. Paste thescreen capture image into a word document called LastnameMATLABInteractive.docand upload the word document to the myCourses dropbox for Week 10.

24. In your logbook indicate how you would implement Equations 10.26 through 10.29 inMATLAB syntax. Bring these Logbook notes with you to Studio.

344

Page 12: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

10.3 Studio - Matlab Simulation of Simple HarmonicMotion

Now, we will use the knowledge that we gained from last week’s Lab and Studio lesson,to introduce the engineering application core concept of “simulation.” We are going tocombine our knowledge of Newton’s laws of motion and gravity, the work energy theorem,modeling (Hooke’s law for linear elastic materials), and calculus to write a simple programthat we can use to predict the motion of a mass when it is connected to a spring, displacedfrom its initial equilibrium condition, and then allowed to oscillate. We will also learn anew engineering tool that we will use throughout our curriculum – a commercial computerprogramming environment called MATLAB. We will start this process next week, but it isgood to understand the motivation for this new tool in the context of the work we have justcompleted!

10.3.1 Procedure - Simulation

The objective of this simulation is to use first principles to predict the response of a spring-mass system to an initial disturbance, in the form of a displacement from the equilibriumposition.

In last week’s lecture, we learned that the equation governing the motion of the spring-mass system was given by Equation 9.25. This equation was developed from the applicationof Newton’s Second Law, using the information available in the free body diagram of themass. We can re-arrange Equation 9.25 algebraically, and use a forward di↵erence approxi-mation for the derivative to obtain

Vzi+1

� Vzi

�t⇡ dVz

dt=

�1

m(Kzi +mg) (10.32)

[m/s]

[s]=

[�]

[kg]

�[kgm/s2]� [kg][m/s2]

�Basic Units

Also, from the definition of velocity, we can write

dz

dt⇡ zi+1

� zi�t

= Vzi (10.33)

Now, let’s rearrange Equations 10.32 and 10.33 so that all of the terms from time step i areon the right hand side, and all of the terms from time step i+ 1 are on the left hand side:

Vzi+1

= Vzi ��t

m(Kzi +mg) (10.34)

zi+1

= zi +�tVzi (10.35)

We know the initial position and initial velocity as:

Vzi=1

= 0 (10.36)

zi=1

= z1

(10.37)

345

Page 13: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

Equations 10.34 through 10.37 provide us with a convenient algorithm for creating a theoret-ical simulation of this physical system. In later classes, we will learn that this is a numericalmethod called “integration of a linear system of initial value problems.”

Now, we want to implement these into a computer simulation using MATLAB’s pro-gramming or script environment. Specifically, we will write a MATLAB script to performthe following operations:

1. Create vectors to store results for time t, vertical position z, velocity V , elastic potentialenergy SE, gravitational potential energy PE, kinetic energy KE, and total energyE. Create scalar variable for index i, mass m, time step �t, and spring constant K.

2. Assign appropriate numerical values to the scalars m, K, �t.

3. Set the index to i = 0. Populate the vectors t, z, V , SE, PE, KE, and E to reflectthe initial equilibrium condition of the spring mass system.

4. Set the index to i = 1. Populate the vectors t, z, V , SE, PE, KE, and E to reflectthe initial disturbance that you introduced experimentally into your trial of the springmass experiment in lab.

5. Write a “loop” in MATLAB to cycle the index i from an initial value of i = 2 to a finalvalue consistent with the number of samples you acquired in your experiment.

6. Use Equation 10.35 to predict the position of the spring-mass system at time index iin terms of data known from time index i� 1.

7. Use Equation 10.34 to predict the velocity of the spring-mass system at time index iin terms of data known from time index i� 1.

8. Predict the value of t, SE, PE, KE, and E at time index i.

9. Continue the loop until the final time index is achieved.

10. Use a MATLAB function to create a plot of your predictions for z(t) vs. t. Useappropriate labels and good graphing practices.

11. Use a MATLAB function to create a plot of your predictions for SE, PE, KE, andE vs. t. Use appropriate labels and good graphing practices.

12. Print out a hard copy of your MATLAB script, and your plots. Paste them into yourlogbook.

13. Save all files electronically, so you can use them again in the future.

14. Compare your predicted values of SE, PE, KE, and E vs. t from your simulationagainst the experimentally determined values of the same terms from your spreadsheetanalysis. Explain any discrepancies.

346

Page 14: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

A MATLAB script file is nothing more than a text file containing a series of commandswhich are executed in sequential order, very similar to the commands that we employed ininteractive mode. It is convenient to store commonly used MATLAB commands in a scriptfile, so we can re-use them time and time again, much like an Excel worksheet can be reusedby copying a new set of data into it. In MATLAB, it is conventional to call these script files“m files”, and use the file naming convention “LastnameProblemname.m” when creatingthem.

Studio Pre-work

Pre-work this week will be to complete the MATLAB exercises described in Section 10.2.9.You should save a screen capture to document that you have completed theinteractive mode tasks as an independent exercise before coming to Studio.

You may find it helpful to make personal notes about using the MATLAB engineeringanalysis tool in your logbook. When you arrive at the Studio, you will be asked to workthrough each of the following steps. Lab assistants will be available to help you as youencounter di�culties. You will need to use the computers in one of the computer studiolabs to do several of these activities, which all have MATLAB licenses, and you will need tocomplete several items in your engineering logbook.

Videos

There are numerous videos available in the MATLAB demo link and on YouTube to watchand independently learn how to apply MATLAB to conduct mathematical analyses. Youare encouraged to take an opportunity to learn new skills, such at MATLAB, with thesevaluable (and free) on-line resources. In fact, the instructional faculty for this course haveused multiple free on-line resources to stay current in the latest technology and computingtools that have all come onto the market long after we graduated. Continuously upgradingyour expertise and agility with modern engineering tools used to solve engineering problemswill enhance your marketability to employers. There are hundreds of video tutorials availablefor MATLAB, and some of them are quite sophisticated. It is definitely worth spendingsome time learning how to find the videos that are at the proper level of sophistication foryour personal level of expertise. You will likely find that you will rely upon increasinglysophisticated example videos as you progress through your academic program of study.

Steps to Complete the Analysis

Note that a text file is provided for you in the Week 10 Content of myCourses that has thecode shown in the step-by-step instructions. You should use this to copy the lines of codeinto your MATLAB script file. This will work better that copying from this pdf file, sincesome of the characters are di↵erent that what MATLAB is expecting and will result in errorswhen attempting to run the script. Alternatively, you can simply, retype what is written in

347

Page 15: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

the steps. If you copy the code from the text file, be sure to update it at each step here toreflect your own lab values and comments as appropriate.

1. CREATE A SCRIPT FILE: from within the MATLAB environment, use the pull-downcommand to execute “File - New - Script.” After the script editor window opens, usethe pull down command to execute “File - Save As” and save this file to your thumbdrive, in a folder named Studio10 and a file name that incorporate your last nameand the name of the problem you are working on: Lastname harmonic motion.m.

2. CREATE A TITLE BLOCK: In the script editor window, create a title block for yourcomputer simulation script. In the ME department, your title block should alwaysinclude the name of the author, the academic term, the name of the course, and adescriptive title. You may add comments to explain the use and limitations of yourscripts. Over your career, as you develop a library of scripts, this will be an importantway for you to build upon previous knowledge. In MATLAB, the special character% is used to indicate that any text on the current line to the right of the characteris considered a comment, and is not considered a command to MATLAB. It is goodpractice to start each script with commands to clear all variables from workspacememory, and to clear the contents of the command window.

%Authors: Enter your name here%Enter other relevant information like course, date, assignment%% Any text (like this) following a percent sign is a comment

clear % clear up the workspace, removing old junk from memoryclc % clear command window

3. CREATE A LIST OF KNOWN INFORMATION: In the script editor window, createa number of scalar variables that contain known information for numerical simulation.These expressions should look similar to those shown below but should be replacedwith numerical values appropriate for your experiment. By using the same table ofconstants as your experiment, you will be able to compare your simulated oscillationplots with your experimental measurements.

The semicolon at the end of each line inhibits MATLAB from printing intermediateresults to the screen. It is good engineering practice to include a comment on eachline, indicating the engineering units associated with each assignment statement. Notethat it is your responsibility, as the engineer, to verify that the units of every equationand constant are correct, since the simulation tools (both Excel and MATLAB) andthe program have no concept of units associated with the mathematical expressionsand assignment statements.

348

Page 16: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

%___Set the known information and simulation parameters for the simulation% Enter appropriate values for the XXXXX place-holders% from your Week 9 experiment here.

z_initial = XXXX ; %[m]Vz_initial = XXXX ; %[m/s]Mass = XXXX ; %[kg]Gravity = 9.81 ; %[m/s^2]Spring_Constant = XXXXX ; %[m/s^2]

4. CREATE A LIST OF SIMULATION PARAMETERS: In the script editor window,create a number of scalar variables that describe how you would like the simulationto be conducted. Indicate the length of time that your simulation should run, andthe time in between calculations. For your first simulation, use a large time step, forexample 0.05 sec and an end time of 3 seconds. This means that your simulationwill solve the model equations at 0 seconds, 0.05 seconds, 0.1 seconds, 0.15 secondsand so on, until the simulation has run for 3 seconds. We will study the e↵ect ofthis simulation parameter later. These expressions should look similar to those shownbelow, but should be replaced with numerical values appropriate for your experiment.

% Determine the length of time we want the simulation to runEnd_Time = 3.0; % [s]Delta_Time = 0.05; % [s]

5. CREATE A LIST OF DESIRED INFORMATION: In the script editor window, createseveral array variables that will be used to store your simulation results. We first willcompute how many array elements will be needed to store the answer for a givensimulation duration and time increment. Then, we will create an array for each setof answers, with that many elements. It is good programming practice to initializeall of these variables in each element of the array to a value of zero, as shown below.MATLAB provides a built-in function, called “zeros” for precisely this purpose. Forexample, we create an array called Time Array that has NTime rows and 1 column ofnumbers, and is filled with a numerical value of 0.0. We create one array full of zerosfor each physical attribute that we wish to simulate as we describe the motion of thespring mass system.

% Determine how many time steps are neededNTime = End_Time / Delta_Time ; % [-]% Initialize the vectors for storing data% Filling each vector with zeros is good programming practiceTime_Array = zeros ( NTime, 1 ) ; % NTime rows and 1 columnz_Array = zeros ( NTime, 1 ) ;

349

Page 17: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

Vz_Array = zeros ( NTime, 1 ) ;az_Array = zeros ( NTime, 1 ) ;E_Array = zeros ( NTime, 1 ) ;KE_Array = zeros ( NTime, 1 ) ;PE_Array = zeros ( NTime, 1 ) ;SE_Array = zeros ( NTime, 1 ) ;

6. ESTABLISH THE INITIAL CONDITIONS: In the script editor window, set the cur-rent time counter (the index to refer to the elements of the array) to unity. Set theinitial condition on time to be equal to zero, and use the initial displacement and ve-locity to set the known information at the first element of the arrays. Initialize thespring elastic potential energy, gravitational potential energy, kinetic energy, and totalenergy of the system using the known information.

% Establish the Initial ConditionNt = 1;Time_Array(Nt) = 0.0 ;z_Array(Nt) = z_initial;Vz_Array(Nt) = Vz_initial;SE_Array(Nt) = 0.5 * Spring_Constant * z_Array(Nt)^2;PE_Array(Nt) = Mass * Gravity * z_Array(Nt);KE_Array(Nt) = 0.5 * Mass * Vz_Array(Nt)^2;E_Array(Nt) = KE_Array(Nt) + PE_Array(Nt) + SE_Array(Nt) ;

7. LOOP OVER ALL TIME STEPS: In the script editor window, we will create a “For”loop. The “For” loop in MATLAB is a programming construct that easily allows usto compute very repetitive information. In the example below, the “For” loop uses anindex (or time step counting) scalar variable named Nt, which will vary from 2 to NTimewith a default increment of 1. Every command between the For statement and the endstatement will be executed in sequence each time the time step is incremented. In thesimulation below, we first update the current time, and then compute the new sum ofthe forces from the free body diagram. Since the force exerted by the spring dependsupon the displacement of the spring, we use the most current displacement informationavailable, at the previous time step, to estimate the displacement, and hence the springforce, at the current time. Clearly, the spring force varies as a continuous function ofdisplacement. We are implicitly assuming here that the spring force is constant over thesmall interval of time. Given the sum of forces, we can use Newton’s second law and theforward di↵erence approximation in the definition of acceleration to predict the verticalvelocity at the new time, in terms of information available from the previous time.Similarly, we can predict the new elevation using a forward di↵erence approximationin the definition of velocity using information from the previous time. After the newdisplacement is known, we can readily compute the kinetic, gravitational, elastic, and

350

Page 18: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

total energy of the system at the new time. We are then ready to move forward to thenext time step, and do the whole process again, until the total number of time stepshas been completed.

% Loop over each time step, Using the simulation equationsfor Nt = 2:NTime

Time_Array(Nt) = Delta_Time * (Nt - 1);Fz_sum = -Spring_Constant * z_Array(Nt-1) - Mass * Gravity;Vz_Array(Nt) = Vz_Array(Nt-1) + Delta_Time * Fz_sum / Mass;z_Array(Nt) = z_Array(Nt-1) + Delta_Time * Vz_Array(Nt-1);SE_Array(Nt) = 0.5*Spring_Constant * z_Array(Nt)^2;PE_Array(Nt) = Mass * Gravity * z_Array(Nt);KE_Array(Nt) = 0.5 * Mass * Vz_Array(Nt)^2;E_Array(Nt) = KE_Array(Nt) + PE_Array(Nt) + SE_Array(Nt) ;

end

At this point, the heart of the simulation is done, and we now need to present ourresults.

8. PLOT THE COMPUTED DISPLACEMENT DATA: In the script editor window, wewill next enter commands to create a plot of Elevation z[m] on the vertical axis vs.Time, t [s] on the horizontal axis. We will subsequently want to create a second plot aswell, so we use the MATLAB command figure to set the groundwork for a multi-plotscenario, and then assign the “handle” firstplot, so that we can distinguish betweenthe plots we will create. We can choose any convenient name for the handle. We createthe plot using the MATLAB intrinsic command plot with three arguments. The firstargument provides the handle on which the curve is to be created. The second andthird arguments, respectively, provide the array of horizontal and vertical axis values inan array that will be used to create the plot. These arrays represent a series of orderedpairs for the plotting points, and the default curve type in MATLAB is a straight lineconnecting the points. The next set of commands enables the grid to be displayed, andcreates appropriate labels for the figure title, y axis, and legend.

% create a single figure with two plots in itfigure% the first plot contains elevation vs. time% the first plot is in row 1, of an array of 2 rows and 1 column of plotsfirstplot = subplot(2,1,1);plot(firstplot,Time_Array,z_Array);grid on;ylabel(firstplot, ’Elevation [m]’);legend(firstplot, ’ Elevation’,’Location’,’NorthEastOutside’);title(firstplot,’Simple Harmonic Motion’);

351

Page 19: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

9. PLOT THE COMPUTED ENERGY DATA: In the script editor window, we will nextenter commands to create a plot of SE, PE, KE and E vs. Time, t [s]. The next setof commands enables the grid to be displayed, and creates appropriate labels for thex axis, y axis, and legend. Since this plot is part of a combined figure, the title for theentire figure is presented above the top-most sub-plot by convention. The horizontalaxes are linked to one-another, to ensure that the scaling remains consistent betweenboth sub-plots.

% the second plot contains energy vs. time% the second plot is in row 2, of an array of 2 rows and 1 column of plotssecondplot = subplot(2,1,2);plot(secondplot, Time_Array,E_Array, Time_Array,SE_Array, Time_Array,KE_Array,Time_Array,PE_Array);grid on;xlabel(secondplot, ’Time [s]’);ylabel(secondplot, ’Energy [J]’);legend(secondplot, ’E Total’,’SE Spring’,’KE Mass’,’PE Mass’,’Location’,’NortheastOutside’);% show both plots with the same time scalelinkaxes([firstplot secondplot],’x’);

10. SAVE AND EXECUTE THE SCRIPT: Periodically, as you work, save your work toyour USB drive, so that you have a convenient recovery point in the event of a signifi-cant error. After saving your completed script, we will next enter a single command,the name of your m-file, as a command in the command window:

Lastname_harmonic_motion

Now, just as you were able to enter single commands interactively in the previous Lab,you can run your entire script as easily as entering a single command! When youexecute the script, you should see a window pop-up, containing your plot, that willlook something like the one shown in Figure 10.1.

Don’t despair! It is a rare event when a program works properly the first time. In fact,debugging and trouble-shooting of systems is one of the jobs that engineers are famousfor excelling at. Your first attempt at writing a script may or may not be successful.And, you should never expect your first output from a script or computer program ofany type to be correct. In fact, assuming that the output of a computer program isaccurate is usually one of the biggest mistakes that an engineer can make.

11. TEST YOUR SIMULATION: As we look at the results presented in Figure 10.1, itis clear that something is seriously wrong with the results. First of all the elevationresponse, while periodic, grows in an unbounded fashion. This is not consistent with

352

Page 20: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

Figure 10.1: Simulation results from the first example run of the script.

our physical observations in the Lab last week. The plotted results do not look similarto the plotted results of our experimental data from Studio last week either. Why isthis? What is happening? Comment on your thoughts and response to these questionsin your logbook. Next, look at the second plot, of total system energy vs. time. thesystem energy appears to be growing in an unbounded fashion over time. Clearly this isa violation of the core principle of the conservation of energy. This clear violation of theconservation of energy should suggest to use that something is seriously wrong with oursimulation. Common errors to check for including typographical errors, capitalizationerrors, letter case errors (mixing lower and upper case letters results in unique variablenames), theoretical errors, or simulation (numerical approximation) errors. You willneed to study your results carefully. You may well have multiple such errors in yourscript. Errors such as typos are called “bugs” and it often takes a great deal of timeand frustration to track down bugs. Removing the semi-colon from the end of lines inyour script will allow you to selectively study the output of your script, and determinewhere some mistakes originate. However, something more serious is happening inour simulation. What can it be? During Studio, please work with your instructor tobrainstorm some possible sources of error in your results. Document this brainstormingsession in your logbook.

12. ITERATE ON YOUR SIMULATION: During Studio, you and your instructor willinvestigate potential reasons that your simulation results are inconsistent with firstprinciples. By the time you complete your iterative investigation and track down all ofthe bugs and numerical approximation errors, you should arrive at a solution similar

353

Page 21: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

to that shown in Figure 10.2.

Figure 10.2: Simulation results from the final example run of the script.

In your logbook, document your iterative problem-solving and trouble shooting method.Describe how you ultimately found the errors in your simulation, and resolved them.Explain not only how you found the correct results, but why you believe your simu-lation results to be accurate. Compare your predictive simulation results with yourexperimental results from last week. Fully explain the similarities and di↵erences be-tween your experimental observations and your theoretical predictions.

13. Congratulations you have just completed the Studio portion for Week 10! This isa very large step! At this point, you have been able to conduct a highly technicalexperimental investigation, and related your experimental observations to the results ofa computer simulation predictions developed from a set of first principles and a rigorousmathematical result. You have brought together measurements (from lab), modeling(through Hook’s Law for the spring constant, K) and simulation (from MATLAB) tofully achieve an understanding of the core principles of Newton’s First, Second, andThird Laws, Newton’s Law of Gravity, and the conservation of energy! Wow!

14. Remember to remove your USB drive from the computer, and take it with you whenyou leave the Studio. Save your MATLAB m-file to the USB drive. You may wantthis file in the future! Please be sure to sign and date your engineering logbook beforeyou leave the studio, and to submit your MATLAB m-file to your individual Week 10dropbox on myCourses before leaving the room.

354

Page 22: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

10.3.2 Report

There is no lab report due this week.

355

Page 23: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

10.4 Recitation - Exam Review Preparation

Recitation this week will focus on problem solving. Please come prepared, with your attemptsat the homework problem already in your logbooks. The primary focus of your studies thisweek should be on preparing for your upcoming examination.

356

Page 24: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

10.5 Homework Problems

1 A student is driving home for break-week along the New York State Thruway at aspeed of 65[mph] and sees a deer slowly crossing the highway 1/10th[mile] ahead (thedistance between reflective markers on the Thruway). Assuming that the student hasa fast reaction time of 0.65[s] and the vehicle has a maximum braking accelerationof �0.6g, is the student able to stop before hitting the deer? If the student can stopbefore impact, what is the stopping distance? If the student cannot stop before impact,at what speed does the impact occur?

2 A student is at a speed of 30[mph] along East River Road in Henrietta, just o↵ of theRIT Campus. The signal light next to the delicatessen turns red, just as she is 100[ft]from the intersection. Assuming a reaction time of 0.50[s] between when she sees thelight change, and depresses the brake pedal, what deceleration must she experience (ing’s) in order to avoid running the red light? Is this deceleration reasonable? Justifyyour answer.

3 A student lives in the RIT dorms, and has a four-blade fan in the window on a warmFriday evening. The electric fan rotates at 750[rpm] and has a tip radius of 18[in]from the centerline of rotation. The student, trying to show o↵, boasts that he canswipe his hand between the moving blade-tips without getting touched by the rotatingblade. The student is willing to bet one semester of tuition that he can do it. If heis successful, you have to pay his tuition, and if not, he has to pay yours. Should youtake the bet?

4 The Genesee River is about 20[m] wide at one location, and flows at a speed of 1.5[m/s]during a certain part of the year. A student leaves the RIT boat launch in an innertube, and paddles across the river at a speed of 4[m/s]. How long does it take thestudent to reach the far bank of the river? How far down-stream does the studentland?

5 The pilot of a passenger jets takes o↵ from the Rochester International Airport, ROC,with an airspeed of 700[km/h] and wants to fly in a straight light towards Toronto,Canada. If the prevailing winds at the cruising altitude of the aircraft is 250[mph] fromWest to East, what compass heading should the pilot point the aircraft? Neglectingacceleration and deceleration time, what is the approximate cruising time for the trip?

6 The pilot of a passenger jets takes o↵ from the Rochester International Airport, ROC,with an airspeed of 700[km/h] and wants to fly in a straight light towards John F.Kennedy Airport in NYC. If the prevailing winds at the cruising altitude of the air-craft is 250[mph] from West to East, what compass heading should the pilot pointthe aircraft? Neglecting acceleration and deceleration time, what is the approximatecruising time for the trip?

357

Page 25: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

7 Two masses are constrained to move relative to one another by ideal cables movingover ideal pulleys. If the coe�cient of friction between m

1

[kg] and the surface is µ[�],and m

2

[kg] is released from rest, find the following:

# Item Units(1) FBD for m

1

(2) FBD for m2

(3) a for m1

[m/s2](4) a for m

2

[m/s2](5) T for cable [N ]

8 Two masses are constrained to move relative to one another by an ideal cable movingover an ideal pulley. If the coe�cient of friction between m

1

[kg] and the surface isµ[�], and m

2

[kg] is released from rest, find the following:

# Item Units(1) FBD for m

1

(2) FBD for m2

(3) a for m1

[m/s2](4) a for m

2

[m/s2](5) T for cable [N ]

9 A mass is suspended from cables as shown in the figure. If the angle is ✓ = 45[deg],find the following:

# Item Units(1) T

1

for cable [N ](2) T

2

for cable [N ](3) T

3

for cable [N ]

10 A mass is suspended from cables as shown in the figure. If the angle is ✓ = 35[deg],find the following:

358

Page 26: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

# Item Units(1) T

1

for cable [N ](2) T

2

for cable [N ](3) T

3

for cable [N ]

11 A mass m1

is on a wedge of mass m2

, of angle ✓ being pushed with force F . Bothsurfaces are frictionless. What force must be applied to the wedge to ensure that thesmall mass m

1

remains in position relative to the wedge, without sliding up or down?Find the following.

# Item Units(1) FBD for m

1

(2) FBD for m2

(3) a for m1

[m/s2](4) a for m

2

[m/s2](5) F applied [N ]

12 A mass m1

is on a wedge of angle ✓ and with a static coe�cient of friction µs betweenthe mass and wedge. The spring is of sti↵ness K. Find the following.

# Item Units(1) FBD for m

1

(2) FBD for Spring(3) Deflection of Spring [m/s2]

13 A 1 kg block is sliding down an inclined ramp. The ramp makes an angle of 12 degreescounter clockwise from the horizontal. What is the magnitude of the gravitationalforce on the block? What are the x and z components of the the gravitational force?(Take x as positive to the left and z as positive to up).

14 A 100 lb block is sliding down an inclined ramp. The ramp makes an angle of 60 degreescounter clockwise from the horizontal. What is the magnitude of the gravitational forceon the block? What are the components of the gravitational force along the axes normaland tangential to the inclined ramp? Draw the force vector diagrams, labeling all yourangles and forces.

359

Page 27: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

15 According to the KGCOE Honors Principles, which of the following is not a violationof those principles?

A) Observing a student cheating on an exam and not reporting it.

B) Copying another student’s homework.

C) A faculty member who allows unethical behavior to continue without challengingit.

D) Discussing all the details of how you solved a homework problem with anotherstudent before the homework is due.

E) Borrowing a copy of a room-mate’s textbook, scanning it, and posting the contentson a file sharing website.

16 CHALLENGE PROBLEM. A uniform block weighing 500[lb] is constrained bythree wires as shown in the figure. Find the following.

# Item Units(1) The tension in the left wire [N ](2) The tension in the middle wire [N ](3) The tension in the right wire [N ]

17 You and your roommate are playing air hockey with two pucks. You strike your puckand cause it to travel at 0.75[m/s] and your roommate strikes her puck causing it totravel at 1.25[m/s]. The directions of the pucks are shown in the figure. After thepucks collide, your puck travels directly to the right (along the horizontal dotted line).What is the final momentum of your roommate’s puck after the collision? Find thefollowing.

# Assume:(1) ↵ = 10�, � = 20�, myours = mRM .(2) ↵ = 20�, � = 10�, myours = mRM .(3) ↵ = 10�, � = 20�, myours = 2mRM .(4) ↵ = 20�, � = 10�, myours =

1

2

mRM .

18 You have designed an experiment similar to the two cart collision experiment fromearlier in the course. One cart weighing 300[gr] is traveling at 3[m/s] to the right onthe flat portion of the track. Another cart is traveling in the opposite direction andhas a mass of 600[gr]. The two carts have Velcro attached such that after the collision

360

Page 28: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

they act as a combined mass. After the collision, the combined mass travels to the leftat 0.5[m/s]. Determine the initial speed of the 600[gr] cart.

19 A bullet is shot at a hanging mass and impacts it as illustrated in the figure. Assumethe bullet embeds itself in the mass after hitting it. The mass is m = 3.25[kg] and themass of the bullet is 25[gr]. After the impact, the mass swings to a height of 55[cm]above its original hanging position. Determine the initial speed of the bullet.

20 You are asked to investigate a two car collision at an intersection near your house.It is known that a 10, 000[N ] truck traveling due west at 55[mph] collided with a15, 000[N ] sport utility vehicle (SUV) traveling due north at 25[mph]. Assuming thecollision causes both vehicles to remain attached after colliding, determine the velocity(magnitude and direction) of the combined vehicle immediately after impact.

21 In game 1 of the World Series a pitcher for the Detroit Tigers throws a 98[mph] fastballthat is hit by a batter. The fly ball coming o↵ the bat is traveling at 117[mph]. Assumea baseball weights 145[gr] and the total contact time of the ball and bat is 0.0015[s].

A) Determine the Impulse of the bat on the ball if�!V pitch =

⇣�68ı� 68|� 23.5k

⌘[mph]

and�!V flyball =

⇣+85ı+ 52|+ 61k

⌘[mph]

B) Estimate the average force applied from the bat to the ball during the hit.

22 How much time do you need to exert a force of 65[N ] to generate an impulse of 15[Ns]?

23 What force must be applied over 9[sec] to create an impulse of 106[Ns]?

24 What is the momentum of a 15[kg] mortar shell traveling at 80[m/s]?

25 A bowling ball traveling at 4.5[m/s] has 11.25[kgm/s] of momentum. What is theweight [N ] of the bowling ball?

26 Determine the Impulse generated by a rocket that creates of force of 60[lb] for 2.12[sec].

27 A laborer pushes a 50[kg] refrigerator at constant speed across the level kitchen floorof Colony Manor apartments a distance of 3[m] when the coe�cient of friction is 0.45.How much work does the laborer do?

361

Page 29: Chapter 10 Simulation - Matlab Simulation of Simple ...insideme.rit.edu/edge/MECE-102/public/week10.pdf · Simulation - Matlab Simulation of Simple Harmonic Motion 10.1 Lecture -

28 An RIT Electrical Engineering student drops a water balloon of mass m[kg] from rest,from the top of the James Gleason Hall to the grassy area on the north side of thebuilding, h[m] below. The balloon (missing the Mechanical Engineering student whonaturally stepped out of the way), and neglecting air friction, calculate the speed ofthe balloon when it strikes the ground.

29 An RIT engineering co-op student is asked to design a resilient crash barrier for runawaybanana trucks that get out of control as they descend a steep grade near Warsaw, NY.The specifications call for stopping a truck wighting 50, 000[lb] moving at 30[mph] witha deceleration not to exceed 5g. What spring constant would be required to stop thistruck, and how far would it have to compress? Is this a reasonable design?

30 The RIT ski club makes annual trips to Bristol Mountain ski resort. A first yearmechanical engineering student pushes o↵ from the starting point, assuming that thepush-o↵ will allow him to beat his room-mate in a race down the slope. Calculate thedi↵erence in speed of the student who pushes o↵ with a starting speed of 1[m/s] vs astudent who starts from rest, after both students have dropped 5[m] in elevation fromtheir starting point.

31 The RIT Aero Design club launches a rocket of mass m[kg] straight upward withconstant acceleration. The team has installed two set of photo-gate sensor to measurethe speed of the rocket as it passes by. At the first sensor, the rocket is travelingupwards at V [m/s]. At the second sensor located H[m] above the first sensor, therocket is observed to be traveling at 1.5V [m/s]. The rocket burns fuel at m[kg/s].How much work was done by the rocket during this time interval?

362