找回密码
 [加入论坛]
查看: 1582|回复: 2

求助:大哥大姐们帮小弟看下,逐板计算精馏塔板数程序哪里出问题了```

[复制链接]
whywang84 发表于 2007-5-26 11:11 | 显示全部楼层 |阅读模式
<div style="ADDING-RIGHT: 0px; MARGIN-TOP: 10px; FONT-SIZE: 9pt; OVERFLOW-X: hidden; WIDTH: 97%; WORD-BREAK: break-all; TEXT-INDENT: 0px; LINE-HEIGHT: 1.5; HEIGHT: 200px; WORD-WRAP: break-word;"><p>Private Function Wz(xq As Single, R As Single, XD As Single)<br/>Dim n As Integer, x() As Single, y() As Single<br/>ReDim Preserve y(1)<br/>y(1) = XD<br/>n = 0<br/>&nbsp;Do<br/>&nbsp;&nbsp; n = n + 1<br/>&nbsp;&nbsp;&nbsp; If n &gt; 10 ^ 2 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "这样的n值过大,程序将崩溃,请检查常数值"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Do<br/>&nbsp;&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp; ReDim Preserve x(n + 1)<br/>&nbsp;&nbsp;&nbsp; ReDim Preserve y(n + 1)<br/>&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; x(n) = 0.061 * y(n) / (0.714 - y(n))<br/>&nbsp;&nbsp;&nbsp; y(n + 1) = R * x(n) / (1 + R) + XD / (1 + R)<br/>&nbsp;&nbsp;&nbsp; If x(n) &gt;= 0.4 Then<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; x(n) = 0.445 * Log((y(n) - 0.496) / 0.388) + 0.884<br/>&nbsp;&nbsp;&nbsp; y(n + 1) = R * x(n) / (1 + R) + XD / (1 + R)<br/>&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp; Loop Until x(n) &lt;= xq<br/>&nbsp;&nbsp;&nbsp; Wz = x(n)</p><p>End Function<br/>&nbsp; <br/>Private Function mN(XW As Single, w1 As Single, W As Single, q As Single, L As Single, F As Single)<br/>Dim m As Integer, x() As Single, y() As Single<br/>ReDim Preserve x(1)<br/>x(1) = w1<br/>m = 0<br/>&nbsp;Do<br/>&nbsp;&nbsp; m = m + 1<br/>&nbsp;&nbsp;&nbsp; If m &gt; 10 ^ 2 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "这样的m值过大,程序将崩溃,请检查常数值"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Do<br/>&nbsp;&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp; ReDim Preserve x(m + 1)<br/>&nbsp;&nbsp;&nbsp; ReDim Preserve y(m + 1)<br/>&nbsp;&nbsp;&nbsp; y(m + 1) = (L + q * F) * x(m) / (L + q * F - W) - W * XW / (L + q * F - W)<br/>&nbsp;&nbsp;&nbsp; x(m) = 0.061 * y(m) / (0.714 - y(m))<br/>&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; If x(m) &gt;= 0.4 Then<br/>&nbsp;&nbsp;&nbsp; y(m + 1) = (L + q * F) * x(m) / (L + q * F - W) - W * XW / (L + q * F - W)<br/>&nbsp;&nbsp;&nbsp; x(m) = 0.445 * Log((y(m) - 0.496) / 0.388) + 0.884<br/>&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp; Loop Until x(m) &lt;= XW<br/>&nbsp; mN = m<br/>&nbsp;<br/>End Function</p><p>我把参数值带进去,好象没迭代几下,塔板数都是2块三块的,xq=0.3,R=4,XD=0.88</p><p>不知道哪里出问题了</p><p>哪位大哥有用vb写的逐板计算代码呀??</p></div>
飘叶highfly 发表于 2008-6-8 15:26 | 显示全部楼层

hehe

shi cuole
回复 顶 踩

使用道具 举报

upca 发表于 2008-6-9 11:45 | 显示全部楼层
这是一个VB程序!
最好把编写的原始程序的目录打一个包发上来,大家一起研究!
回复 顶 踩

使用道具 举报

您需要登录后才可以回帖 登录 | [加入论坛]

本版积分规则

手机版|化工技术网- 赠人玫瑰 手有余香 ( 苏ICP备14035884号 )

GMT+8, 2026-12-1 21:25

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表