Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Exercises in Mechanical Engineering, Exercises of Mechanical Engineering

ME 123 ROSE-HULMAN INSTITUTE OF TECHNOLOGY day 5 exercises

Typology: Exercises

2021/2022

Uploaded on 02/11/2022

rakshan
rakshan ๐Ÿ‡บ๐Ÿ‡ธ

4.6

(18)

239 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ROSE-HULMAN INSTITUTE OF TECHNOLOGY
Department of Mechanical Engineering
ME 123 Computer Programming
Exercises for Day 35
Exercise 1. A simple robotic arm can be modeled as a pendulum, as in the picture to
the right. Let ๐œƒ๐œƒ be the angular displacement of the pendulum counterclockwise from
the downward position, and denote the angular velocity by ๐œ”๐œ”. There is damping in the
pivot, and a force ๐น๐น is applied horizontally to the lumped mass at the end of the
pendulum.
The equations governing the behavior of a particular pendulum are as follows:
d๐œ”๐œ”
d
t
=โˆ’0.4 ๐œ”๐œ” โˆ’ 20 sin(๐œƒ๐œƒ)+๐น๐น cos(๐œƒ๐œƒ)
d๐œƒ๐œƒ
d
t
=๐œ”๐œ”
where the units for ๐œƒ๐œƒ and ๐œ”๐œ” are rad and rad/s, respectively, and time ๐‘ก๐‘ก is in seconds. Suppose the applied force ๐น๐น
is such that
๐น๐น= 0 when ๐œ”๐œ” โ‰ฅ 0
๐น๐น= 2 when ๐œ”๐œ”< 0.
The initial conditions for the pendulum are
๐œ”๐œ”(0)= 4 rad/s
๐œƒ๐œƒ(0)= 0 rad.
Complete the following:
a) Use MATLAB to plot the pendulumโ€™s angular displacement ๐œƒ๐œƒ as a function of time ๐‘ก๐‘ก, starting at ๐‘ก๐‘ก= 0 s
and ending at ๐‘ก๐‘ก= 4 s. Use a time step ฮ”๐‘ก๐‘ก = 0.01 s. Be sure to properly label your axes and to include a
title.
b) Determine the values of ๐œƒ๐œƒ and ๐œ”๐œ” at ๐‘ก๐‘ก= 1.74 s. Print these values to a text file using the following
format:
Angular displacement at t = 1.74 s is X.XXX rad.
Angular velocity at t = 1.74 s is X.XXX rad/s.
(over)
pf2

Partial preview of the text

Download Exercises in Mechanical Engineering and more Exercises Mechanical Engineering in PDF only on Docsity!

ROSE-HULMAN I NSTITUTE OF TECHNOLOGY

Department of Mechanical Engineering

ME 123 Computer Programming

Exercises for Day 35

Exercise 1. A simple robotic arm can be modeled as a pendulum, as in the picture to the right. Let ๐œƒ๐œƒ be the angular displacement of the pendulum counterclockwise from the downward position, and denote the angular velocity by ๐œ”๐œ”. There is damping in the pivot, and a force ๐น๐น is applied horizontally to the lumped mass at the end of the pendulum.

The equations governing the behavior of a particular pendulum are as follows:

d๐œ”๐œ” dt

= โˆ’0.4 ๐œ”๐œ” โˆ’ 20 sin(๐œƒ๐œƒ) + ๐น๐น cos(๐œƒ๐œƒ)

d๐œƒ๐œƒ dt

where the units for ๐œƒ๐œƒ and ๐œ”๐œ” are rad and rad/s, respectively, and time ๐‘ก๐‘ก is in seconds. Suppose the applied force ๐น๐น is such that

๐น๐น = 0 when ๐œ”๐œ” โ‰ฅ 0

๐น๐น = 2 when ๐œ”๐œ” < 0.

The initial conditions for the pendulum are

๐œ”๐œ”(0) = 4 rad/s

๐œƒ๐œƒ(0) = 0 rad.

Complete the following:

a) Use MATLAB to plot the pendulumโ€™s angular displacement ๐œƒ๐œƒ as a function of time ๐‘ก๐‘ก, starting at ๐‘ก๐‘ก = 0 s and ending at ๐‘ก๐‘ก = 4 s. Use a time step ฮ”๐‘ก๐‘ก = 0.01 s. Be sure to properly label your axes and to include a title.

b) Determine the values of ๐œƒ๐œƒ and ๐œ”๐œ” at ๐‘ก๐‘ก = 1.74 s. Print these values to a text file using the following format:

Angular displacement at t = 1.74 s is X.XXX rad. Angular velocity at t = 1.74 s is X.XXX rad/s.

(over)

ROSE-HULMAN I NSTITUTE OF TECHNOLOGY

Department of Mechanical Engineering

ME 123 Computer Programming

Rabbit

x

y

Dog

Exercise 2.

A dog, whose initial location is on the ๐‘ฆ๐‘ฆ-axis, spots a rabbit, initially located on the ๐‘ฅ๐‘ฅ-axis. The chase begins, with the rabbit running straight along the ๐‘ฅ๐‘ฅ-axis with a speed ๐‘ฃ๐‘ฃ๐‘…๐‘…. The dog, running at a constant speed of ๐‘ฃ๐‘ฃ๐ท๐ท, follows a โ€œcurve of pursuit,โ€ meaning that he is running straight towards the rabbit from his present position. Your job is to generate the curve of pursuit from the beginning of the chase until the time the dog captures the bunny, or the bunny gets away.

The distance ๐‘‘๐‘‘ between the dog and rabbit at any given moment is given by

2 2

d = xR โˆ’ xD + y D

The dogโ€™s ๐‘ฅ๐‘ฅ-position, ๐‘ฅ๐‘ฅ๐ท๐ท, varies according to

d xD vD^ ( xR^ xD )

d t d

The dogโ€™s ๐‘ฆ๐‘ฆ-position, ๐‘ฆ๐‘ฆ๐ท๐ท , varies as follows:

d y D v D yD

d t d

The rabbitโ€™s ๐‘ฅ๐‘ฅ-position, ๐‘ฅ๐‘ฅ๐‘…๐‘…, varies according to

R R.

d x

v

d t

Letโ€™s say that the dog can run at 35 ft/sec for 9 seconds before tiring out. He starts at ๐‘ฆ๐‘ฆ = 100 ft. The rabbit starts at ๐‘ฅ๐‘ฅ = 100 ft and can run on and on at 20 ft/sec. If the dog gets within ๐‘‘๐‘‘ = 2 ft, he catches the rabbit. Using the Euler method and a time step of 0.05 seconds, solve this problem. Generate and plot the curve of pursuit. Have your program print out to a text file whether or not the dog captures the rabbit, and if he does, how long it took.

Hint: To test your program, just try giving the rabbit zero speed โ€“ you can figure out what happens! Turn in the plot, your m-files, and the printout of whether the dog caught the rabbit.