You are on page 1of 2

Arizona State University The Mechanics Project

CEE 212Dynamics CP 2Contact

Computing Project 2
Contact

Introduction
The second computing project is called Contact. The
20
concept is to subject projectile motion to live within a
constrained surface. Each time the particle comes in 15

contact with a constraint surface a contact/impact 10


computation is done to change the velocity of the par-
5
ticle based upon conservation of momentum and a
model for energy loss in the normal direction. One ex- 0

y
ample is shown in the figure at right. The particle -5
(which starts at the black dot and ends at the red one)
-10
is constrained within an ellipsoidal boundary. The par-
ticle has an initial position and velocity and the motion -15

evolves in accord with projectile motion (with fluid -20


drag). The problem will be defined in a two-dimen-
-10 -5 0 5 10
sional region (i.e., there is no z component of the mo- x
tion). This restriction will make visualization easier.
The geometry of the constrained space is defined by a function g(x,y) for which the equa-
tion g(x,y) = 0 defines the boundary of the region (i.e., the walls). The other feature of the
function g(x,y) is that on one side g(x,y) > 0 (the side the particle can be moving) and on
the other side g(x,y) < 0 (the particle cannot go there). The main task of this project is to
write the logic for describing the constraint function, checking for contact, and resolving
the contact using the impulse/momentum calculation.
When the projectile is not at a contact event it moves freely, subjected to gravity and the
drag forces of the fluid. Hence, the time-stepping part of this problem is very similar to CP
1. More information on the background for this project can be found in the CP Notes for
the project. Also, lots of information on the particle with drag problem can be found in the
Course Notes entitled Numerical Methods.

What you need to do


The basic MATLAB programs Contact_Plane.m and the MATLAB function plane.m are
available on Bb. This code does projectile motion with drag and includes contact with a
flat plane. You can use this code as a template for CP 2. You will need to add different
kinds of constraint functions.
The specific tasks you will need to do include the following:
1. Create a code that does the impact problem for a curved surface.

Arizona State University The Mechanics Project


CEE 212Dynamics CP 2Contact

a. Add additional surface functions g(x,y) to the function curve.m so that you
can do (in addition to a flat plane) a parabolic surface, an ellipse, and a
corrugated surface. Include a simple way of changing from one to the other
(e.g., use the variable type to establish which curve to use from the func-
tion curve.m.
20

18
20
16

14 15

12
10
y

y
10

8 5

6
0
4
-30 -25 -20 -15 -10 -5 0 5 10 15 20
2 x

-15 -10 -5 0 5 10 15
x

b. Develop a means of drawing the outline of the constraint function for the
various different types of constraints so you can see the particle bouncing
off of the surface.
c. Implement the code feature in which you calculate the exact time, position,
velocity, and acceleration of the impact and adjust to capture that instant
(this is just an interpolation between the last step, which was not pene-
trated, and the next step, which is penetrated). See the CP 2 Notes.
2. Explore and discover. Use the code to explore the problem. Some suggestions
a. Plot the energy vs. time. Why is more energy lost in some contact than in
others? Does the angle of impact matter?
b. What happens when the normal energy is exhausted but the in-plane ve-
locity is not? Does the particle slide on the surface or does it stop?
c. You might notice that when the particle stops bouncing it can fall
through the surface. Why does this happen? Can you fix the code to avoid
this numerical problem?
d. What else can you observe?
3. Write a report documenting your work and the results (in accord with the specifi-
cation given in the document Guidelines for Doing Computing Projects). Post it to
the Critviz website prior to the deadline. As usual, consult the document Evalua-
tion of Computing Projects to see how your project will be evaluated to make sure
that you can get full marks. All projects will be subject to the peer review process.

You might also like