Another Spin Up disk simulation tool

For those of you that use Python, I have made a disk simulator using physics from a 2008 paper on the physics of frisbees. It takes the angle of the shooter, the height, the speed, and calculates the path of the disk. It then graphs it for better understanding.

Here is the code:

import math
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure

class Frisbee():
    def __init__(self,g,m,dens,area,a0lift,a_lift,a0drag,a_drag):
        self.g=g
        self.mass=m
        self.density=dens
        self.area=area
        self.a0_lift=a0lift
        self.a_lift=a_lift
        self.a0_drag=a0drag
        self.a_drag=a_drag
        self.alpha0=-4
    def simulate(self,x_start,y_start,velocity,a,interval):
        a-=10
        xvelocity=velocity*math.cos(math.radians(a))
        yvelocity=velocity*math.sin(math.radians(a))
        xvelocity=xvelocity
        yvelocity=yvelocity
        angle=math.radians(a)
        cl=self.a0_lift+self.a_lift*angle*math.pi/180
        cd=self.a0_drag+self.a_drag*(angle*self.alpha0*math.pi/180)**2
        x=x_start
        y=y_start
        spread=[]
        k=0
        while y>0:
            deltavy=(self.density*(xvelocity**2)*self.area*cl/2/self.mass+self.g)*interval
            deltavx=(-self.density*(xvelocity**2)*self.area*cd*interval)
            xvelocity+=deltavx
            yvelocity+=deltavy
            x+=xvelocity*interval
            y+=yvelocity*interval
            if k%5==0:
                spread.append([round(x,2),round(y,2),round(k*interval,2)])
            k+=1
        return spread
    
frisbee=Frisbee(-9.81,0.065,1.1,0.016,0.1,1.4,0.08,2.72)
print("Starting velocity for 600 RPM flywheel is about 4 m/s")
print("Starting velocity for 1400 RPM flywheel is about 6 m/s")
points=frisbee.simulate(0,float(input("starting height: ")),float(input("starting velocity: ")),float(input("starting angle: ")),float(input("time interval: ")))
x=[]
y=[]
t=[]
for i in range(len(points)):
    x.append(points[i][0])
    y.append(points[i][1])
    t.append(points[i][2])
fig=plt.figure()
figure(figsize=(12, 6), dpi=80)
ax=plt.axes()
ax.set_ylim([0,2])
ax.set_xlim([0,6])
for i in range(len(x)):
    plt.plot(x,y)
plt.show()
print("Minimum height to get into goal is ~0.75 m")
print("Matixmum height is about 1 m")
print("All units are in SI standard.")
#ax.scatter(x,y)

Unfortunately, I don’t know how to make websites, so it might take a bit of work to set up, but feel free to modify it and make it better.

I don’t think discs are frisbees Are discs frisbees: No?

4 Likes

Could you link the papper that would be great.

While disc dyamics don’t model a Frisbee they are still an object that we can simulate useing the lift and drag equations.

Gravity, Mass of disc, air density, area of disc.
The next 4 I am not entierly sure what they are. They seem to solve for cl and cd which i would perusme is coefficient of lift and drag respectively, but the equation dont seem to be what makes cl or cd. There isn’t a way to equate angle to the cl and cd really which is what i think is going on in your progarm.

And looking at the numbers inputed it doesn’t make any sense to me still.
I think your on the right track but there might be a few issues.

4 Likes

Sure, here’s the link:
frisbee_physics

a0lift, a_lift, a0drag, and a_drag are a few constants that help in determining lift and drag of the frisbee. The numbers I used are from the research paper.

2 Likes

Ok so those constants are likely going to be wrong for detmining the cl and cd of a disc because well a disc is not a Frisbee. You would have to experimentally find the cl and cd for every angle(or just a few then find a line of best fit) and don’t forget how spin might effect the disc(It doesn’t really). The area of the disc changles sightly with the angle.

And I have seen that papper before it was discussed in Spin Up Kinematics Graphing Tool

3 Likes