
三次样条插值函数在化工工艺
计算中的应用
霍 健
唐介汾 黄丽珍 和享太 太原化工厂 太原 030021
摘要 探讨三次样条插值函数在化工工艺设计计算中的应用,并提出应注意的问题。关键词 MathCAD7.0 三次样条插值函数 化工工艺计算
1 概述
插值函数方法的基本思想是构造某个函数,作为原函数的近似表达式,通过计算这个近似表达式的值得到研究对象的近似值。目前,常用的插值方法有拉格朗日插值、埃特金插值、爱尔米特插值。上述插值方法虽然能保证插值曲线各个分段是互相衔接的,但在节点处不能保证曲线的光滑性。而样条插值法在上述插值方法的基础上大大提高了总体的光滑度,更加接近原函数。因此,近年来样条插值函数的应用日益广泛[1]。
三次样条插值函数基本原理是在每个分段构造一个三次多项式S(t),对于数据点X(i),Y (i),(i=0,1,2, ,n)定义插值函数,满足下列条件[2]:
(1)在所有节点上函数值满足 S(t i)=Y i i=1,2, ,n;
(2)在内节点i=1,2, ,n-1 上有直到二阶导数的连续性。即S(t i),S(t i),S!(t i)连续;
(3)已知端点的二阶导数。
可以看出,以上问题有唯一解。三次多项式有4个待定系数,N个子区间共有4∀N个待定系数。而三个条件结合起来的条件数:
(n+1)+3#(n-1)+2=4#n
实际应用中,端点的二阶导数较难计算。为了便于计算MathCAD7.0,将端点的二阶导数进行了必要的处理:∃端点的二阶导数为零;%端点的二阶导数与紧近邻的二阶导数相等;&端点的二阶导数是近邻与次近邻二阶导数的线性外插。笔者曾对本文4个例子不同边界条件时绘制曲线,除个别情况下端点与紧近邻点区间曲线略有差异(最大偏差<0.1),其它区间完全吻合。本文取端点的二阶导数为零,总体上不会影响计算的精度。
MathCAD7.0是一个数学软件,提供了丰富的函数库,并涵盖从普通数学、高等数学、概率和线性分析等领域。MathCAD7.0的插值方法包括拉格朗日插值、样条插值等。其中三次样条插值函数可用M++语言编写。
w(t):=C∋C
x∋C(0)
y∋C(1)
n∋rows(C)-1
vsl∋lspline(x,y)
p∋interp(vsl,x,y,
t)
p
将矩阵C赋值予C
第0列用矢量X表示
第1列用矢量Y表示
矢量vs l返回节点的二级导数
返回样条函数值
2 应用
2 1 计算物料的性质
在化工工艺设计计算中(换热器设计、固定床反应器设计),物料的性质(如密度、蒸汽压、粘度、表面张力等)随温度、压力而变化。通常先查表,然后采用内插法求出数值,但准确度不高,又不适用于计算机计算。如用数学表达式计算,又需构造函数,往往费时、难度也大。然而,采用样条插值函数,问题就简单多了。
2 1 1 环己酮饱和蒸汽压的计算
绝大多数有机物饱和蒸汽压都能按半经验公式安托尼方程计算,但环己酮的饱和蒸汽压比较特殊,在较宽温度范围内很难拟合成安托尼方程。为此,我们调用样条插值函数求取。根据有关资料[3],查出环己酮饱和蒸汽压P(kPa)与温度t (∗)的关系。用矩阵C表示(为了方便取转置,
7
2000,10(4) 霍 健等 三次样条插值函数在化工工艺计算中的应用 霍 健:工程师,1985年毕业于太原理工大学高分子工艺合成专业。主要从事技术工作。联系电话:(0351)6073739。
下同)。
C :=
1.4
26.4
38.7
52.5
67.8
77.5
90.4
110.3132.5155.6
0.1330.666
1.333
2.6665.333
8
13.3326.6653.33101.3
T t P
调用样条插值函数子程序,绘制曲线图见图1。
图1 环己酮的饱和蒸汽压与温度关系图
如计算t =103∗下环己酮的饱和蒸汽压,由p =p(t),得p =20.948。2 1 2 液体苯密度的计算
液体物质密度与温度关系的数学表达式,有关手册及资料均未介绍。大体说随着温度升高,密度逐渐降低。根据+石油化工基础数据手册,[4]
查出苯密度 (kg /m 3)与温度t(∗)的关系如下。
C :=
10
20
30
40
50
60
70
80
90
100
887.3877.4
867.5857.3847836.6825.7815.0803.9792.5
T t
调用样条插值函数子程序,绘制曲线图见图2。
图2 液体苯的密度与温度关系图
有关计算某一点温度下密度的值与前例相同,在此不再赘述。
2 2 关联图
化工工艺设计计算中,经常要查一些关联图,使用起来很不方便。为此,选取若干关键节点生成样条插值函数。这样不需要复杂数学推理运算就生成接近原函数的插值函数,便于在计算机中运算。2 2 1 吉利兰关联图
在精馏塔塔板数的计算中,经常需要查吉利兰
关联图[5]。为此,我们选取若干数据,生成矩阵C 。
RG =
R -RM
R +1其中R 、RM 为实际回流比及理论最小回流比。
SG =
S -SM S +1
其中S 、SM 为理论塔板数及最小理论塔板数。
C:=
0.010.020.040.10.2
0.4
0.6
1
0.680.65
0.6
0.53
0.450.320.20.018
T
RG
SG
调用样条插值函数子程序,绘制曲线图见图3。
图3 吉利兰关联图
由此,对于精馏塔塔板的计算,不必再查吉利兰关联图而直接调用样条插值函数子程序即可计算。2 2 2 NaOH 水溶液粘度的计算
NaOH 水溶液粘度是温度与其质量分数的函数。一般先固定温度研究粘度与质量分数的关系,绘制成图。我们从NaOH 水溶液粘度图[6]
,选取若干数据生成矩阵C 。
C:=
010*********
1.74.3
13
32650.8
1.4
3.38.820370.470.811.63.3
6
9.10.280.46
0.81.32.1
3
T
NaO H 水溶液质量分数20∗N aO H 水溶液的粘度30∗N aO H 水溶液的粘度60∗N aO H 水溶液的粘度100∗NaO H 水溶液的粘度
调用样条插值函数子程序,绘制曲线图见图4。
图4 NaO H 水溶液粘度曲线图
∃、%为20∗、30∗下NaOH 水溶液粘度曲线&、−为60∗、100∗下NaOH 水溶液粘度曲线
8 CHEMIC AL E NGINEERING DESIGN 化工设计2000,10(4)
如计算温度t =30∗,质量分数w =24.5%时的粘度,则调用t =30∗的样条插值函数计算
0:= (24.5,2)=5.191
如计算温度t =23.6∗、质量分数w =24 5%时的粘度,则采用内插法,将t =20∗和t =30∗、NaOH 质量分数w =24.5%时的粘度分成10等分,然后计算t =23.6∗时的粘度。
t:=23.6 w:=24.5
1:= (w,1)- (w,1)- (w,2)
10(t -20)=6.508其中 (w,1)、 (w,2)为NaO H 质量分数w =24.5%、温度为t =20∗和t =30∗时的粘度。本文为了说明样条插值函数的应用,只选取4组数据,实际应用中可以选用全部数据,生成6∀10矩阵。
3 结语
由于样条插值函数在各个分段的衔接处能保持一定程度的光滑性,在现代工业生产和科学实验中得到了广泛应用。本文只对三次样条插值函数在化工工艺设计计算的应用,作一肤浅的介绍。为了说明问题绘制一些图形,实际应用中完全没有必要绘制图形,只需调用样条插值函数子程序便可。但使用此法时,应注意以下问题:
(1)三次样条插值函数只在插值范围内有效,任何企图外推数值都会使数值失真。
(2)三次样条插值函数的构造关键在节点的选择。节点的选择好坏直接关系到与原函数的接近程度。一般节点取极值点、拐点或端点。
(3)构造三次样条插值函数不需考虑原函数的具体数学表达式,这样可使问题简化。
(4)原函数出现不连续断点的情况下,可以考虑分段进行样条插值。
(5)边界条件不同时,三次样条插值曲线有时出现端点与紧邻点区间曲线较大差异,这时,在端点与紧近邻区间增加一个节点可大大改善曲线的吻合程度。
参
考
文
献
1 王林,张小卫.微型计算机算法与程序.上海科学技术
文献出版社,1985
2 纪哲锐.Ma thCAD PLU S 6.0快速入门及应用.清华大
学出版社,1998
3 +己内酰胺生产及应用,编写组.己内酰胺生产及应
用.烃加工出版社,1988
4 卢焕章等.石油化工基础数据手册.化学工业出版社
5 上海化工学院,天津大学,浙江大学.化学工程.第二
册.化学工业出版社,1981
6 上海医药设计院.化工工艺设计手册.化学工业出版
社,1986
(修改回稿 2000-05-06)建设部文件
建标[2000]46号
关于发布国家标准+消防通信指挥系统设计规范,的通知
各有关部门,各省、自治区、直辖市建委(建设厅)、有关省计委,计划单列市建委,生产建设兵团:
根据我部+关于印发一九九七年工程建设国家标准制订、修订计划的通知,(建标[1997]108号)的要求,由会同有关部门共同制订的+消防通信指挥系统设计规范,,经有关部门会审,批准为强制性国家标准,编号为GB 50313-2000,自2000年8月1日起施行。
本规范由负责管理,沈阳消防科学研究所负责具体解释工作,建设部标准定额研究所组织中国计划出版社出版发行。
中华人民共和国建设部二000年二月二十二日
92000,10(4) 霍 健等 三次样条插值函数在化工工艺计算中的应用
New Development of Nitric
Acid and Nitrate Production
Tang Wenqian
(Chemical Plannin g Design I nstitute o f
Shandon g Province,Jinan250013)
This article summarizes the mai n technical achievements of ni tric acid and nitrate i ndustrial producti on in recent China,such as tail gas treatment of ni tric acid and the application of regular packings as well as the direct production technology of nitrate. Key words ni tric acid nitrate technical achievements
Application of Cubic Spline Interpolating
Function in C hemical Process
Huo Jian,et al
(Taiyuan Chemical Plant,Taiyuan030021)
This paper introduces the application of cubic spli ne interpolat ing function in chemical process design and calculation,and points out the precautions for application.
Key words M athCAD7.0 cubic spline interpolating func ti on chemical process calculation
Application of Titanium in100kt/a
Membrane C austic Soda Equipment
Shen Minmin
(Shan ghai Engineering Chemical Design
Institute,Shan ghai200233)
This article analyzes and discusses the characteristics of ti tani um equipment and i ts application features,introduces the design, manufacture,inspection and application of equip ment for100k t/ a membrane caustic soda unit.
Key words titanium equipment membrane caustic soda
Vibration Analysis and M odification M easures
for Piping of Reciprocating Pum p
Zhang Hongjuan
(Jinling Petrochemica l Design I nstitute,
Nan j ing250042)
The au thor anlyzes the causes of vibration created in pipin g system of reciprocating pump.Raises the vibration eliminatin g measures based on modification practice and vibration analysis calculation.
Key words reciprocating pump vi bration of pipeline system fluid pulse air chamber
Discussion on Development Trend of Process
C ontrol Technology for Amm onia Unit
Tong Qiujie
(Chen gda Chemica l Engineering Corporation
of China,Chengdu610041)
This paper discusses the current si tuation of process control for ammonia plant using natural gas as feedstock,and points out the difference of control level between China and foreign countries, analyzes the reasons of the said difference and explains the devel op ment trend of process control technologies for ammonia plant. Key words ammonia plan t process control development trend
Differential Protection for Large Motor
Wan g Jiling
(Tian j ing Tianchen g Chemica l Enginee rin g
Corp oration,Tianjing300400) The author,takes6kv motor as an example,introduces two kinds of differential protecti on method normally used for motors, and poi nts out the resolving scheme for possible troubles.
Key words motor differential protection scheme
Integral Stability C alculation
for Frame Construction
Yu Shenge
(Shan ghai En gineering Chemical Design
Institute,Shanghai200233)
This author,takes the si mple frame construction as an exam ple,introduces how to analyze stability of the construction from the integral view.Through analysis and calculation,derived the relationship between external load and integral stability of the construction.
Key words frame constructi on integral stability
Design of LPG Refill Station for Vehicle
Sun Hongbo,et al
(Jilin Chemcial Engineerin g Corporation,Jilin132021)
This paper introduces the location selection,volume of s torage tank,set up concept,accessories arrangement,auxiliary facili ties arrangement,safety and fire-figh ting issues of the LPG refill station for vehicle.
Key words LPG refill station for vehicle design
Theory and Application of M aterial
C irculation Methodology
Li Yuqiang
(Huanqiu Chemical En gineering Corporation
of China,Beijin g100029)
This paper in troduces material circulati on methodology,consti tution of material circulation,material circulation fee and materi al circulati on of the enterprises,etc..Points out that the material circulation system quantized analysis should be the important ba sis for the policy decision of enterprise.s overall layou t and de sign,and the important contents of area planning and project plot plan design.
Key words overall engineering material circulation methodology theory application
Current Situation and Demand Prediction o f
China.s Ethylene Production
Gu Rao
(Shangha i Chlor alkali Chemical Co.,
Ltd.,Shanghai200241)
This paper describes the curren t si tuation of production and demands of ethylene and make a demand and supply prediction, raises the suggestions for development of ethylene industry in China.
Key words ethylene production predicti on of demands and supply suggestion
D iscussion on Commodity&Inventory
Management and Control of Petrochemical
Lump Sum Turn key Contract
Chen Bohua,et al
(Bei j ing Petrochemical Engineering Corp o f
China Nationa l Petrochemical Co.,Beijin g100101)
This paper introduces the i mportance of commodity&i nventory management and con trol for a lump sum turn-key contract and i ts practical operation.
Key words petrochemical lump sum turn key project com modi ty&inven tory managemen t
1
2000,10(4) AB STRAC TS OF C HE MICAL ENGINEERING DESIGN
