摘要
VBA虚拟模型实现泵性能仿真实验,寻求解决化工实验教学中内容多、设备紧缺的问题。利用常用软件Excel的绘图功能与VBA混合编程,构建泵性能实验虚拟模型。ActiveX控件表示进出口阀、电源开关等,用于调节流量,控制实验进程;在Excel中通过最小二乘拟合真实装置中获取的实验数据,得到仿真虚拟装置各仪表读数等随实验进程产生动态变化的数学关系;Excel的矩形、圆、直线、箭头等常用绘图工具绘制仿真虚拟实验装置中的仪表及数字动态显示框;Excel的数据库功能、表格功能及函数功能保存和处理单元格的仿真数据,矩形文本框通过与这些单元格的链接动态显示各种仪表的读数;VBA与Excel各功能的完美结合,实现虚拟模型在仿真实验中形态、数值的动态变化。仿真中所获得的泵性能参数He、N、η与流量Q_v的关系,在Excel中直接拟合成2次多项式,其相关系数的拟合度较高,相关性好。仿真结果与真实实验值比较,参数的平均相对误差小,结果较为精确。更重要的是基于VBA的仿真模型易于创建,交互性好,为化工实验仿真教学提供新途径。
Implementation of the simulation experiments of pump performance by using VBA virtual model,solve the problems of more contents and equipment of chemical experiments teaching.Use the function of drawing of common software Excel and mixed programming of VBA to construct experimental and virtual model.ActiveX controls represent inPut valve and output valve,power switch,and so on.It is used in adjusting flow and controlling the experiment process.Fitting the acquisition of the experimental data from the real device based on the Least-Square algorithm in Excel,the paper has been acquired the mathematical relationships of the dynamic changes of the reading of a digital meter based on the virtual simulation equipments with the laboratory process.The instruments and the dynamic digital display window of the virtual simulation experiment device have been drawn with the popular toolbar of Excel,such as rectangle,round,linear and arrow,and so on.Preserved and processed the simulation data of the cells in data base functions,table functions and Performance functions of Excel,rectangle texts dynamically display the reading of the instruments by linking the cell.Combined VBA functions and Excel functions,has realized the dynamic changes in forms and digit of the virtual models with the simulation experiments.The relationship between pump performance parameters He,N andηwhich are obtained in simulation and flow Q_v is fitted into quadratic polynomial directly.Its correlation coefficient has a higher degree of fitting and better relativity.The average relative error of parameters is less and the results are more accurate compared with the real experimental values.More important is that simulation model based on VBA is easy to create and has better interactivity,and the model provides a new solution for Chemical experiments teaching.
出处
《计算机与应用化学》
CAS
CSCD
北大核心
2010年第6期849-852,共4页
Computers and Applied Chemistry
基金
江西省教育厅2008年度科技资助项目(项目编号:GJJ08461)
关键词
常用软件
泵性能
仿真实验
模型
common software
pump performance
simulation experiment
model