林业科学  2018, Vol. 54 Issue (11): 29-36   PDF    
DOI: 10.11707/j.1001-7488.20181105
0

文章信息

曹正彬, 周世玉, 刘晓平, 高闯, 杜光月, 周玉成.
Cao Zhengbin, Zhou Shiyu, Liu Xiaoping, Gao Chuang, Du Guangyue, Zhou Yucheng.
基于LS-SVM的采暖木质地板自然对流温度场建模
Modeling of Natural Convection Temperature Field Produced by Wood Floor with Geothermal System Based on LS-SVM
林业科学, 2018, 54(11): 29-36.
Scientia Silvae Sinicae, 2018, 54(11): 29-36.
DOI: 10.11707/j.1001-7488.20181105

文章历史

收稿日期:2018-04-02
修回日期:2018-09-11

作者相关文章

曹正彬
周世玉
刘晓平
高闯
杜光月
周玉成

基于LS-SVM的采暖木质地板自然对流温度场建模
曹正彬1, 周世玉2, 刘晓平1, 高闯3, 杜光月1, 周玉成1     
1. 山东建筑大学信息与电气工程学院 济南 250101;
2. 山东建筑大学热能工程学院 济南 250101;
3. 辽宁科技大学电子与信息工程学院 鞍山 114051
摘要:【目的】在底部具有木质样本热源的圆柱形封闭腔内,基于最小二乘支持向量机(LS-SVM)建立自然对流引起的温度场预测模型,研究采暖木质地板蓄热后的温度场分布规律,为后续反演采暖木质地板的蓄热特性提供数据基础。【方法】首先,给出圆柱形封闭腔物理模型的边界条件和木质样本初始温度,根据流体力学定律建立热场传热的质量、动量和能量守恒方程,并用计算流体力学(CFD)软件进行求解。其次,对CFD求解的数据进行归一化处理,并根据木质样本初始温度将归一化后的数据分成训练集和验证集2部分,其中训练集5 481个温度,验证集8组,每组609个温度;利用训练集对LS-SVM模型进行训练,采用果蝇优化算法对模型的核函数参数σ和正则化参数γ进行寻优,得到σγ的最优参数组合为[1.0×1010,0.06]。最后,应用优化好的模型分别对每个验证集上的温度值进行预测,并与BP神经网络方法的预测结果进行比较。【结果】LS-SVM对不同样本温度场预测的最大拟合度为0.998 9,最小为0.996 8;平均相对误差、最大相对误差和均方误差最大值分别为0.25%、2.6%和0.31%,最小值分别为0.054%、0.84%和0.12%;最长建模时间为12.93 s,最短为12.72 s。与之相比,BP神经网络预测的最大拟合度为0.999 7,最小为0.998 3;平均相对误差、最大相对误差和均方误差最大值分别为0.47%、5.43%和0.63%,最小值分别为0.21%、2.08%和0.33%;最长建模时间为107.15 s,最短为106.23 s。LS-SVM对不同样本温度场预测的拟合误差比BP神经网络方法的预测结果要小一些,拟合度与BP神经网络方法相近,建模和预测需要的时间明显少于BP神经网络。【结论】采用LS-SVM对采暖木质地板的蓄热温度场建模是可行的,该方法适合对小样本建模,泛化性较好,对在试验条件下利用有限数据来对温度场建模和预测具有明显优势,可为后续开展采暖木质地板蓄热机制的反演工作提供指导。
关键词:采暖木质地板    自然对流    最小二乘支持向量机    建模    
Modeling of Natural Convection Temperature Field Produced by Wood Floor with Geothermal System Based on LS-SVM
Cao Zhengbin1, Zhou Shiyu2, Liu Xiaoping1, Gao Chuang3, Du Guangyue1, Zhou Yucheng1     
1. School of Information and Electrical Engineering, Shandong Jianzhu University Jinan 250101;
2. School of Thermal Engineering, Shandong Jianzhu University Jinan 250101;
3. School of Electrics and Information Engineering, University of Science and Technology Liaoning Anshan 114051
Abstract: 【Objective】In order to study the distribution of temperature field of wood floor after storage of heat, in this paper, wooded heating source was placed on the bottom of the closed cylindrical cavity, and the prediction model of temperature field caused by natural convection is established by using the least squares support vector machine(LS-SVM), which will provide the data base for the subsequent inversion of the heat storage characteristics of wood floor with geothermal system.【Method】Firstly, the boundary conditions of the physical model of a cylindrical cavity and the initial temperature of the wood sample are given. Meanwhile, according to the law of fluid mechanics, the mass, momentum and energy conservation equations of heat transfer in heat field are established and solved by computational fluid dynamics(CFD) software. Secondly, the data obtained by CFD is normalized, and according to the initial temperature of wood samples, the normalized data is divided into two parts:training set and prediction set. There are 5 481 data in the training set, and the forecast set is 8 groups with 609 data in each group. The training set is used to train the LS-SVM model, the optimization algorithm of drosophila is used to optimize the kernel function parameter σ and regularization parameter γ of the model, and the optimal combination of the parameters is(1.0×1010, 0.06).Finally, the optimized model is used to predict the temperature of each prediction set, and the result are compared with the prediction result of the BP-ANN method.【Result】The result showed that when using LS-SVM to predict different sample temperature field, the maximum fitting degree is 0.998 9, the minimum is 0.996 8; the average relative error, the maximum relative error and mean square error of the maximum values are 0.25%, 2.6% and 0.31%, respectively; the minimum values are 0.054%, 0.84% and 0.12%, respectively; the longest modeling time is 12.93 s, and the shortest is 12.72 s. Whereas, when the BP-ANN is used to predict the temperature field, the maximum fitting degree is 0.999 7, and the minimum fit degree is 0.998 3; the average relative error, the maximum relative error and the mean square error maximum value are 0.47%, 5.43% and 0.63%, respectively; the minimum values are 0.21%, 2.08% and 0.33% respectively; the longest modeling time is 107.15 s, and the shortest is 106.23 s. In contrast, it can be seen that the fitting error of LS-SVM to predict different temperature fields is smaller than that of BP-ANN, the fitting degree is similar to that of BP-ANN, the modeling and prediction time is much less than those of BP-ANN.【Conclusion】It is feasible to model the heat storage temperature field of the wood floor with geothermal system by using the LS-SVM method. Because this method is suitable for small sample modeling and has good generalization, it has obvious advantages for modeling and prediction of temperature field in the experimental environment with limited data. It can provide guidance for subsequent work of retrieving heat storage mechanism of wood floor with geothermal system.
Key words: wood floor with geothermal system    natural convection    least squares support vector machine    modeling    

传统热物理学中,对封闭腔内自然对流换热的研究一直是该领域的经典问题。在封闭腔内,自然对流是传热的主要方式之一,在能量传输中起主导作用,因此在工程中具有重要的应用价值(Saravanan et al., 2008)。建筑物室内采暖木质地板受热所产生的自然对流现象可以描述为一个带有干扰条件的封闭腔自然对流换热模型,为寻找其内部传热机制,探究采暖木质地板的蓄热特性,需要用理想封闭腔内自然对流换热模型对其温度场分布规律进行研究。在封闭腔内,由于自然对流和热流场具有耦合作用,加之边界层与核心层的相互影响,使得自然对流具有一定的复杂性。针对自然对流在封闭腔内的换热特性,已有许多学者从不同角度对其进行了理论研究,并对如何有效解决自然对流建模中所遇到的问题(如热源类型、尺寸和位置的影响等)进行了重新思考(Aminossadati et al.,2014Karatas et al., 2017Dallaire et al., 2017)。张敏等(2010)在二维封闭方腔底部放置不同大小的热源,对方腔内自然对流换热问题进行数值模拟,分析了不同工况对封闭方腔内温度场和流场的影响。Das等(2016)总结了以往在不同形状和热边界条件下对封闭腔内热流体或多孔介质中自然对流换热问题的研究,包括三角形、梯形、平行四边形、弧形、波浪形或其他形状,以及侧壁热源和底部热源等。从Das等(2016)的总结中可知,以往的主流研究方法主要基于对CFD(computational fluid dynamics)的模拟,而很少基于对试验数据的分析。Mahmoud等(2007)Ben-Nakhi等(2008)采用CFD方法获得的温度数据对人工神经网络结构进行训练和测试,得到3层结构的人工神经网络(BP-ANN)模型,并用该模型对分隔封闭腔内的热传递过程进行预测,结果表明,BP-ANN可以用来准确预测自然对流特性的参数,并可大大减少系统的计算时间。

近年来,支持向量机(support vector machines, SVM)方法在预测自然对流引起的热流场和温度场变化的适应性方面已有研究,并取得了良好效果。SVM是Vapnik等(1963)为解决模式识别中的数据分类问题而提出的机器学习算法,与BP-ANN相比,SVM对处理小样本、非线性和高维模式识别的数据具有独特优势(顾燕萍等,2010),可将低维特征空间中的线性不可分数据映射到高维空间中使其变得线性可分,同时具有很强的泛化能力(预测能力),对封闭腔内研究自然对流换热规律的小样本数据非常适合。Varol等(20082009)在方形多孔封闭腔内对垂直于左侧腔壁的三恒温加热器进行离散加热,通过求解Darcy流模型控制方程获取所需要的数据库,利用SVM对其内部自然对流产生的温度场和流场分布情况进行估计,对部分方形冷却截面层流的自然对流熵产进行预测,验证了SVM估计热流场参数的可行性。Cai(2012)结合传统BP神经网络模型,采用SVM对开放式同心管的临界热流进行建模和预测,结果表明,SVM能够取得比BP神经网络模型更好的精度和泛化能力,对开放式同心管临界热流的预测具有有效性。虽然经典SVM可以解决神经网络中出现的局部极值问题,但对于样本输入个数过于依赖,计算量大,当样本数据变大时,二次规划求解问题会变得更加复杂,因此并不适用于对过程控制进行建模(宋海鹰等,2008)。与之相比,最小二乘支持向量机(least squares support vector machines, LS-SVM)可将问题中的不等式约束转化成等式约束求解,避免了求解过程中比较耗时的QP过程的求解,减少了计算时间,同时也可以解决由于读取数值不稳定而带来的野点数据问题(Gharagheizi et al., 2014)。

综上所述,虽然在传热领域已经引入了BP-ANN等智能算法,也取得了一定研究成果,但将LS-SVM方法应用于该领域的研究还比较少见。鉴于此,本研究给出描述圆柱形封闭腔内空气流动与换热的控制方程,根据CFD求解结果,选取部分数据作为LS-SVM建模的训练集和验证集,并与BP-ANN的在线建模和预测结果进行对比和分析,以期为后续研究地采暖木质地板的蓄热特性提供数据基础。

1 物理和数学模型 1.1 物理模型

本研究对象为三维圆柱形封闭腔,如图 1所示。假设封闭腔的侧壁和上下壁与外界绝热,腔内导热介质为空气,采用Boussinesq对其浮力密度变化近似估计,底部中心位置放置一方形木质样本,样本初始温度为T0,其中训练样本记为T0-train=50+10k (k=0, 1, …,8),预测样本记为T0-test=55+10k (k=0, 1, …, 7);封闭腔内空气温度、顶部温度、侧壁温度、底部温度均为20 ℃。木质样本和圆柱形封闭腔的边界参数如表 1所示。

图 1 圆柱结构模型示意 Figure 1 Cylindrical structure model
表 1 研究对象参数 Tab.1 Parameters of the studied object
1.2 数学模型

采用计算流体力学(CFD)软件对具有严格边界条件的封闭腔模型进行温度场数值模拟,并将模拟数据用于对BP-ANN和LS-SVM模型进行训练和验证。针对所研究的三维空间稳态自然对流,给出描述圆柱形封闭腔内空气流动与换热的控制方程如下。

质量守恒方程:

$ \frac{{\partial u}}{{\partial x}} + \frac{{\partial v}}{{\partial y}} + \frac{{\partial w}}{{\partial z}} = 0。$ (1)

动量方程:

$ \begin{array}{*{20}{c}} {\frac{{\partial \left( {\rho u} \right)}}{{\partial t}} + u\frac{{\partial \left( {\rho u} \right)}}{{\partial x}} + v\frac{{\partial \left( {\rho u} \right)}}{{\partial y}} + w\frac{{\partial \left( {\rho u} \right)}}{{\partial z}} = }\\ {\frac{\partial }{{\partial x}}\left( {\mu \frac{{\partial u}}{{\partial x}}} \right) + \frac{\partial }{{\partial y}}\left( {\mu \frac{{\partial u}}{{\partial y}}} \right) + \frac{\partial }{{\partial z}}\left( {\mu \frac{{\partial u}}{{\partial z}}} \right) - \frac{{\partial P}}{{\partial x}};}\\ {\frac{{\partial \left( {\rho \nu } \right)}}{{\partial t}} + u\frac{{\partial \left( {\rho \nu } \right)}}{{\partial x}} + v\frac{{\partial \left( {\rho \nu } \right)}}{{\partial y}} + w\frac{{\partial \left( {\rho \nu } \right)}}{{\partial z}} = }\\ {\frac{\partial }{{\partial x}}\left( {\mu \frac{{\partial \nu }}{{\partial x}}} \right) + \frac{\partial }{{\partial y}}\left( {\mu \frac{{\partial \nu }}{{\partial y}}} \right) + \frac{\partial }{{\partial z}}\left( {\mu \frac{{\partial \nu }}{{\partial z}}} \right) - \frac{{\partial P}}{{\partial y}};}\\ {\frac{{\partial \left( {\rho w} \right)}}{{\partial t}} + u\frac{{\partial \left( {\rho w} \right)}}{{\partial x}} + v\frac{{\partial \left( {\rho w} \right)}}{{\partial y}} + w\frac{{\partial \left( {\rho w} \right)}}{{\partial z}} = }\\ {\frac{\partial }{{\partial x}}\left( {\mu \frac{{\partial w}}{{\partial x}}} \right) + \frac{\partial }{{\partial y}}\left( {\mu \frac{{\partial w}}{{\partial y}}} \right) + \frac{\partial }{{\partial z}}\left( {\mu \frac{{\partial w}}{{\partial z}}} \right) - \frac{{\partial P}}{{\partial z}} + \rho g。} \end{array} $ (2)

能量方程:

$ \begin{array}{*{20}{c}} {\frac{{\partial \left( {\rho {T_1}} \right)}}{{\partial t}} + u\frac{{\partial \left( {\rho {T_1}} \right)}}{{\partial x}} + v\frac{{\partial \left( {\rho {T_1}} \right)}}{{\partial y}} + }\\ {w\frac{{\partial \left( {\rho {T_1}} \right)}}{{\partial z}} = \frac{\lambda }{c}\left( {\frac{{{\partial ^2}{T_1}}}{{\partial {x^2}}} + \frac{{{\partial ^2}{T_1}}}{{\partial {y^2}}} + \frac{{{\partial ^2}{T_1}}}{{\partial {z^2}}}} \right)。} \end{array} $ (3)

式中:uvw分别为封闭腔内xyz方向上的热流速度;t为时间;μ为空气动力学黏度;P为空气压力;T1为空气温度;ρ为空气密度;g为重力加速度,方向垂直向下。

木质样本和圆柱腔壁的能量方程为:

$ \frac{{\partial T}}{{\partial {\rm{t}}}} = \frac{\lambda }{{{\rho _1}{C_{\rm{p}}}}}\left( {\frac{{{\partial ^2}T}}{{\partial {x^2}}} + \frac{{{\partial ^2}T}}{{\partial {y^2}}} + \frac{{{\partial ^2}T}}{{\partial {z^2}}}} \right)。$ (4)

式中:Tλρ1分别为木质样本或圆柱腔壁的温度、导热系数和密度;Cp为比热容。

1.3 温度场模型

封闭腔底部单一热源形成的对流温度场可用图 2给出的模型描述,可以看出,底部中心热源的温度要比周围高得多,最接近热源的空气最先受热,同时“烟囱效应”引起热流首先从热源中部上升,然后在两侧壁面向下流动,使封闭腔顶部温度比两侧下方温度高,封闭腔内等温线由竖直向水平方向变化,并形成2个对称的等温曲线。

图 2 封闭腔底部热源温度场模型 Figure 2 Temperature field model of bottom heat source in closed cavity
2 建模与训练 2.1 最小二乘支持向量机(LS-SVM)

LS-SVM是为解决SVM计算量大、实时性差等缺陷而提出的,其将SVM中的ε不敏感函数用最小方差损失函数代替,通过求解线性KKT(Karush-Kuhn-Tucker)问题来代替SVM中的二次规划问题,从而简化了计算的复杂度。

给定训练集T={(xi, yi)|xiRm, yiRn, i=1, 2, … l},其中l为样本总数,Rm为输入空间,Rn为输出空间,决策函数为:

$ f\left( x \right) = {w^{\rm{T}}}\varphi \left( x \right) + b。$ (5)

根据经验风险最小化原理,综合考虑函数的拟合误差和复杂度,模糊最小二乘支持向量机寻优结果可表示为求解一个带有约束条件的最小值问题:

$ \begin{array}{*{20}{c}} {\mathop {\min }\limits_{w,b,e} J\left( {w,e} \right) = \frac{1}{2}{w^{\rm{T}}}w + \frac{C}{2}\sum\limits_{i = 1}^l {{\mu _i}e_i^2} ;}\\ {{\rm{s}}.\;{\rm{t}}.\;{y_i} = {w^{\rm{T}}}\varphi \left( {{x_i}} \right) + b + {e_i}\left( {i = 1,2, \cdots l} \right)。} \end{array} $ (6)

式中:J为结构风险;yi为需要满足的约束条件;C为松弛因子;wb为决策函数参数;ei为误差变量。

为简化运算,同时解决w维数过大带来维数灾难问题,可引入Lagrange对偶性变换,通过求解与原空间等价的对偶空间得到原始问题的最优解。

引入Lagrange乘子α=[α1, α2, …αn],并构造Lagrange函数:

$ \begin{array}{*{20}{c}} {L\left( {w,b,e,\alpha } \right) = J\left( {w,e} \right) - }\\ {\sum\limits_i^l {{\alpha _i}\left[ {{w^{\rm{T}}}\varphi \left( {{x_i}} \right) + b + {e_i} - {y_i}} \right]} 。} \end{array} $ (7)

由于该函数满足KKT条件,分别对wbeα求偏导数并消去wei,有:

$ {y_i} = \sum\limits_{i = 1}^l {{\alpha _i}\varphi {{\left( {{x_i}} \right)}^{\rm{T}}} \cdot \varphi \left( {{x_j}} \right)} + b + \frac{1}{C}{\alpha _i}。$ (8)

通过训练点和测试点的内积制定决策规则k(·, ·),也就是核函数,考虑到样本的非线性性,选择Radial Basis Function(RBF)核函数:

$ k\left( {{x_i},{x_j}} \right) = \varphi {\left( {{x_i}} \right)^{\rm{T}}} \cdot \varphi \left( {{x_j}} \right) = \exp \left( { - \frac{{{{\left\| {{x_i} - {x_j}} \right\|}^2}}}{{{\sigma ^2}}}} \right)。$ (9)

式中:σ为核函数宽度调节参数,用于控制RBF作用的范围。

由式(8)和式(9)得到线性方程组矩阵方程:

$ \begin{array}{*{20}{c}} {\left[ {\begin{array}{*{20}{c}} 0&1& \cdots &1\\ 1&{k\left( {{x_1},{x_1}} \right) + 1/C}& \cdots &{k\left( {{x_1},{x_1}} \right)}\\ \vdots&\vdots&\ddots&\vdots \\ 1&{k\left( {{x_l},{x_1}} \right)}& \cdots &{k\left( {{x_l},{x_l}} \right) + 1/C} \end{array}} \right]\left[ {\begin{array}{*{20}{c}} b\\ {{\alpha _1}}\\ \vdots \\ {{\alpha _l}} \end{array}} \right] = }\\ {\left[ {\begin{array}{*{20}{c}} 0\\ {{y_1}}\\ \vdots \\ {{y_l}} \end{array}} \right]。} \end{array} $ (10)

由式(10)得到的极值解就是分类超平面的最优解$ \hat \alpha = {({\alpha _1}, {\alpha _{2, }} \cdots {\alpha _l})^{\rm{T}}} $$ \hat b $,每一个非零Lagrange乘子αi对应的输入向量xi就是落在分类超平面上的最小二乘支持向量(LS-SVM)。通过最优解可构造最优拟核函数:

$ \hat f\left( x \right) = \sum\limits_{i = 1}^l {{{\hat \alpha }_i}K\left( {x,{x_i}} \right)} + \hat b,i = 1,2, \cdots l。$ (11)

由矩阵方程(10)可知,LS-SVM的训练过程求解的是线性方程组,而不是带约束的凸二次规划,与标准SVM的训练过程有着本质区别,因此相比SVM具有更小的计算复杂度。

2.2 参数寻优

对于LS-SVM来说,核函数的价值就在于其可将线性不可分的特征向量事先在低维空间中进行计算,然后将分类效果在高维空间中表现出来,以避免在高维空间中的复杂计算。采用RBF核函数的LS-SVM模型中有核函数参数σ和正则化参数γ,这2个参数对模型的性能影响非常显著,σ值越大,核函数收敛速度越快,模型越平滑,此时均方误差小,泛化能力好,但不能反映各点的真实数据;γ值越大,噪声对训练结果的影响越明显,此时强调决策函数的拟合能力,模型的平滑性和泛化能力降低。通常,当模型训练样本发生变化时,参数σγ也会发生变化,因此这2个参数的最优值具有不确定性。为减少在寻优过程中的盲目性,本研究采用司刚全等(2017)的果蝇优化算法对上述2个参数进行寻优。

果蝇优化算法是根据果蝇的觅食行为进行推演形成的一种寻找全局最优解的智能优化算法(王林等,2017),该算法寻优机制简单,参数设置少,求解时不依赖于问题的具体信息,具有出众的全局优化能力。针对果蝇优化算法对核函数参数σ和正则化参数γ的寻优过程,设置种群数为2,种群规模为30,最大迭代次数为50,将训练数据和验证数据的拟合度(R2)作为味道浓度判定函数,即f(Si)=R2,迭代终止时,果蝇优化算法搜寻到的f(Si)最小值所对应的各果蝇群最佳味道浓度判断定值Si即为σγ的全局最优解。

3 数据处理 3.1 数据提取

LS-SVM建模数据由CFD生成,分为训练集和验证集2部分。虽然本研究是基于三维空间进行的理论建模,但这里只对笛卡尔坐标中x=0处y-z平面上的二维空间温度场进行建模分析。由于样本规模较大时,矩阵求逆较为困难,直接用LS-SVM建模有较大局限性,因此,为减少训练集中温度的个数,同时兼顾对预测温度场表述的准确性,本研究对CFD模拟数据进行等坐标距离均匀提取,使训练集包含5 481个温度,验证集8组,每组609个温度。建模时,方形木块初始温度T0与笛卡尔坐标yz为训练集样本中的输入变量xi;热交换开始后第9 000 s时的温度场T为训练集样本中的输出变量yi

3.2 数据归一化

在不同物理范畴内往往具有不同的评价标准,意味着会对应不同的单位和量纲,因此在数据分类时就会因数量级差别较大而影响分析结果的准确性。为减小环境因子所产生的误差积累,消除因数量级差别较大带来的影响,需要对数据进行归一化处理,使各量纲处于同一数量级。本研究采用离差标准化法,使归一化后的数值都映射到[0, 1]之间,坐标(y, z)和温度T归一化公式如下:

$ \begin{array}{l} {{\bar y}_i} = \frac{{{y_i} - {y_{{\rm{mid}}}}}}{{\left| {{y_{{\rm{max}}}} - {y_{{\rm{min}}}}/2} \right|}};\\ {{\bar z}_i} = \frac{{{z_i} - {z_{{\rm{mid}}}}}}{{\left| {{z_{{\rm{max}}}} - {z_{{\rm{min}}}}/2} \right|}};\\ {{\bar T}_i} = \frac{{{T_i} - {T_{\min }}}}{{\left| {{T_{\max }} - {T_{\min }}} \right|}}。\end{array} $ (12)

其中,ymid=(ymax+ymin)/2,zmid=(zmax+zmin)/2。

4 在线建模 4.1 模型评价

为有效训练模型参数,评价模型预测性能,本研究引入平均相对误差(MRE)、最大相对误差(MAE)、均方误差(MSE)和拟合度(R2)4个指标,并对其跟踪变化趋势的能力进行分析,其中拟合度R2越接近于1,代表模型的预测性能越好:

$ {\rm{MRE}} = \frac{1}{n}\sum\limits_{i = 1}^n {\frac{{\left| {{T_{{\rm{model}}}} - {T_{{\rm{CFD}}}}} \right|}}{{\left| {{T_{{\rm{CFD}} - \max }} - {T_{{\rm{CFD}} - \min }}} \right|}}} ; $ (13)
$ {\rm{MAE}} = \max \frac{{\left| {{T_{{\rm{model}}}} - {T_{{\rm{CFD}}}}} \right|}}{{\left| {{T_{{\rm{CFD}} - \max }} - {T_{{\rm{CFD}} - \min }}} \right|}}; $ (14)
$ {\rm{MSE}} = \sqrt {\frac{1}{n}\sum\limits_{i = 1}^n {\frac{{{{\left( {{T_{{\rm{model}}}} - {T_{{\rm{CFD}}}}} \right)}^2}}}{{{T_{{\rm{CFD}} - \max }} - {T_{{\rm{CFD}} - \min }}}}} } ; $ (15)
$ {R^2} = \left[ {1 - \frac{{\sum\limits_{i = 1}^n {{{\left( {{T_{{\rm{model}}}} - {T_{{\rm{CFD}}}}} \right)}^2}} }}{{\sum\limits_{i = 1}^n {{{\left( {{T_{{\rm{model}}}} - {T_{{\rm{model - mean}}}}} \right)}^2}} }}} \right] \times 100\% 。$ (16)

式中:Tmodel为模型预测温度值;TCFD为从CFD中提取的原始温度数据;Tmodel-mean为模型预测温度平均值。

4.2 在线建模及预测结果

在LS-SVM算法中,采用果蝇优化算法对核函数参数σ和正则化参数γ进行寻优,σγ初始值随机,优化后选取拟合度(R2)最接近于1的参数对[σ, γ],并保存模型,得到最优参数组合为[1.0×1010,0.06]。

为验证该方法的预测效果,在同样的Matlab环境下,采用BP神经网络对相同的样本进行训练,得到最优的BP神经网络(BP-ANN)模型,其中网络隐含层包含2层,每层节点数15个,输出层节点数为1,激励函数为双极性S函数tansigmoid,训练时的学习率为0.005,训练次数为500,动量常数为0.9,训练误差为3.62×10-6。部分样本的预测结果(T0=55 ℃,T0=85 ℃,T0=115 ℃)如图 3所示,可以看出,BP-ANN和LS-SVM 2种方法的预测结果与CFD模拟结果一致,2种方法都能准确预测出温度场的变化曲线。

图 3 LS-SVM和BP-ANN对CFD模拟温度场的预测结果 Figure 3 LS-SVM and BP-ANN prediction results for simulated temperature field of CFD
4.3 结果分析与讨论

LS-SVM和BP-ANN预测结果比较如表 2所示。可以看出,LS-SVM预测结果的平均相对误差、最大相对误差和均方误差都比BP-ANN要小一些,拟合度与BP-ANN相近,建模和预测需要的时间明显少于BP-ANN。之所以会出现这样的结果,是因为BP-ANN采用的是经验风险最小化原则,在对有限样本的非线性数据分类时易陷入局部最优,而且训练能力和预测能力相矛盾,泛化能力差,容易出现使训练误差小而验证误差大的过拟合现象;同时由于BP-ANN采用梯度下降算法且存在麻痹现象,使算法效率较低。相反,LS-SVM是基于VC维和结构风险最小原则提出的,针对有限样本,VC维和经验风险都会变小,这样就缩小了置信范围,从而使期望风险变小;同时LS-SVM以最小二乘系统作为损失函数,求解的是带有等式约束的线性方程组,避免了求二次规划的问题,从而可以表现出预测精度高、建模速度快的特点。

表 2 LS-SVM和BP-ANN预测结果比较 Tab.2 Comparison of prediction results for LS-SVM and BP-ANN
5 结论

封闭腔内自然对流引起的温度场具有非线性和时变特性,计算流体力学(CFD)因具有较强的数值分析能力,是求解封闭腔内传热和流动特性的常用工具。本研究首先通过CFD模拟得到采暖木质地板蓄热后生成的温度场数据;然后选取其中部分数据作为LS-SVM模型的训练集和验证集;针对模型参数的寻优问题,引入果蝇优化算法,减少了对正则化参数σ和核函数参数γ寻优的盲目性,同时提高了模型的全局优化能力;最后与BP-ANN在相同建模环境下的仿真结果进行了比较。结果表明,BP-ANN训练的模型可以获得较好的预测效果,但是相比LS-SVM,该算法拟合误差较大、训练速度较慢,这是因为BP-ANN算法泛化能力较弱,容易陷入过学习或欠学习状态,使训练速度不能满足实时性要求。而LS-SVM折中考虑了经验风险和置信风险,具有较好的泛化能力和预测精度,同时将求凸二次规划问题转换成求线性方程组,从而具有更快的训练速度。本研究引入LS-SVM算法实现对圆柱形封闭腔内的自然对流温度场建模,可为更好地研究采暖木质地板蓄热规律提供新的数据分析工具,对采暖木质地板产品的蓄热标准化和规范化具有重要意义。

参考文献(References)
顾燕萍, 赵文杰, 吴占松. 2010. 最小二乘支持向量机的算法研究. 清华大学学报:自然科学版, 50(7): 1063-1066, 1071.
(Gu Y P, Zhao W J, Wu Z S. 2010. Least squares support vector machine algorithm. Journal of Tsinghua University:Science and Technology, 50(7): 1063-1066, 1071. [in Chinese])
司刚全, 李水旺, 石建全, 等. 2017. 采用改进果蝇优化算法的最小二乘支持向量机参数优化方法. 西安交通大学学报, 51(6): 14-19.
(Si G Q, Li S W, Shi J Q, et al. 2017. Least squares support vector machine parameters optimization based on improved fruit fly optimization algorithm with applications. Journal of Xi'an Jiaotong University, 51(6): 14-19. [in Chinese])
宋海鹰, 桂卫华, 阳春华. 2008. 模糊偏最小二乘支持向量机的应用研究. 系统仿真学报, 20(5): 1344-1347.
(Song H Y, Gui W H, Yang C H. 2008. Application research of fuzzy partial least square support vector machine. Journal System Simulation, 20(5): 1344-1347. [in Chinese])
王林, 吕盛祥, 曾宇容. 2017. 果蝇优化算法研究综述. 控制与决策, 32(7): 1153-1162.
(Wang L, Lü S X, Zeng Y R. 2017. Literature survey of fruit fly optimization algorithm. Control and Decision, 32(7): 1153-1162. [in Chinese])
张敏, 晏刚, 陶锴. 2010. 内置发热体的封闭方腔自然对流换热数值模拟. 化工学报, 61(6): 1373-1378.
(Zhang M, Yan G, Tao K. 2010. Numerical simulation of natural convection in rectangular cavities with a heater of variable dimension. Chemical Engineering, 61(6): 1373-1378. [in Chinese])
Aminossadati S M, Ghasemi B, Kargar A. 2014. Computational analysis of magneto hydrodynamic natural convection in a square cavity with a thin fin. European Journal of Mechanics-B/Fluids, 46(S1): 154-163.
Ben-Nakhi A, Mahmoud M A, Mahmoud A M. 2008. Inter-model comparison of CFD and neural network analysis of natural convection heat transfer in a partitioned enclosure. Applied Mathematical Modelling, 32(9): 1834-1847. DOI:10.1016/j.apm.2007.06.018
Cai J. 2012. Applying support vector machine to predict the critical heat flux in concentric-tube open thermosiphon. Annals of Nuclear Energy, 43(6): 114-122.
Caklcagni B, Marsili F, Paroncini M. 2005. Natural convective heat transfer in square enclosures heated from below. Applied Thermal Engineering, 25(16): 2522-2531. DOI:10.1016/j.applthermaleng.2004.11.032
Dallaire J, Gosselin L. 2017. Numerical modeling of solid-liquid phase change in a closed 2D cavity with density change, elastic wall and natural convection. International Journal of Heat & Mass Transfer, 114: 903-914.
Das D, Roy M, Basak T. 2016. Studies on natural convection within enclosures of various(non-square) shapes-a review. International Journal of Heat & Mass Transfer, 106: 356-406.
Gharagheizi F, Ilani-kashkouli P, Sattari M, et al. 2014. Development of a LSSVM-GC model for estimating the electrical conductivity of ionic liquids. Chemical Engineering Research & Design, 92(1): 66-79.
Karatas H, Derbentli T. 2017. Natural convection in rectangular cavities with one active vertical wall. International Journal of Heat & Mass Transfer, 105: 305-315.
Mahmoud M A, Ben-Nakhi A E. 2007. Neural networks analysis of free laminar convection heat transfer in a partitioned enclosure. Communications in Nonlinear Science & Numerical Simulation, 12(7): 1265-1276.
Saravanan S, Hakeem A K A, Kandaswamy P, et al. 2008. Buoyancy convection in a cavity with mutually orthogonal heated plates. Computers & Mathematics with Applications, 55(12): 2903-2912.
Varol Y, Oztop H F, Avci E. 2008. Estimation of thermal and flow fields due to natural convection using support vector machines(SVM) in a porous cavity with discrete heat sources. International Communications in Heat & Mass Transfer, 35(8): 928-936.
Varol Y, Oztop H F, Koca A, et al. 2009. Forecasting of entropy production due to buoyant convection using support vector machines(SVM) in a partially cooled square cross-sectional room. Expert Systems with Applications, 36(3): 5813-5821. DOI:10.1016/j.eswa.2008.07.016
Vapnik V, Lerner A. 1963. Pattern recognition using generalized portrait method. Automation & Remote Control, 24: 774-780.