当前位置:文档之家› Maple 建模和应用

Maple 建模和应用

第三部分: 建模和应用

CCA Inc. 2008.

3.0 内容介绍

这里,我们将使用第一部分和第二部分中介绍的技术创建一些实际应用。

Maple 在问题求解的各个环节中帮助我们:开始问题和假设,推导模型方程,求解方程,通过数值的、符号的和图形的方式检验方程。

3.1 混合问题

通过这个简单的例子,我们可以发现在如何使用Maple基础技术解决问题。

考虑一个装有溶液的容器,溶液由水和溶解杂质(盐)组成。 更多的溶液倒入倒容器中,同时水排除容器。我们想知道容器中盐浓度随时间的变化。

(2.1)

(2.2

)假定时间时,容器中盐的总量是 。 变化的速率是

这里 是容器中盐的初始浓度。

因此,我们定义方程:

(2.3)(2.7)

(2.5)(2.6)(2.4)

2.8)

图形表明:倒入容器中每立方水中的盐越多,容器中盐度也越大。

3.2 加热油气

这是一个复杂一点的问题,在这个范例中我们可以发现Maple提供了多个解决方法。

说明

油通过倒入一系列热的罐加热,这个范例显示了如何使用Maple分析类似的系统。

推导封闭方程:In particular, we will derive closed-form formulas for the transient and steady-state temperature of the oil in each tank as a function of time, in terms of the flow rate of the oil (W), the specific heat capacity of the oil (), the mass of the oil in each tank (M), the heat transfer coefficient (U), the heat transfer area (A), the temperature of the cold oil () and the temperature of the steam (

). We will also verify the dimensions of these formulas to get a quick check on the accuracy of the solution.

主要使用下列Maple技术:

模型

Below is a schematic of the heating system. Cold oil is pumped through three identical steam-heated tanks at a constant rate.

Standard texts on chemical engineering show that the temperature of the oil in each tank can be modeled by the following system of differential equations:

=

=

=

where the parameters are defined as follows:

(3.2.1.1

)

(3.2.1.2)

(3.2.1.4)

(3.2.1.3)

在Maple中输入模型

输入这个模型到Maple中,

设置初始条件。At the beginning, every tank temperature is full of cold oil.

(3.2.2.1)

(3.2.2.2

)我们看到结果有点繁琐,我们观察发现 的结果含有一个未求值的积分,我们在dsolve 加入更多的信息。对大部分线性问题而言,laplace 方法通常能够给出紧凑和显式的答案,并且永远不会返回一个隐式解。

(3.2.2.2

)

(3.2.3.1.1

)

试验结果

好的,现在我们有了公式,但是我们可以相信它吗?我们需要检验它,在这里,我们在给出一些可能的样本值去检验这个公式。

检查量纲首先,我们在问题表达式中加入正确的单位,先从答案中取出表达式:

(3.2.3.1.2)

(3.2.3.1.4)

(3.2.3.1.3)

(3.2.3.1.1

)然后,加载单位函数包 Units[Standard] 用于单位计算。

(3.2.3.1.7)

(3.2.3.1.8)

(3.2.3.1.5)

(3.2.3.1.6)定义一组样本值,

求罐中温度在这些样本值的值。

(3.2.3.2.4)

(3.2.3.2.5)

(3.2.3.2.1)

(3.2.3.2.2)

(3.2.3.2.3)

所有的温度单位是开氏温标,这是正确的。

样本的图形

我们也可以画出容器罐中温度随时间变化的图形。

First, since we want to use these expressions multiple times, it helps to give them meaningful names. We can use the context menus on the expression for above. Right-click on that result, and select Assign to a Name. In the dialog, enter sampleTank1The result looks like this

Sometimes it will be faster to simply edit the line that generated the expression in the first place, and prepend the assignment statement. This is the result:

In order to plot these expressions, we must also strip off the units. From the context menu, select Units>Remove Units. This is the sequence of commands you will see.

(3.2.3.2.7)

(3.2.3.2.9)

3.2.3.2.8)(3.2.3.2.6)

But now we need to repeat the assignment statement, if we want the result assigned to the same name.

我们可以继续使用右键菜单,或者直接使用命令。

现在我们使用命令创建图形。

35

30

25

20

15

10

0102030

t

图形看起来缺少一些重要信息,我们添加图例,和时间。

(3.2.4.1)Tank1Tank2Tank3

t 02040

608010010

2030

40

练习: 您可以继续使用右击菜单或命令操作图形和显示的信息。

从图形中,我们发现容器罐的问题随着时间的变化趋于稳定状态。

稳定状态

为了发现每个容器罐的稳定状态公式,这里,我们保留参数值为参数,寻找更一般的公式

为了寻找容器罐 1 温度随着时间的变化,我们设置时间 t 趋于无穷大。

上面的结果没有太多的使用价值,我们需要给Maple更多的信息。我们知道变量必须是正的。

(3.2.4.2)

(3.2.4.6)

(3.2.4.7)

(3.2.4.5)

(3.2.4.3)

(3.2.4.4

)

这个公式给我们理想的预测能力,现在我们知道任意数量的容器罐如何到达稳定状态,无需建立样本原型或做更多的建模。

应用

我们已经应用Maple求解了问题,最后的挑战是如何将结果应用到实际。Maple提供了大量的选项用于应用。我们在下面使用了三种方式:

使用内置工作表图元件

内置单元允许在Maple文件中插入交互式区域,这些元件可以上传到MapleNet 服务器上继续在网上交互式使用。

Custom procedures initialized

参数控制

Mass of oil in each tank

Heat transfer coefficient

Heat transfer area

Specific heat capacity

Initial temperature

Steam temperature

Steady State Temperatures

Tank 1 Tank 2Tank 3

Tank

起始时间 结束时间

Compute Temperat...作为Maplet程序使用

第二种方法,我们作为Maplet独立程序使用。它提供了一个点击式窗口界面,用户无须任何Maple命令或物理过程的理论就可以操作。

如果您希望像Maple工作表一样浏览, 点击这里运行Maplet程序 .

使用VB代码自动生成功能应用到Excel中

相关主题
文本预览
相关文档 最新文档