Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Jupyter notebook Assignments/Golf Putt/Golf Putt.ipynb

56 views
Kernel: Python 3 (Anaconda)

Golf Putt

You putt a golf ball across a green that has a uniform slope. Write equations describing the position of the golf ball as a function of time as it moves from one arbitrary location to another along the putting green. Then make a VPython animation showing the golf ball hit into the hole.

putting green

Solution


Assumptions

*The ball is a point mass with mass m.

*The green makes an angle with the horizontal.

*The ramp is steep enough that the ball is sliding.

*Static friction is the only friction acting on the ball.

*The ball is close enough to earth that g is approximately constant.

Diagrams

![Golf Putt Diagram](Golf Putt Diagram.png)

Analysis

According to the Force Diagram

FebgsinθFrbs=mx¨F_{eb}^g sin\theta - F_{rb}^s = m\ddot x

and

FrbnFebgcosθ=my¨F_{rb}^n - F_{eb}^g cos\theta = m\ddot y

These simplify to

mgsinθFrbs=mx¨mgsin\theta - F_{rb}^s = m\ddot x

and

Frbn=Febgcosθ=mgcosθF_{rb}^n = F_{eb}^g cos\theta = mgcos\theta

In order to determine FrbsF_{rb}^s, we can try to look at the rotational version of Newton's Second Law, Γ=dLdt\vec{\Gamma} = \frac{d\vec{L}}{dt}. Of the three forces acting on the ball, only the friction force exerts a torque.

R×Frbs=dLdt\vec{R} \times \vec{F}_{rb}^s = \frac{d\vec{L}}{dt}

Take the magnitude of both sides

RFrbssin90=ddt(Iw)RF_{rb}^s sin90^\circ = \frac{d}{dt}(Iw)

RFrbs=IdwdtRF_{rb}^s = I\frac{dw}{dt}

Frbs=IRdwdtF_{rb}^s = \frac{I}{R}\frac{dw}{dt}

Substitute this into Newton's Second Law in the x-direction.

mgsinθIRdwdt=mx¨mgsin\theta - \frac{I}{R}\frac{dw}{dt} = m\ddot x

From introductory mechanics, dwdt=α\frac{dw}{dt} = \alpha and α=αcmR\alpha = \frac{\alpha_{cm}}{R}

mgsinθIx¨R2=mx¨mgsin\theta - \frac{I\ddot x}{R^2} = m\ddot x

mgsinθ=mx¨+Ix¨R2=x¨(m+IR2mgsin\theta = m\ddot x + \frac{I\ddot x}{R^2} = \ddot x(m + \frac{I}{R^2})

x¨=mgsinθm+IR2\ddot x = \frac{mgsin\theta}{m + \frac{I}{R^2}}

For a ball that is hollow and have a thin shell, I = 23mR2\frac{2}{3}mR^2. So

x¨=35gsinθ\ddot x = \frac{3}{5}gsin\theta

We then integrate

x¨=dvdt=35gsinθv0v(t)dv=0t35gsinθdt\ddot x = \frac{dv}{dt} = \frac{3}{5}gsin\theta \Rightarrow \int_{v_0}^{v(t)} dv = \int_{0}^{t} \frac{3}{5}gsin\theta dt'

v(t)v0=35gsinθtv(t) - v_0 = \frac{3}{5}gsin\theta t

v(t)=35gsinθt+v0v(t) = \frac{3}{5}gsin\theta t + v_0

v(t)=dxdt=35gsinθt+v0x0x(t)dx=0t35gsinθt+v0v(t) = \frac{dx}{dt} = \frac{3}{5}gsin\theta t + v_0 \Rightarrow \int_{x_0}^{x(t)} dx = \int_{0}^{t} \frac{3}{5}gsin\theta t' + v_0

x(t)x0=35gsinθt2+v0tx(t) - x_0 = \frac{3}{5}gsin\theta t^2 + v_0 t

x(t)=35gsinθt2+v0t+x0x(t) = \frac{3}{5}gsin\theta t^2 + v_0 t + x_0

We can use these to find the corresponding rotational motion.

α=x¨R=35gsinθR\alpha = \frac{\ddot x}{R} = \frac{\frac{3}{5}gsin\theta}{R}

α=wtdt=35gsinθRw0w(t)dw=0t35gsinθRdt\alpha = \frac{wt}{dt} = \frac{\frac{3}{5}gsin\theta}{R} \Rightarrow \int_{w_0}^{w(t)} dw = \int_{0}^{t} \frac{\frac{3}{5}gsin\theta}{R}dt'

w(t)w0=35gsinθRtw(t) - w_0 = \frac{\frac{3}{5}gsin\theta}{R}t

w(t)=35gsinθRt+w0w(t) = \frac{\frac{3}{5}gsin\theta}{R}t + w_0

ϕ(t)ϕ0=gsinθ5Rt2+w0t\phi(t) - \phi_0 = \frac{gsin\theta}{5R}t^2 + w_0t

ϕ(t)=gsinθ5Rt2+w0t+ϕ0\phi(t) = \frac{gsin\theta}{5R}t^2 + w_0t + \phi_0

Please also describe motion in z direction.

### Check The SI units of x(t), v(t), and a(t) work out to be [m], [m/s], and [m/s^2] (respectively) as we expect. The SI units of α\alpha(t) are m/s2m=1s2\frac{m/s^2}{m} = \frac{1}{s^2}, which is what we expect for an angular acceleration. The SI units of ω\omega(t) work out to be [m/s2][m][s]=1[s]\frac{[m/s^2]}{[m]}[s] = \frac{1}{[s]}, which is what we expect for an angular speed. The SI units of ϕ\phi(t) work out to be [m/s2][m][s]2\frac{[m/s^2]}{[m]}[s]^2 = no units, which is what we expect for an angle in radians.

In the limit that θ0\theta \to 0, we would expect that there is no acceleration at all.

Interpretation

The linear acceleration of the golf ball is much smaller than that of an object that is sliding without friction, which makes sense. Realistically our result would likely break down at a high enough angle because the golf ball would begin to slide instead of roll. This system would also fall apart if the initial force is 0. Since the ball can't physicslly move on it's own and we know that the only other two forces acting on the ball is gravity and static friction. Static friction would also be zero because it counters the normal force which is 0. So the ball would just not go anywhere at all.

from __future__ import division #this makes sure that dividing integers gives a decimal number from vpython import * #this imports all the functions that enable us to draw the visual elements #initial conditions L=5 #length of ramp theta=10*pi/180 #angle of ramp in radians h=L*sin(theta) #height of ramp m=1.8 #mass of golf ball R=0.25 #radius of cylinder I=0.4*m*R**2 #moment of inertia of ball x=0 #tilted x-coordinate of ball y=0 #tilted y-coordinate of ball v=0 #initial velocity of ball t=0 phi=0 #initial angle of ball (rotation) omega=v/R #initial angular speed of ball g=9.8 #gravitational field strength dt=0.01 #time step #set the scene scene=canvas() scene.camera.pos=vec(L*cos(theta),h,-1) #place camera at the end of the ramp scene.camera.rotate(angle=45*pi/180, axis=vec(0,1,0)) #rotate camera 45 degrees so that we can see the slope #draw the ball ball=sphere(pos=vector(0,h + R,0), radius=0.25, color=color.red) #draw the ramp tri=[[0,0],[0,L*sin(theta)],[L*cos(theta),0],[0,0]] #draw a triangle tripath=[vec(0,0,1),vec(0,0,-1)] #set an extrusion path ramp=extrusion(path=tripath, shape=tri,color=color.green) #extrude the triangle while x<=L: #continue until cylinder reaches the end of the ramp rate(1/dt) #make sure looping rate does not exceed real time a=g*sin(theta)/(m+I/R**2) #calculate acceleration v=v+a*dt #update speed x=x+v*dt #update tilted x-coordinate #perform the coordinate transformation to turn tilted coordinate system into vpython coordinate system ball.pos.x=x*cos(theta) ball.pos.y=h+R-x*sin(theta) #angular motion alpha=a/R #angular acceleration omega=omega+alpha*dt #update angular speed ball.rotate(angle=-omega*dt) #rotate the ball t=t+dt #increment the time
<IPython.core.display.Javascript object>
<IPython.core.display.Javascript object>
<IPython.core.display.Javascript object>
<IPython.core.display.Javascript object>
<IPython.core.display.Javascript object>
<IPython.core.display.Javascript object>
<IPython.core.display.Javascript object>
<IPython.core.display.Javascript object>

Rubric

SectionPointsMax Points
Assumptions11
Diagrams11
Analysis23
Check11
Interpretation11
Code33