欢迎访问《中国农学通报》,

中国农学通报 ›› 2012, Vol. 28 ›› Issue (6): 262-268.

• 工程 机械 水利 装备 • 上一篇    下一篇

MATLAB和VB在温室环境模型构建中的混合编程研究

孟力力 杨其长   

  • 收稿日期:2011-08-12 修回日期:2011-11-18 出版日期:2012-02-25 发布日期:2012-02-25
  • 基金资助:

    基于环境模型的日光温室结构优化与数字化设计

Hybrid Programming with MATLAB and VB in Building Visual Simulation Model for Thermal Environment in Chinese Solar Greenhouse

  • Received:2011-08-12 Revised:2011-11-18 Online:2012-02-25 Published:2012-02-25

摘要:

旨在找到一种MATLAB和VB混合编程的方法,实现日光温室热环境模拟模型软件的可视化编写。采用基于组件对象模型COM(component object module)的方法,研究了MATLAB和VB在模型构建中的混合编程。采用MATLAB软件编写M.源函数文件,实现理论模型中的工程计算和图像图形处理功能,M.源函数文件编译成功后,通过COM方法转换为可被独立调用的组件;采用VB软件编写主程序文件,实现良好的人机交互功能。在主程序中完成模型各项参数的赋值后,再调用COM组件进行理论模型的计算与绘图。COM组件方法可以实现MATLAB和VB的混合编程。以此构建的日光温室热环境模拟模型软件,可在主程序输入各项参数:室外气象条件,温室结构、热性能等,模拟室内热环境的变化。

关键词: 棉花, 棉花, 苗期, 氮营养, 筛选

Abstract:

The objective of this study was to find a hybrid programming method with VB and MATLAB, which could achieve visual simulation model software for thermal environment in Chinese solar greenhouse. The application of MATLAB and VB in model was studied based on COM (component object module) method. M. function file was written by MATLAB, which could solve engineering calculations and image graphics of model. M. function file was transferred to be components which could be called independently after compilation successfully. The main program file was written by VB which can supply good human-machine interface. After parameters were given in main program, COM component was called to do calculation and drawing of model. Hybrid programming with MATLAB and VB was achieved by COM component method. A visual model of thermal environment was established by hybrid programming, which could predict the temperature change by giving outside weather conditions, type of greenhouse structure, thermal properties and other parameters.