正弦函数拟合计算一、正弦函数的一般表达式的建立正弦函数的一般表达式为:3210)sin(xxtxxy(1)对于一系列的n个点)3(n:1,,1,0),,(niytii(2)要用点1,,1,0),,(niytii拟合计算上述方程,则使:1023210)sin(niiiyxxtxxS最小。要使得S最小,应满足:3,2,1,0,0kxSk即:iiiiiiiiiiiiyxxtxxxSxtxxyxxtxxxSxtxtxyxxtxxxSxtxyxxtxxxS3210321032102210321012132100)sin(2)cos()sin(2)cos()sin(2)sin()sin(200x0)sin(0)cos()sin(0)cos(.)sin(0)sin()sin(3210213210213210213210iiiiiiiiiiiiyxxtxxxtxyxxtxxxtxtyxxtxxxtxyxxtxx(3)解上述4元非线性方程组,即可得到正弦函数的一般表达式的系数:3210,,,xxxx。二、多元非线性方程组解法对于n元非线性方程组,记:TnXfXfXfXF)(,),(),(110,110,,,nxxxX以及雅克比矩阵33231303322212023121110130201000')()()()()()()()()()()()()()()()()(xXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfXF即:)()()()(.)()()()()()()()()()()()()()()()(3210321033231303322212023121110130201000XfXfXfXfxxxxxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXfxXf(5)三、正弦函数的一般表达式系数求解要拟合正弦函数的一般表达式(1)的系数,线性方程组(5)中的表达式为:iiiiiiiiiiiiyxxtxxXfxtxyxxtxxXfxtxtyxxtxxXfxtxyxxtxxXf32103213210221321012132100)sin()()cos()sin()()cos()sin()()sin()sin()()sin()()cos()()(2sin)()cos()()(2sin)()(sin)(2130213210202132101021200xtxxXfxtxyxxtxxxXfxtxtyxxtxtxxXfxtxxXfiiiiiiiiii)cos()()sin()()(2cos)()sin()()(2cos)()(2sin21)(21312132102121232120112101xtxtxXfxtxtyxxtxtxxXfxtxtyxxtxtxxXfxtxtxXfiiiiiiiiiiiiii)cos()()sin()()(2cos)()sin()()(2cos)()(2sin21)(213221321022213210122102xtxxXfxtxyxxtxxxXfxtxtyxxtxtxxXfxtxxXfiiiiiiiiiinxXfxtxxxXfxtxtxxXfxtxxXfiiii3321023210132103)()cos()()cos()()sin()(根据前面所述的Newton迭代法,先给出3210,,,xxxx的初值0X,代入公式(5)求得:TkxxxxX3210k=0,1,2……为迭代顺序号。再根据公式(4)进行迭代计算,直到TkxxxxX3210达到指定的收敛精度:23222120xxxxkkkXXX1就是最终的线性方程的解。