
2011年第3期(总227期)
设计研究
文章编号:1006-2971(2011)03-0001-05
压绿机技术 Compressoc
基于Matlab与VC++混合编程的
螺杆泵转子型线设计卢振飞,曹锋,李祁光,邢那子文(西安交通大学能源与动力工程学院,陕西西安710049)
摘要:通过Matlab与VC++混合编程实现了螺杆泵转子型线设计的软件化、通用化,用户只需要选择改变原始型线的类型,输入方程,参数范图,即可得到其共曲线段方程、参数范围。然后通过接触线的计算来判定所设计型线的密封性能。本文采用了Matlab引擎与VC++混合编程,Matlab引季作为服务
器进行方程求解等复杂数学计算,VC++编制的界面面向客户接效输入信息,输出最终结果。关键调:Matlab引擎;VC++:混合编程螺杆型线
中图分类号:TB652
文献标志码:A
TheProfileDesignof ScrewPumpRotorBased on
MixedProgramming ofMatlab and VC++ LU Zhen-fei, CAO Feng,LI Qi-guang,XING Zi-wen
(College of Power and Energy Engineering,Xi"an Jiaotong University,Xi'an 710049,China)
Abstract: In this paper,the mixed programming of Matlab and VC + + is used to realize the programming and universal designed for screw pump rotor profile, Users only require selecting the type of changing original pro-file,and then input formula and parameters range, the conjugate equation of curve segment and the parameters range are obtained. Next,the calculation through contact line is used to judge the seal performance of the de-signed profile. This paper has adopted the mixed programming of Matlab engine and VC + + . Matlab engine completes the solving of sophisticated mathematic calculation as a service, VC + + designs a friendly plane,used to receive the client' s message and display the results.
Key words: Matlab engine; Visual C + + ;mixed programming; screw profile
螺杆泵转子设计中,最重要的是型线设计,因为转子型线基本决定着螺杆泵性能的好坏。螺杆泵性能的提高及其市场份额的不断扩大,与转子型线的发展密不可分的。国际上著名的螺杆泵生产厂家,都是伴随着新型线的开发成功而不断壮大的但是新型线的开发周期很长、投资很大,本文旨在开发螺杆型线的设计计算软件。
本软件使用VC++编制Matlab引擎接口程序,调用Matlab进行计算,避免了在VC++中定义大量的数据,编制算法程序,特别是微分方程的求解,充分利用Matlab计算、绘图功能,实现整个计算过程。
收稿日期:20101223
基金项目:国家高技术研究发展计划资助项目(2007AA05Z208)
VC++作为一种高级编程语言,可以开发出功能强大,界面友好的商业软件。其MFC编程可以根据设置生成所需的程序框架,程序员只需要定义所需变量、函数,添加必要的核心代码即可实现其功能,大大缩短的软件的开发周期。
Matlab混合编程 1
1.1Matlab与VC++混合编程的实现方法
Matlab作为计算的一种通用工具,它可以和VC++ 方便的进行连接。一般而言,Matlab与VC++混合编程的实现方法主要有以下4种方法”:
(1)通过引擎(Engine),采用客户机服务器的计算模式;