python连杆机构运动分析未定义变量

运行之后提示我未定义变量,可是我定义了啊

import math
from os import close, error, system
from numpy.lib.function_base import copy, place, select, vectorize

import matplotlib.pyplot as plt
import numpy as np

class point():

def __init__(self,x=0,y=0,vx=0,vy=0,ax=0,ay=0):
    self.x=x
    self.y=y
    self.vx=vx
    self.vy=vy
    self.ax=ax
    self.ay=ay    

class rod():

def __init__(self,phi=0,length=0,omega=0,alpha=0):
    self.phi=phi
    self.length=length
    self.omega=omega
    self.alpha=alpha

class I_rod():
p0:point
def init(self,s_Point:point,Rod:rod):

    x=s_Point.x+Rod.length*math.cos(Rod.phi)


    y=s_Point.y+Rod.length*math.sin(Rod.phi)


    vx=s_Point.vx-(Rod.omega*Rod.length*math.sin(Rod.phi))/1000


    vy=s_Point.vy+(Rod.omega*Rod.length*math.cos(Rod.phi))/1000


    ax=s_Point.ax-(Rod.omega**2*Rod.length*math.cos(Rod.phi)\
                  +Rod.alpha*Rod.length*math.sin(Rod.phi))/1000


    ay=s_Point.ay-(Rod.omega**2*Rod.length*math.sin(Rod.phi)\
                  -Rod.alpha*Rod.length*math.cos(Rod.phi))/1000
    self.p0=point(x,y,vx,vy,ax,ay)

def get_e_point(self):
    return self.p0

class R_II_rods_group():
point_0:point
def init(self,p1:point,p2:point,r1_length:float,r2_length:float,clockwise=True):

    self.point_1=p1
    self.point_2=p2
    self.rod_1=rod(length=r1_length)
    self.rod_2=rod(length=r2_length)
    self.__length_BD=math.sqrt((p1.x-p2.x)**2+(p1.y-p2.y)**2)

    if(self.__length_BD>r1_length+r2_length or \
       self.__length_BD<abs(r1_length-r2_length)):
       raise Exception("在某一位置,杆长不满足装配要求")

    self.clockwise=clockwise


    A0=2*r1_length*(p2.x-p1.x)
    B0=2*r2_length*(p2.y-p2.y)
    C0=r1_length**2+(p1.x-p2.x)**2+(p1.y-p2.y)**2-r2_length**2
    if (self.clockwise):
        f=1
    else:
        f=-1
    self.rod_1.phi=2*math.atan((B0+f*math.sqrt(A0**2+B0**2-C0**2))/(A0+C0))


    self.point_0=I_rod(p1,self.rod_1).get_e_point()


    self.rod_2.phi=math.atan((self.point_0.y-p2.y)/(self.point_0.x-p2.x))


    C_1=r1_length*math.cos(self.rod_1.phi)
    S_1=r1_length*math.sin(self.rod_1.phi)
    C_2=r2_length*math.cos(self.rod_2.phi)
    S_2=r2_length*math.sin(self.rod_2.phi)

    G_1=C_1*S_2-C_2*S_1

    self.rod_1.omega=(C_2*(p2.vx-p1.vx)+S_2*(p2.vy-p1.vy))/G_1*1000
    self.rod_2.omega=(C_1*(p2.vx-p1.vx)+S_1*(p2.vy-p1.vy))/G_1*1000

    #计算alpha_1和alpha_2
    G_2=1000*(p2.ax-p1.ax)+self.rod_1.omega**2*C_1-self.rod_2.omega**2*C_2
    G_3=1000*(p2.ay-p1.ay)+self.rod_1.omega**2*S_1-self.rod_2.omega**2*S_2

    self.rod_1.alpha=(G_2*C_2+G_3*S_2)/G_1
    self.rod_2.alpha=(G_2*C_1+G_3*S_1)/G_1


    self.point_0=I_rod(p1,self.rod_1).get_e_point()

def get_p0(self):
    return self.point_0
def get_r1(self):
    return self.rod_1
def get_r2(self):
    return self.rod_2

if(name=="main"):
#定义已知参数
l_AB=80
l_BC=150
l_CD=200
l_AD=140
l_BE=25
l_EF=25
omega=100

l_BF=math.sqrt(l_EF**2+l_BE**2)
theta=math.atan(l_EF/l_BE)
point_A=point()
point_D=point(x=l_AD)

x_data=[]
y_data=[]
vx_data=[]
vy_data=[]
ax_data=[]
ay_data=[]

for i in range(0,360):
    
    phi=i*math.pi/180

    rod_AB=rod(phi,l_AB,omega)
    point_B=I_rod(point_A,rod_AB).get_e_point()
    rod_BC=RRR_II_rods_group(point_B,point_D,l_BC,l_CD).get_r1()
    rod_BF=rod(theta+rod_BC.phi,l_BF,rod_BC.omega,rod_BC.omega)
    point_F=I_rod(point_B,rod_BF).get_e_point()

    x_data.append(point_F.x)
    y_data.append(point_F.y)
    vx_data.append(point_F.vx)
    vy_data.append(point_F.vy)
    ax_data.append(point_F.ax)
    ay_data.append(point_F.ay)

plt.figure(figsize=(21,13), dpi=80)

ax1=plt.subplot2grid((7,11),(0,0),colspan=4,rowspan=7)
ax1 = plt.gca()
ax1.set_aspect(1)
ax1.set_title("s_F(x,y)")
ax1.scatter(x_data,y_data,color="black")

phi_x=np.linspace(0,2*math.pi,360)

ax2=plt.subplot2grid((7,11),(0,4),colspan=3,rowspan=3)
ax2 = plt.gca()
ax2.set_title("v_Fx(φ)")
ax2.plot(phi_x,vx_data)

ax3=plt.subplot2grid((7,11),(0,8),colspan=3,rowspan=3)
ax3 = plt.gca()
ax3.set_title("v_Fy(φ)")
ax3.plot(phi_x,vy_data)

ax4=plt.subplot2grid((7,11),(4,4),colspan=3,rowspan=3)
ax4 = plt.gca()
ax4.set_title("a_Fx(φ)")
ax4.plot(phi_x,ax_data)

ax5=plt.subplot2grid((7,11),(4,8),colspan=3,rowspan=3)
ax5 = plt.gca()
ax5.set_title("a_Fy(φ)")
ax5.plot(phi_x,ay_data)   
plt.show()

希望能够生成运动简图