数值差分方法一般分为显式差分与隐式差分,对二者的区别我查阅了相关的资料。我后面发现关于二者区分不是有一些差异。如Wiki:

Explicit methodscalculate the state of a system at a later time from the state of the system at the current time, whileimplicit methodsfind a solution by solving an equation involving both the current state of the system and the later one. Mathematically, if{displaystyle Y(t)}

is the current system state and{displaystyle Y(t+Delta t)}

is the state at the later time ({displaystyle Delta t}

is a small time step), then, for an explicit method

{displaystyle Y(t+Delta t)=F(Y(t)),}

while for an implicit method one solves an equation

{displaystyle G{Big (}Y(t),Y(t+Delta t){Big )}=0qquad (1),}

to find{displaystyle Y(t+Delta t).}

下面几个链接是其它的一些讨论:

这几个讨论,认为如果下一时刻状态值,能通过当前时刻值进行直接计算,则表示显式差分,如果下一时刻状态值,不能通过当前时刻值进行直接计算,而必须求解(1)式来计算,则表示隐式差分。

这个定义似乎很简单,也容易理解,但现在有一个情况是,式(1)如果是线性的,并且通过式(1),我们能反解出Y(t+dt),使其能够写出显示差分的格式。举一个例子吧,

du/dt = f(u)where u is a vector and f is a known function. Then we may approximate the time derivative over a time step h as(implicit) u(n+1) = u(n) + h.f(u(n+1))

if f(u) = Au where A is a constant, then u(n+1)=u(n)+Ahu(n+1),then, u(n+1)=u(n)/(1-Ah)

这种情况下,差分方法是显式还是隐式呢? 本质上我们也求解方程(1), 但是我们得到了显示格式。

后面我又查了相关的资料,如:

这里认为:When a direct computation of the dependent variables can be made in terms of known quantities, the computation is said to be explicit. When the dependent variables are defined by coupled sets of equations, and either a matrix or iterative technique is needed to obtain the solution, the numerical method is said to be implicit.

根据这个理解,如果待求的值,能用已知的(已经计算的)值直接计算出来,则表示显式差分,相反,则表示隐式差分。

如下面的例子,我们计算某一位置某一时刻的值时,不仅用到了前一时刻的信息,也用到了当前时刻的信息,最后通反求解的方式,得到计算值,然而此类差分仍然属于显式差分。

另外一个定义:The idea behind theexplicit methodis to be able to obtain values such asyi+1= f(xi, yi), yi+2= f(xi,xi+1,yi,yi+1), etc.In other words, your solution proceeds by solving explicitly for a new unknown value inthe solution array, given all previous values in the array. On the other hand,implicitmethodsimply the simultaneous solution ofnlinear algebraic equations that provide, atonce, the elements of the solution array.

对于隐式差分,我有个例子

在上面的式子中,我们并不能直接求解出yi,这时候需要更多的方程来求解,这些方程可以写成矩阵来求解。

关于两者的Advantage与Disadvantage,应该比较清楚,前者速率快,但是本质上是conditionally stable,当dt较大,精度就会受到限制;而后者是unconditionally stable,但是计算效率低。

In finite-difference methods, calculations are performed on a grid placed over the interesting flow domain into the x-t plane. This computational grid is defined by some equal or variable space and time steps, Δx andΔt, respectively. A network of discrete points is thus obtained and the flow variables Q, z (or Q, h; V, z; V, h) are derived only for this finite number of grid points. Figure 6.2 shows a typical computational grid. The spatial positions of the grid points are denoted by index jand the time moments by indexi.

Figure 6.2. Finite-difference computational grid.

As principle, finite-difference methods transform governing partial differential equations into a set of algebraic (linear or nonlinear) finite-difference equations, which are solved to allow the values of flow variables in a grid point or in all grid points on a time line. These finite-difference equations are derived by approximating the time and space derivatives with some finite-difference expressions. Not only the derivatives, but also the other terms into the Saint-Vénant equations must be defined in a certain manner.

Concerning the space derivative of a continuous function f(x,t) at time momentti and space positionxjon the grid in Figure 6.2, this can be approximated as: a forward difference approximation;

a backward difference relationship;

a central difference expression,(6.29)

in whichfji represents the value of f at grid point (xj,ti).

In an analogous manner, the time derivative may be defined in several different ways as, for example:;

(6.30)

Usually, the value of the function f(x,t) is accepted at grid point (xj,ti) as fji , but some different approximations can also be decided.

A finite difference method must employ a certain type of finite-difference scheme. These schemes are grouped in two major classes: explicit and implicit finite-difference schemes.

Explicit schemes are those in which the flow variables at any point j and time level i+1 may be computed using only known data at a few adjacent points on the time line i. These schemes do not lead to a system of algebraic equations, but rather to only two finite difference equations for each grid point (xj,ti+1). By solving the two equations the unknown values of flow variables are obtained and then, the computation proceeds to the next grid point along the time line i+1.

In implicit schemes, finite-difference expressions used to approximate the space and/or time derivatives at grid point (xj, ti+1) include the unknown values of flow variables at a few adjacent points on the time line i+1. Consequently, a system of algebraic equations is produced for a given time line i+1 and by solving this system, all unknown values are simultaneously determined at time level i+1.

Replacing the continuous original problem with an integration over a discrete computational grid introduces numerical errors into the results. A finite-difference scheme is stable if such errors are not amplified during computation from one time level to the next. The numerical stability depends on the size of the time and space steps and on some flow characteristics. The Courant condition:(6.31)

is a necessary but insufficient condition for stability of an explicit scheme.

Therefore, any explicit scheme is conditionally stable, the Courant condition requiring to work with small time steps as compared with the physical phenomena evolution. Despite their computational simplicity, the explicit methods are seldom used in river modelling for reasons of this stability restriction.

On the other hand, the implicit schemes may appear more complicated, but can generally be made unconditionally stable for large computation steps and with little loss of accuracy.

Another distinction among schemes belonging to the same class is related to the way in which the non derivative terms (such as Sf(Q,h), B(h), A(h) etc.) are discretized. Because these terms are functions of dependent variables, their treatment induces a linear or nonlinear feature of the finite-difference equations.

A lot of finite-difference schemes will be presented in more details within the next sections.

Numerical solution of kinematic wave model

First form (6.21) of the kinematic wave model is used to illustrate an explicit linear scheme on a finite-difference cell as show in Figure 6.4.

A backward finite-difference is used to approximate the space derivative, while the time derivative is usually expressed at the samexj+1 spatial position. In order to obtain a linear scheme, the nonderivative term αβQβ-1 must be evaluated for a known Q value, which here is accepted as mean between the two diagonal valuesQji+1 and Qij+1.

Figure 6.4. Finite-difference cell for linear kinematic wave solution.

Consequently, the finite-difference form of equation 6.21 is:(6.40)

and the unknown Qj+1i+1results as:(6.41)

Starting with the inflow hydrograph value Q at the time level ti+1, the computation sequentially proceeds from upstream towards downstream grid points, along the current time linei+1.

However, this scheme supposes that within the coefficient α, the wetted perimeterP remains constant. On the other hand, by using Q instead of A into the time derivative∂A/∂t, relative computational errors are decreased. Indeed, taking the logarithm of equation 6.20, i.e.

,

and differentiating, one obtains:

,

where β is 0.6 for the Manning's equation. It follows that the estimation error in Q would be magnified by 1/0.6 ≈ 1.67 if the cross-sectional area A is used as dependent variable.

来自另外一本书:Chow, E.A., Applied hydrology. 1988.

A finite-difference method may employ either an explicit schemeor an implicit schemefor solution. The main difference between the two is that in theexplicit method, the unknown values are solvedsequentiallyalong a time linefrom one distance point to the next, while in the implicit method the unknownvalueson a given time line are all determinedsimultaneously.The explicit method is simpler but can be unstable, which means that small values of Axand A^ are required for convergence of the numerical procedure.

综合上面的分析,对于PDE,如果在某个待求得时间点上,各位置(from upper to down)的值能够被依次直接求解的情况,认为是显示差分;而如果某个待求得时间点上,各位置的值必须同时联立起来求解,应该是隐式差分。

转载本文请联系原作者获取授权,同时请注明本文来自张凌科学网博客。

链接地址:http://blog.sciencenet.cn/blog-922140-995390.html

上一篇:C语言与MATLAB对二进制文件与ASCII文件转换

下一篇:截断误差与舍入误差

隐式差分方程c语言,科学网—显式与隐式差分 - 张凌的博文相关推荐

  1. 改进euler方法 c语言,科学网—计算方法:Euler法及其改进 - 张江敏的博文

    考虑常微分方程 欧拉曾给过一个算法,这个算法是所有数值求解常微分方程的算法中最简单最直观的.即 这个算法可以想象精度非常差.这点可以通过考虑一类特殊情况非常明显地看到.假设f仅是x的函数,这时方程可以 ...

  2. matlab求cos角,科学网—MATLAB求太阳高度角的小程序 - 张乐乐的博文

    参考链接:http://bbs.06climate.com/forum.php?mod=viewthread&tid=36366 代码部分: function HSI=calHSI(year, ...

  3. mh采样算法推导_科学网—MCMC中的Metropolis Hastings抽样法 - 张金龙的博文

    Metropolis Hastings抽样法示例 jinlongzhang01@gmail.com Metropolis Hasting(下面简称MH)是蒙特卡罗马尔科夫链中一种重要的抽样方法.本文简 ...

  4. 生信软件c语言,科学网—[转载]没有docker我真的不想动这样的生信软件 - 张成岗的博文...

    没有docker我真的不想动这样的生信软件 2020-03-26阅读 2620 C语言源代码需要编译的软件 最开始开发者都是C语言流派, 所以标准的源代码安装三部曲即可,即使 configure+ma ...

  5. 1071svm函数 r语言,科学网—R中的svm - 吴锐的博文

    svm理解: LSSVM: 最小二乘支持向量机(Least squares support vector Maehine,LSSVM)是SVM的一种变体,把问题转化成对一个 线性方程求解,所需计算资源 ...

  6. r语言plotmds_科学网—在R中运行metaMDS - 梅卫平的博文

    中英文混合版. Function metaMDS performs Nonmetric Multidimensional Scaling (NMDS), and tries to find a sta ...

  7. r语言算巢式设计方差分析_科学网—巢式设计之R篇 - 林元震的博文

    巢式设计(Nested design),也称为嵌套设计或系统分组设计.把研究对象分成若干组,每组内又分若干亚组,每个亚组又有若干观测值的设计,称为巢式设计.根据因素数的不同,巢式设计可分为二因素(二级 ...

  8. matlab中text竖着写,科学网—matlab中text函数的用法 - 张瑞龙的博文

    text(x,y,'string')在图形中指定的位置(x,y)上显示字符串string. text(x,y,z,'string'.'PropertyName',PropertyValue„)对引号中 ...

  9. 数学怎样用计算机上,科学网—数学软件——计算机上的数学 - 王东明的博文

    著名数学家吴文俊先生曾预言:"在不久的将来,电子计算机之于数学家,势将如显微镜之于生物学家,望远镜之于天文学家那样不可或缺."如今这个预言已成为现实,计算机的应用已深入到自然科学的 ...

  10. Java对象的两大特征_科学网—Java 面向对象的四个特征 - 李玖栋的博文

    1.抽象: 抽象--就是忽略一个主题中与当前目标无关的那些方面,以便更充分地注意与当前目标有关的方面.(就是把现实世界中的某一类东西,提取出来,用程序代码表示,抽象出来一般叫做类或者接口.)抽象并不打 ...

最新文章

  1. 解读微软开源MMLSpark:统一的大规模机器学习生态系统
  2. 实时检测神经振荡可实现行为相关的神经反馈
  3. React Native 的顶部导航栏和底部导航栏目
  4. js 两行之间的设置间距_防火间距
  5. Cluster模式潜在问题及解决方案、Web服务综合解决方案
  6. jmeter的几种参数化使用方法
  7. python复数类型及其特点_二级Python语言程序设计分类模拟4
  8. Objective--C的Foundation frame之NSMutableDictionary代码
  9. python经典程序-python经典趣味24点游戏程序设计
  10. matlab 计算图像的基本参数
  11. Linux 复制文件
  12. springcloud整合bus
  13. Python爬虫——爬去必应壁纸(简化版)
  14. 【报告分享】小红书品牌营销手册2021-小红书(附下载)
  15. 微信3.1.0.58逆向-微信3.1.0.58HOOK接口说明(WeChatHelper.dll)-获取当前聊天微信ID
  16. 运维之阿里云和本地虚拟机的连接问题
  17. 这个vue3的应用框架你学习了吗?
  18. Linux文件和目录管理(2)
  19. 中华英才网爬虫程序解析(4)-分布式爬虫redis
  20. java基础学习-多线程笔记

热门文章

  1. MySQL安装图解设置详细教程
  2. Linux man --显示在线手册页
  3. Resin下配置JSP虚拟主机
  4. 气象大数据平台(天擎)数据读取方法(python)(地面资料下载)
  5. 参加IBM武汉分公司10周年庆
  6. 江苏高考时间2021成绩查询,小高考时间2021具体时间江苏-江苏小高考成绩查询公布时间及网站...
  7. 霍金实在论中的实践论
  8. 听说掌握这些利器,运维就能运筹帷幄
  9. linux 安装xz,在Ubuntu 18.04 LTS下安装linux-5.0.8.tar.xz的方法
  10. java 扫描仪_Java调用扫描仪2