CVODE的一些知识点


这部分内容来自《CVODE-A Stiff_Nonstiff ODE Solver in C.pdf》《SUNDIALS-Suite of Nonlinear and Differential-Algebraic Equation Solvers.pdf》

文档有些旧,很多接口变化了,但是可以根据这些信息推测出最新的接口的一些功能

1 CVODE简介

CVODE solves ODE initial value problems in real N-space. We write such
IVP problems in the form

    y' = f(t,y),y(t0) = y0

Here we use ˙y to denote dy/dt. While we use t to denote
the independent variable, and usually this is time, it certainly need not be.
CVODE solves both stiff and nonstiff systems. Roughly speaking, stiffness is
characterized by the presence of at least one rapidly damped mode, whose time
constant is small compared to the time scale of the solution itself. (See Hairer
and Wanner [1991] for more on stiffness.)

CVODE可以用来解决stiff和non-stiff问题

CVODE支持两种方法:

  1. Adams(Adams-Moulton):variable order,varable step
  2. BDF(Backward Differentiation Formula):variable order,varable step,fixed-leading coeffcient form

2 CVodeMalloc

这个接口是用来创建m_cvode_mem,同时设置开始的t0,x0,tol等

对应过来5.8,这个接口应该是由:
CVodeCreate,CVodeInit两个接口组合而成.

3 CVode(cvode_men,tout,yout,t,itask) 执行计算的接口

计算会返回一个完成标记(就是返回值),计算的结果存储在yout里面

  1. itask参数:
    1.1 CV_NORMAL:it steps to tout,overshooting it and interpolating to get the solution at tout
CV_NORMAL模式,会从上一个计算结束的时间点开始计算,多次计算到,
直到本次请求计算的时间点稍微过一点。
比如,上一次计算的时间点是0.3,本次计算的时间点是0.4,则本次请求计算后,
求解器会从0.3开始计算,然后加一点时间,比如0.3001,再次计算,如此
迭代,直到时间到达0.4,最后将0.4d的结果返回

1.2 CV_ONE_STEP:it takes only one step towards tout and returns to the calling routine

ONE_STEP模式不要理解错,它的意思是执行一次计算,但并不是一次计算的结果
就是目标时间点的结果。
比如,从0,目标时间点是:t=0.5
你用ONE_STEP模式运行一次,它计算的结果可能是0.0001那个点的结果,你必须
不断地调用计算,最后在返回值>=t的时候,结果才是你想要的
  1. y参数:
    the calling program must also create the dependent variable vector y and load it with
    initial values

  2. t参数,感觉是返回tout

4 用户可以提供的4个函数

4.1 f: define the f(t,y):核心计算函数,通过CVodeInit设置

4.2 Jac: supplies an approximate Jacobian in direct cases(CVDENSE,CVBAND).It is optional,and default differences auotient Jac routine is avaiable if none is supplied
Jac是可选,如果没有提供择优默认的Jac.5.8通过CVodeSetJacFn设置

4.3 Precond and PSolve:Precond and PSolve: supply the preconditioner in Krylov case(CVSPGMR).These routine
are optional,but there is no default.
Precond set Jacobian-related data,and does and
matrix preprocessing needed.
PSolve solves the preconditioner linear system.
Precond和PSolve可选,没有默认。这两个函数没看到使用方法。

5 CVODE Linear Solver

线性的solver种类有:CVDENSE,CVBAND,CVDIAG,CVSPGMR

5.1 DENSE:solves dense linear systems by LU factorization and back-solving with partial pivoting

5.2 BAND solves banded linear systems by LU factorization and back-solving with partial pivoting(DENSE的banded情景)

5.3 SPGMR + ITERATIV solves arbitary linear systems by a scaled preconditioned GMRES algorithms.

6 Parallel Extension:PVODE

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值