699.1938104.3950107.28360.281587.712799.8339104.8451107.32463.531689.1828100.4340105.0652107.38566.561790.4429101.0141105.5353107.56669.521891.7630101.4242105.8054107.66772.261993.0431101.8143106.0855107.82874.792094.1132102.2644106.3356107.67977.002195.1833102.7945106.4157107.551079.072296.0434103.1946106.6158107.391180.872396.9635103.3647106.6559107.251282.882497.4936103.6548106.9460107.10表2.2下水箱阶跃响应数据由于实验测定数据可能存在误差,直接使用计算法求解水箱模型会使误差增大。所以使用MATLAB软件对实验数据进行处理,根据最小二乘法原理和实验数据对响应曲线进行最佳拟合后,再计算水箱模型。两组实验数据中将阶跃响应初始点的值作为Y轴坐标零点,后面的数据依次减去初始值处理,作为Y轴上的各阶跃响应数据点;将对应Y轴上阶跃响应数据点的采集时间作为曲线上各X点的值。3.求取上水箱模型传递函数在MATLAB的命令窗口输入曲线拟合指令:>>x=0:30:420;>>y=[06.8811.6315.0717.719.6921.1521.9422.5523.4423.6323.8424.1424.2524.27];>>p=polyfit(x,y,4);>>xi=0:3:420;>>yi=polyval(p,xi);>>plot(x,y,’b:o’xi,yi,'r')。在MATLAB中绘出曲线如下: