Professional Documents
Culture Documents
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
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
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.