课程设计(论文)基于VB编程的水泵拟合实现_第1页
课程设计(论文)基于VB编程的水泵拟合实现_第2页
课程设计(论文)基于VB编程的水泵拟合实现_第3页
课程设计(论文)基于VB编程的水泵拟合实现_第4页
课程设计(论文)基于VB编程的水泵拟合实现_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、基于vb编程的水泵拟合实现1条件综述1.1 拟合条件已知水泵的四个工况点流量、扬程、功率以及空调水系统管网的阻力系数,拟合水泵(并联)的特性曲线以及管网的特性曲线。1.2 样本条件本次编程选用南方泵业td100及td150系列四种型号的水泵。模拟的供热系统各参数分别为:供热面积:200000平方米;面积热指标:45w/m2;供回水温度:95/70;系统阻力:37米水柱。2 编程要求循环水泵特性曲线拟合:多台同型号水泵并联,根据水泵并联特性通过计算机编程计算,求水泵工作点。考虑单台或多台循环水泵运行时,比较其流量、扬程、效率、轴功率如何变化,画出水泵和管网特性曲线。3 水泵拟合求解思路从水泵性能

2、曲线图可看出水泵的扬程、功率和效率是流量的多项式。因此可以表示为:h=h0+a1g+a2g2+a3g3 n=n0+b1g+b2g2+b3g3 =(g*h*1000)/n*100*3600式中 g水泵流量,m3/h; h水泵扬程,mh2o; 水泵效率,%; n水泵轴功率,kw上面方程组的系数a1、a2、a3和h0可由最小二乘法得到:为了编程语言的方便,其中上列方程组中的系数a1、a2、a3和h0分别由x1、x2、x3、x4代替,即:具体方程组的求解是利用高斯赛德尔迭代法迭代公式为:解出x(1)等各个系数,同理解出b1、b2、b3、n0。再利用公式=(g*h*1000)/n*100*3600求出。

3、从而确定gh、g、gn回归曲线方程。根据回归曲线方程则可以画出水泵的性能曲线。4 程序代码及注释水泵参考工作点数据库的建立程序代码为:(1) 主界面和开始界面的转换:private sub cmdjr_click()frm1.hide 隐藏开始界面frm2.show 显示程序主界面end subprivate sub cmdtc_click()endend sub(2) 赋值和管网阻力系数的计算:option explicitdim g as single, n as single, h as single, s as single, z as single, zl as single, tg

4、 as single, th as single, dt as single, m as single 定义变量dim x(1 to 4) as double, y(1 to 4) as double, a(1 to 4, 1 to 4) as double, b(1 to 4, 1 to 4) as doubleprivate sub cmdm1_click()txtmj.text = 200000 面积赋值txtzb.text = 45 采暖热指标赋值txtgs.text = 95 供水温度txths.text = 70 回水温度txtzl.text = 37 系统阻力end subpri

5、vate sub cmdjs_click()if txtmj.text = thenmsgbox 请输入数据elsem = val(txtmj.text)z = val(txtzb.text)zl = val(txtzl.text)tg = val(txtgs.text)th = val(txths.text)dt = tg th 供回水温差g = m * z * 3.6 / (4187 * dt)txtll.text = gs = zl / (g * g) 阻力系数计算txtxs.text = send ifend sub(3) 水泵选型及赋值:private sub cmdsb_click

6、()if comsb.text = comsb.list(0) thentxtq(0).text = 40txtq(1).text = 80txtq(2).text = 120txtq(3).text = 160txth(0).text = 16.8txth(1).text = 17.1txth(2).text = 16.3txth(3).text = 15txtn(0).text = 5txtn(1).text = 6txtn(2).text = 7.7txtn(3).text = 8.9end ifif comsb.text = comsb.list(1) thentxtq(0).text

7、 = 40txtq(1).text = 100txtq(2).text = 140txtq(3).text = 200txth(0).text = 34.6txth(1).text = 34.7txth(2).text = 34.4txth(3).text = 33txtn(0).text = 12txtn(1).text = 17txtn(2).text = 20.1txtn(3).text = 25end ifif comsb.text = comsb.list(2) thentxtq(0).text = 40txtq(1).text = 100txtq(2).text = 140txtq

8、(3).text = 200txth(0).text = 42.5txth(1).text = 42.6txth(2).text = 42txth(3).text = 40txtn(0).text = 15txtn(1).text = 21txtn(2).text = 27txtn(3).text = 30.8end ifif comsb.text = comsb.list(3) thentxtq(0).text = 20txtq(1).text = 40txtq(2).text = 60txtq(3).text = 80txth(0).text = 29txth(1).text = 28.5

9、txth(2).text = 27.5txth(3).text = 26.5txtn(0).text = 4.2txtn(1).text = 5txtn(2).text = 5.6txtn(3).text = 6.5end ifif comsb.text = 请选择 then 提示选择水泵msgbox 请选择水泵end ifif comsb.text = thenmsgbox 请选择水泵end ifend subprivate sub cmdone_click(index as integer)if comsb.text = 请选择 then msgbox 请选择水泵end ifif coms

10、b.text = thenmsgbox 请选择水泵end if(4) 方程求解及单台水泵曲线绘制:dim c as single, d as single, ef as single 定义变量dim i as integer, j as integer, xk as single, yk as singledim b1(1 to 4) as single, b2(1 to 4) as singlea(1, 1) = 4 最小二乘法a(1, 2) = 0for i = 1 to 4 a(1, 2) = a(1, 2) + val(txtq(i - 1).text)next ia(1, 3) =

11、0for i = 1 to 4 a(1, 3) = a(1, 3) + val(txtq(i - 1).text) 2next ia(1, 4) = 0for i = 1 to 4 a(1, 4) = a(1, 4) + val(txtq(i - 1).text) 3next ia(2, 4) = 0for i = 1 to 4 a(2, 4) = a(2, 4) + val(txtq(i - 1).text) 4next ia(3, 4) = 0for i = 1 to 4 a(3, 4) = a(3, 4) + val(txtq(i - 1).text) 5next ia(4, 4) =

12、0for i = 1 to 4 a(4, 4) = a(4, 4) + val(txtq(i - 1).text) 6next ia(2, 1) = a(1, 2): a(2, 2) = a(1, 3): a(2, 3) = a(1, 4)a(3, 1) = a(1, 3): a(3, 2) = a(1, 4): a(3, 3) = a(2, 4)a(4, 1) = a(1, 4): a(4, 2) = a(2, 4): a(4, 3) = a(3, 4)b1(1) = 0for i = 1 to 4 b1(1) = b1(1) + val(txth(i - 1).text)next ib1(

13、2) = 0for i = 1 to 4 b1(2) = b1(2) + val(txth(i - 1).text) * val(txtq(i - 1).text)next ib1(3) = 0for i = 1 to 4 b1(3) = b1(3) + val(txth(i - 1).text) * val(txtq(i - 1).text) 2next ib1(4) = 0for i = 1 to 4 b1(4) = b1(4) + val(txth(i - 1).text) * val(txtq(i - 1).text) 3next ib2(1) = 0for i = 1 to 4 b2

14、(1) = b2(1) + val(txtn(i - 1).text)next ib2(2) = 0for i = 1 to 4 b2(2) = b2(2) + val(txtn(i - 1).text) * val(txtq(i - 1).text)next ib2(3) = 0for i = 1 to 4 b2(3) = b2(3) + val(txtn(i - 1).text) * val(txtq(i - 1).text) 2next ib2(4) = 0for i = 1 to 4 b2(4) = b2(4) + val(txtn(i - 1).text) * val(txtq(i

15、- 1).text) 3next i for i = 1 to 4 用高斯-赛德尔迭代法计算 x(i) = 0next i do for i = 1 to 4 xk = b1(i) for j = 1 to 4 if i j then xk = xk - a(i, j) * x(j) next j xk = xk / a(i, i) c = abs(xk - x(i) x(i) = xk next i loop until c 0.0001for i = 1 to 4 y(i) = 0next i do for i = 1 to 4 yk = b2(i) for j = 1 to 4 if i

16、 j then yk = yk - a(i, j) * y(j) next j yk = yk / a(i, i) d = abs(yk - y(i) y(i) = yk next i loop until d 0 then pict.pset (g, (g * h / n / 3.6) * 0.1 + 45), vbgreen end ifnext gpict.scale (0, 60)-(750, 0)drawwidth = 1 模拟管网性能曲线for g = 0 to 750 h = s * g 2 pict.pset (g, h), vbbluenext g求单台水泵实际工作点参数di

17、m h1 as singlefor g = 0 to 750 h = x(1) + x(2) * g + x(3) * g 2 + x(4) * g 3 n = y(1) + y(2) * g + y(3) * g 2 + y(4) * g 3 h1 = s * g 2if abs(h - h1) 1 then ef = g * h / (n * 3.6) if ef 30 then msgbox 效率太低,请选择其它型号水泵 else txtoneg.text = format(g, 0.000) txtoneh.text = format(h, 0.000) txtonee.text =

18、format(g * h / (n * 3.6) * 0.1 + 45, 0.000) txtonen.text = format(y(1) + y(2) * g + y(3) * g 2 + y(4) * g 3) * 0.4, 0.000) end if exit for end ifnext gend sub(5) 模拟多台水泵并联及水泵工作点的确定:private sub cmdduo_click(index as integer) if comsl.text = 请选择 then msgbox 请选择并联水泵数量end ifif comsl.text = thenmsgbox 请选择

19、并联水泵数量end ifdim i as integer, k as integer, h1 as single, ef as single for i = 0 to 3 if comsl.text = comsl.list(i) then pict.scale (0, 60)-(750, 0) for g = 0 to 750 h = x(1) + x(2) * (g / (i + 2) + x(3) * (g / (i + 2) 2 + x(4) * (g / (i + 2) 3 n = y(1) + y(2) * (g / (i + 2) + y(3) * (g / (i + 2) 2

20、+ y(4) * (g / (i + 2) 3 drawwidth = 2 pict.pset (g, h), vbred h1 = s * g 2 if abs(h - h1) 1 then ef = g * h / (n * 3.6) if ef 30 then msgbox 效率太低,请选择其它型号水泵! else txtduog.text = format(g, 0.000) 实际工作点 txtduoh.text = format(h, 0.000) txtduoe.text = format(g * h / (n * 3.6 * (i + 2) * 0.1 + 45, 0.000)t

21、xtduon.text = format(y(1) + y(2) * (g / (i + 2) + y(3) * (g / (i + 2) 2 + y(4) * (g / (i + 2) 3) * 0.4, 0.000) end if end if next g end ifnext iend sub(6) 窗口清空及退出:private sub cmdclear_click() txtmj.text = txtzb.text = txtgs.text = txths.text = txtzl.text = txtxs.text = txtll.text = txtq(0).text = tx

22、tq(1).text = txtq(2).text = txtq(3).text = txth(0).text = txth(1).text = txth(2).text = txth(3).text = txtn(0).text = txtn(1).text = txtn(2).text = txtn(3).text = txtoneg.text = txtoneh.text = txtonee.text = txtonen.text = txtduog.text = txtduoh.text = txtduon.text = txtduoe.text = comsb.text = 请选择comsl.text = 请选择pict.picture = loadpicture()end subprivate sub cmdquit_click()endend sub5结果分析5.1 分步模拟 (1)当水泵型号选择南方td100-25/2时,水泵台数为1台,管网阻力系数为0.0000386 h2/m5曲线

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论