What I've Done so Far

I solved for instantaneous velocity with respect to the phi and the velocity immediately before the instant velocity.


In [1]:
#from sage.all import *
from numpy import *
from sympy import *
from __future__ import division

init_printing()

#v0 is v_i-1
#v is v_i
#phi is in radians

d_theta = .01
g = 9.81
r = 4 
v_0, m, phi, mu, k = var('v_0 m phi mu k')

In [2]:
def wt(m, g, phi):
    """Calculate the weight force in the tangent direction."""
    w = m*g*cos(phi)
    return w

def wn(m,g,phi):
    """Calculate the weight force in the normal direction"""
    w = m*g*sin(phi)
    return w

def B(phi):
    """The angle beta, in terms of phi"""
    b = atan( (2+4*cos(phi))/(4*sin(phi)) ) - ((pi/2)-phi)
    return b

def Fsn(phi,k,B):
    """The force of the spring in the normal direction"""
    f = k*cos(B(phi))*( sqrt(20+16*cos(phi)) - sqrt(20) )
    return f

def Fst(phi,k,B):
    """The force of the spring in the tangent direction"""
    f = k*sin(B(phi))*( sqrt(20+16*cos(phi)) - sqrt(20) )
    return f

In [3]:
v = sqrt( (wt(m,g,phi)-(m*v_0**2)/(2*r*d_theta)+mu*(Fsn(phi,k,B)-wn(m,g,phi)-Fst(phi,k,B)))/((m*mu)/(r)-(m)/(2*r*d_theta)) )

v


Out[3]:
$$\sqrt{\frac{- 12.5 m v_{0}^{2} + 9.81 m \cos{\left (\phi \right )} + \mu \left(k \left(\sqrt{16 \cos{\left (\phi \right )} + 20} - 2 \sqrt{5}\right) \sin{\left (\phi + \operatorname{atan}{\left (\frac{4 \cos{\left (\phi \right )} + 2}{4 \sin{\left (\phi \right )}} \right )} \right )} + k \left(\sqrt{16 \cos{\left (\phi \right )} + 20} - 2 \sqrt{5}\right) \cos{\left (\phi + \operatorname{atan}{\left (\frac{4 \cos{\left (\phi \right )} + 2}{4 \sin{\left (\phi \right )}} \right )} \right )} - 9.81 m \sin{\left (\phi \right )}\right)}{\frac{1}{4} m \mu - 12.5 m}}$$

In [4]:
yodog = v.subs(k,100)
yodog = yodog.subs(m,15).subs(phi,90).subs(v_0,15).subs(mu,0)

print '%.6f' %yodog


15.011717

Find Final Velocity from given parameters


In [5]:
v0 = 15
theta = pi/2
v = v.subs(k,500).subs(m,15).subs(mu,.25)
 
while theta > 0: 
    v0 = v.subs(phi,theta).subs(v_0,v0)
    theta=theta-d_theta

In [6]:
print "%.10f" %v0


17.6811624426

In [7]:
v0 = 15
theta = pi/2

while theta > 0: 
    v0 = v.subs(k,1000).subs(m,15).subs(phi,theta).subs(v_0,v0).subs(mu,.25)
    theta=theta-d_theta

In [8]:
print "%.10f" %v0


17.6811624426

In [8]: