l********1 发帖数: 13 | 1 在matlab中求解一个常微分方程组(ODEs),使用ode45时,求解速度非常的慢。
MATLAB帮助中提示如果ode45的求解速度非常慢,说明该微分方程组是stiff的,可以尝
试ode15s。
我的问题是:是什么造成了方程组出现stiff的情况? 如何避免方程组出现stiff的情
况?
请高手指点,不胜感激! |
h**********c 发帖数: 4120 | 2 singular, the rank of Jacobian is not n;
use coninuation.
AUTO
http://indy.cs.concordia.ca/auto/
it is written by my boss,
you can contact me via PM. |
l********1 发帖数: 13 | 3 多谢!
AUTO可能很好,只是它是用Fortran写的,而我的那个微分方程组(一个动态系统)是
用MATLAB写的。这么看来,我暂时还无法借用AUTO了。 |
b***e 发帖数: 38 | 4 清华徐士良的算法书里有一节是关于刚性方程的,解法叫吉尔(GILL)方法。 |
h**********c 发帖数: 4120 | 5 correction:
stiff problem:
x'=\lambda x, when Re(\lambda)-> -\infty
x could be extended to n-vector, \lambda thus could be a matrix D, thus one
of the eigenvalues of D has its real part approaches negative infinity.
This is a totally different thing from singular Jaconbian of ODEs.
Stiff problem can be attacked by stability analysis. Normally a multi-step
implicit mesh scheme should help.
Just for discussion. |
j**p 发帖数: 53 | 6 dude, good to see that you figured it out at last :-)
one
【在 h**********c 的大作中提到】 : correction: : stiff problem: : x'=\lambda x, when Re(\lambda)-> -\infty : x could be extended to n-vector, \lambda thus could be a matrix D, thus one : of the eigenvalues of D has its real part approaches negative infinity. : This is a totally different thing from singular Jaconbian of ODEs. : Stiff problem can be attacked by stability analysis. Normally a multi-step : implicit mesh scheme should help. : Just for discussion.
|
h**********c 发帖数: 4120 | 7 disdude, what is your point?
【在 j**p 的大作中提到】 : dude, good to see that you figured it out at last :-) : : one
|
l********1 发帖数: 13 | 8 What is stiffness?
A stiff ODE is an ordinary differential equation that has a transient region
whose behavior is on a different scale from that outside this transient
region. A physical example of a stiff system involves chemical reaction
rates, where typically the convergence to a final solution can be quite
rapid. |
h**********c 发帖数: 4120 | 9 I believe this is rather an explanation ; not a concrete definition or the
qualification.
I personally believe in the "transient region", during integration, at some
step the system A X= f , A is very ill-conditioned.
I did take a course covering this problem two years ago, by my supervisor.
And I happened to audit that course again this term.
The definition is as per my previous post.
region
【在 l********1 的大作中提到】 : What is stiffness? : A stiff ODE is an ordinary differential equation that has a transient region : whose behavior is on a different scale from that outside this transient : region. A physical example of a stiff system involves chemical reaction : rates, where typically the convergence to a final solution can be quite : rapid.
|
f**l 发帖数: 2041 | 10 为什么要关注这个定义呢? 关于stiff的定义可以有很多种. 但关键还是在于
数值稳定性的考虑. 你所说的都是把方程线性化之后的分析. 这些分析只是为了
给人一个直觉的基础罢了. 数学要是只关心定义, 就失去其应用的一面了.
对你的问题, 你直接用ode15s就是了. 一般用matlab来解的都不会太复杂.
ode15s是建立在BDF公式上的变阶变步长算法, 由C. W. Gear早先提出的.
如果问题比较大, 建议使用CVODE, LSODE, DASSL, DASPK等成熟的软件. 严肃的
计算一般是不用matlab搞的.
消除stiffness取决于问题. 如果你知道是什么部分导致一些变量很快地进入
动态平衡, 把这部分用代数的方法取代, 就是了. 这个具体到问题可能很复杂.
the
some
【在 h**********c 的大作中提到】 : I believe this is rather an explanation ; not a concrete definition or the : qualification. : I personally believe in the "transient region", during integration, at some : step the system A X= f , A is very ill-conditioned. : I did take a course covering this problem two years ago, by my supervisor. : And I happened to audit that course again this term. : The definition is as per my previous post. : : region
|
l********1 发帖数: 13 | 11 to fool,
ode15s我尝试过,速度一样很慢。
现在我用c编写部分程序,求解ode时采用了dassl算法,编译后在matlab下进行调用,
同其他程序部分协调进行,效果不错,速度很快:) |
f**l 发帖数: 2041 | 12 那样就是matlab本身的问题了. Matlab因为是解释执行, 总是会慢
很多的. 尤其如果你有很多循环, 以及向量不预先分配空间的话.
dassl现在已经升级为daspk了, 增加的主要是sensitivity analysis
和krylov solver, 其他的倒是差不多.
【在 l********1 的大作中提到】 : to fool, : ode15s我尝试过,速度一样很慢。 : 现在我用c编写部分程序,求解ode时采用了dassl算法,编译后在matlab下进行调用, : 同其他程序部分协调进行,效果不错,速度很快:)
|