human
I am working on the file "CMA-ES/分段函数平滑拟合/分段平滑拟合.ipynb".
The first task is:
<center>4种策略下最优评价函数值</center>
interval         | continuity1  |continuity2    |continuity3
 ---------------- |---------------|--------------|--------------
 0.0171697128166  |-0.0416912639382|0.0146455354793|-0.0480936701006
设置BETA=PI/4.0（45度）

二次曲线分段二次平滑
利用二次曲线$y=ax^2+bx+c$进行分段拟合
Can you write Python program for it?
assistant
#Here is the Python program you requested.

def realLineFunc(param):
    def f(x):
        if x<-5:
            return np.poly1d([param[0],param[1],param[2]])(x)
        elif x<-3:
            return np.poly1d([param[3],param[4],param[5]])(x)
        elif x<-1:
            return np.poly1d([param[6],param[7],param[8]])(x)
        elif x<1:
            return np.poly1d([param[9],param[10],param[11]])(x)
        elif x<3:
            return np.poly1d([param[12],param[13],param[14]])(x)
        elif x<5:
            return np.poly1d([param[15],param[16],param[17]])(x)
        else:
            return np.poly1d([param[18],param[19],param[20]])(x)
    return f
def mse(x,y,param):
    s=0
    for j in range(0,21,3):
        for i in range(int(j/3)*10,int(j/3+1)*10,1):
            s+=(y[i]-fittingFunc(param[j:j+3])(x[i]))**2
    return math.sqrt(s/200.0) 
 #间断点
def evalfunc1(param):
    s=mse(X,Y,param)/RANGE
    a=0
    for j in range(3,21,3):
        a+=E(abs(fittingFunc(param[j-3:j])(X[(j/3)*10])-fittingFunc(param[j:j+3])(X[(j/3)*10]))/RANGE-ALPHA)-1
    return s+a
#间断点一阶导数
def evalfunc2(param):
    s=mse(X,Y,param)/RANGE
    b=0
    for j in range(3,21,3):
        b+=(E((abs(math.atan(2*param[j-3]+param[j-2])-math.atan(2*param[j])+param(j+1))-BETA))-1)/(10*math.e)
    return s+b
#考虑两种
def evalfunc3(param):
    s=mse(X,Y,param)/RANGE
    a=0
    for j in range(3,21,3):
        a+=E(abs(fittingFunc(param[j-3:j])(X[(j/3)*10])-fittingFunc(param[j:j+3])(X[(j/3)*10]))/RANGE-ALPHA)-1
    b=0
    for j in range(3,21,3):
        b+=(E((abs(math.atan(2*param[j-3]+param[j-2])-math.atan(2*param[j])+param(j+1))-BETA))-1)/(10*math.e)
    return s+a+b
#不考虑其他因素
def evalfunc(param):
    s=mse(X,Y,param)/RANGE
    return s

def draw(title):
    global X

    res=cmaUser(evalfunc)
    res1=cmaUser(evalfunc1)
    res2=cmaUser(evalfunc2)
    res3=cmaUser(evalfunc3)

    plt.figure(1) 
    plt.plot(X,Y,'b.',alpha=0.6,label="measure point")
    X1=np.insert(X,0,[-5.01,-3.01,-1.01,0.99,2.99,4.99])
    X1.sort()

   ...