I think i've got it now:

[code]import visual as v
from math import sin, cos, pi, sqrt

m = 2.1 # mass of mass in kg
r = 5  # radius of circle in m
g = 9.80665 # accel due to gravity
t = 0 # initial t is 0
dt = 0.0001 # time increment
v_max = sqrt(2*r*g) # max velocity
rate = 2500

scene = v.display(title='Mass Sliding Down a Smooth Curve',
width=600,
height=600,
center=(-2.5,2.5),
uniform=1,
range=4,
userzoom = 0,
userspin = 0)
so that the ball slides along the curve, not through it :P '''
vect_length = 1 # so mg is 1 vect_length

legend_mass = v.sphere(pos=(-1,4.5),
color=v.color.red)
mass_label = v.label(pos=legend_mass.pos,
text='Mass, 2.1kg', xoffset=-20,
yoffset=12, space=0.1,
height=10, border=6,
font='sans')
legend_mg = v.arrow(pos=legend_mass.pos,
axis=(0,-1),
shaftwidth=0.05,
color=v.color.green)
mg_label = v.label(pos=legend_mass.pos+(legend_mg.axis/2),
text='Force due to gravity', xoffset=-20,
yoffset=12, space=0.1,
height=10, border=6,
font='sans')
axis=(0.5,0.5),
shaftwidth=0.05,
color=v.color.yellow)
yoffset=32, space=0.1,
height=10, border=6,
font='sans')
legend_transverse = v.arrow(pos=legend_mass.pos,
axis=(0.25,-0.25),
shaftwidth=0.05,
color=v.color.blue)
transverse_label = v.label(pos=legend_mass.pos+(legend_transverse.axis/2),
text='Transverse Force', xoffset=30,
yoffset=12, space=0.1,
height=10, border=6,
font='sans')
xystart_label = v.label(pos=(-5.1,5),
text='(-5,5)', xoffset=-20,
yoffset=0, space=0.1,
height=10, border=6,
font='sans')
xyend_label = v.label(pos=(0,-0.1),
text='(0,0)', xoffset=-0.1,
yoffset=-20, space=0.1,
height=10, border=6,
font='sans')
start_label = v.text(pos=(-2.5,2.5),
text='Click to\nStart', align='center', font='sans', depth = 0.1, width = 1)

# makes a quarter circle radius 5 from (-5,5) to (0,0) centre (0,5)
curve_angle = v.arange(pi,
3*pi/2,
0.0001)
curve = v.curve(x = curve_radius * v.cos(curve_angle),
y = curve_radius * v.sin(curve_angle) + 5,
z = 0,
curve2 = v.curve(x = v.arange(0,10,1),
y = -0.1,
z = 0,

# ball starts at -5,5
mass = v.sphere(pos=(-5,5),
color=v.color.red)
mg = v.arrow(pos=mass.pos,
axis=-vect_length*(v.vector(0,1)),
shaftwidth=0.05,
color=v.color.green)
axis=(0,0),
shaftwidth=0.05,
color=v.color.yellow)
transverse = v.arrow(pos=mass.pos,
axis=(0,0),
shaftwidth=0.05,
color=v.color.blue)

def rk4(t0, h, s0, f):
# From http://doswa.com/blog/2009/04/21/improved-rk4-implementation/
'''RK4 implementation.
t = current value of the independent variable
h = amount to increase the independent variable (step size)
s0 = initial state as a list. ex.: [initial_position, initial_velocity]
f = function(state, t) to integrate'''
r = range(len(s0))
s1 = s0 + [f(t0, s0)]
s2 = [s0[i] + 0.5*s1[i+1]*h for i in r]
s2 += [f(t0+0.5*h, s2)]
s3 = [s0[i] + 0.5*s2[i+1]*h for i in r]
s3 += [f(t0+0.5*h, s3)]
s4 = [s0[i] + s3[i+1]*h for i in r]
s4 += [f(t0+h, s4)]
return t+h, [s0[i] + (s1[i+1] + 2*(s2[i+1]+s3[i+1]) + s4[i+1])*h/6.0 for i in r]

def pendulum_angular_accel(t,s):
''' theta'  = omega
omega'  = theta'' = -g/R sin(theta) = alpha '''
theta = s[0]
''' angle at time t = s[0]
omega at time t = s[1]
alpha at time t = (-g/R)*sin(s[0]) '''
g = 9.80665
R = 5
return (-g/R)*sin(theta)

x = -5
y = 5
s = [-pi/2, 0]  # initial angle measured from the line x=0
# and initial angular velocity '''

#f = open('csv.csv', 'w')
#f.write("t,phi,omega,alpha,x,y\n")
# While
while True:
if scene.mouse.clicked:
start_label.visible=False
while (x <= 0): # phi <= pi/2
v.rate(rate)
# alpha + (-g/5)*sin(s[0]) # uncomment if you want to calculate angular accelerarion
phi = s[0]+pi/2 # angle from the line y=5 to the mass
x =  -5*cos(phi)
y = 5-5*sin(phi)

# move mass and force arrows to new location
mass.pos = v.vector(x,y)
transverse.pos = mass.pos
mg.pos = mass.pos

# calculate forces
rhat = v.norm(v.vector(-x/25, (5-y)/25))
transverse.axis = (vect_length/(2*m*g))*(-(m*g*sin(s[0]))*thetahat)
t, s = rk4(t, dt, s, pendulum_angular_accel)
curve_t = t
while (mass.pos.x <= 1.6):
v.rate(rate)
#speed = distance/time
#distance = speed * time
mass.pos = mass.pos + v.vector(5*s[1]*dt,0)