SUNDIAL
文章平均质量分 53
记录一些关于SUNDIAL库的东西
Feisy
more virtualization,more automation,more intelligent
展开
-
cvode-不收敛与min step的问题
https://groups.google.com/g/sundials-users/c/AFjXpOtdmME/m/jmIPhD-rBQAJQuestion:Hi there,before using CVODE I was writing single-step, implicit solvers withvariable time steps. And depending on the convergence criteria thetime step could get very s原创 2022-03-22 20:51:05 · 771 阅读 · 0 评论 -
ARKODE解读
来自《ark_guide.pdf》对于ODE,M是I,PDF,则是a well-conditioned mass matrix,模拟过程中保持不变积分的时间采用的是多阶时间插值法,最高可以去到5阶,这个参数可以由用户设置,比如ARKStepSetDenseOrder下面是阶数为0-3时的插值公式fE部分,使用显式积分,针对系统nonstiff部分fI部分,采用隐式积分,针对系统的stiff部分ARKODE分为三种类型:ImEx, explicit, and implicit原创 2022-03-21 10:53:55 · 274 阅读 · 0 评论 -
ArkOde的6种创建方法
原创 2022-03-20 14:51:34 · 259 阅读 · 0 评论 -
SUNDIALS例子:3D brusselator模型的模拟
问题背景:brusselator模型The Brusselator is a theoretical model for a type of autocatalytic reactionbrusselator模型是一种可以用来评估催化反应的理论模型下面的资料来自wiki:https://en.wikipedia.org/wiki/Brusselator3D brusselator模型假设有们有3D的brusselator模型,𝑌 = [𝑢, 𝑣, 𝑤],它的ODE方程如下:在不同的u0原创 2022-03-16 16:10:10 · 444 阅读 · 0 评论 -
OdeInt的stepper列表
Stepper overviewTable 1.6. Stepper Algorithms Algorithm Class ..原创 2022-03-16 09:38:32 · 175 阅读 · 0 评论 -
CVODE的cvDiurnal_kry例子学习
This program solves the semi-discretized form of a pair of kinetics-advection-diffusion partial differential equations, which represent a simplified model for the transport, production,and loss of ozone and the oxygen singlet in the upper atmosphere. The原创 2022-03-14 05:01:50 · 658 阅读 · 0 评论 -
CVODE中雅可比的影响
基于cvRoberts_dns那个例子进行测试发现:没有提供Jac的情况下速度更快一点。有提供Jac:At t = 2.6391e-01 y = 9.899653e-01 3.470564e-05 1.000000e-02 rootsfound[] = 0 1At t = 4.0000e-01 y = 9.851641e-01 3.386242e-05 1.480205e-02At t = 4.0000e+00 y =原创 2022-03-14 04:48:30 · 419 阅读 · 0 评论 -
CVODE用户手册解读
本文来自:cv_guide.pdf2.1 IVP solutionThe methods used in cvode are variable-order, variable-step multistep methods, based on formulasof the formCVODE使用的是变阶,变步长的多步迭代方法,最基本的形式是2.2nonstiff 问题,使用Adms迭代方法stiff问题,使用BDF方法。2.2中,an一开始是等于-1,这个值很大,会导致误差很大。这也是为什么原创 2022-03-13 23:51:43 · 696 阅读 · 0 评论 -
sundials中step size和atol,rtol的关系
https://press3.mcs.anl.gov/atpesc/files/2021/08/ATPESC-2021-Track-5-Talk-4C-Reynolds-TimeIntegrationSUNDIALS.pdferror ,step size,atol,rtol由此可见,如果atorl,rtol设置得足够大,则同样的误差,也可以通过原创 2022-03-13 23:19:30 · 164 阅读 · 0 评论 -
sundials中explicit,implicit方法的特点
Explicit Methodseasy to conceptualizeeasy to codeno algebraic solvers required− stability limits on step sizes− tracks fastest dynamicsImplicit Methodsless/nonexistent stability limitssteps over fastest dynamics− requires algebraic solvers− s原创 2022-03-13 23:05:28 · 203 阅读 · 0 评论 -
sundials公开的论文汇总以及5.8代码
sundials代码以及资料原创 2022-03-10 12:13:00 · 156 阅读 · 0 评论 -
官方建议的ARKODE编程步骤
Initialize parallel or multi-threaded environment, if appropriate.For example, call MPI_Init to initialize MPI if used, or set num_threads, the number of threads to usewithin the threaded vector functions, if used.Set problem dimensions, etc.This g.原创 2022-03-10 11:13:38 · 242 阅读 · 0 评论 -
ARKODE的错误码
ARKODE共享的返回值含义ARK_SUCCESS (0): Successful function return.ARK_TSTOP_RETURN (1): ARKode succeeded by reachign the specified stopping point.ARK_ROOT_RETURN (2): ARKode succeeded and found one more more roots.ARK_WARNING (99): ARKode succeeded but an unus原创 2022-03-10 10:54:50 · 162 阅读 · 0 评论 -
sundials中的ATOL,RTOL
General advice on choice of tolerances. For many users, the appropriate choices for tolerancevalues in reltol and abstol are a concern. The following pieces of advice are relevant.The scalar relative tolerance reltol is to be set to control relative er原创 2022-03-10 09:36:27 · 187 阅读 · 0 评论 -
sundials中的定步长存在的问题
以ARK为例,定步长的方法是调用ERKStepSetFixedStep。官方对这个接口是这样描述的:Use of this function is not recommended, since we it gives no assurance of the validity of the computed solutions. It is primarily provided for code-to-code verification testing purposes.意思是强烈建议不要使用该接口原创 2022-03-09 11:13:13 · 154 阅读 · 0 评论 -
SUNDIALS中的RTOL和ATOL
Relative tolerance (RTOL) controls local error relative to the size of the solution— RTOL = 10-4 means that errors are controlled to 0.01%Absolute tolerances (ATOL) control error when a solution component may be small— Ex: solution starting at a nonzero.原创 2021-11-06 23:50:49 · 585 阅读 · 0 评论 -
sundias的Usage Notes
原文链接On the integration return and output timesAll SUNDIALS integrators (CVODE, CVODES, ARKode, IDA, IDAS) can be used in one of two main modes: normal and one step. Before defining the various relevant terms and describing the behavior and use of the in原创 2021-11-03 11:54:42 · 267 阅读 · 0 评论 -
关于ubuntu下sundials报undefined symbol CVodeSVtolerances的问题
这个问题的原因是我第一个加的库的链接就是sundials通过ldd -r 查看目标文件,nm -A | grep CVodeSVtolerances 查看libsundials_cvode.a文件我将sundials作为最后一个链接就解决这个问题。有点莫名其妙原创 2021-11-02 16:04:42 · 119 阅读 · 0 评论 -
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 suchIVP pro.原创 2021-11-02 12:19:30 · 943 阅读 · 0 评论 -
SUNDIALS的C++使用例子
SUNDIALS的C++使用例子本例子基于cvAdvDiff_bnd.c改造。可以作为sundials使用的模板特点回调的函数是类的静态成员函数。不能够是成员函数,因为接口需要的是函数指针,而成员函数需要对象.可以支持不需要jac起始时间可以是任意时间,更改T0的值,以及main.cpp的迭代起始值即可测试的结果和原始代码一致##头文件#ifndef CV_ADV_DIFF_BND_H_#define CV_ADV_DIFF_BND_H_#include <stdio.h&原创 2021-10-30 17:28:31 · 472 阅读 · 0 评论 -
SUNDIALS例子的命名规则
sundials are of the form [slv][PbName][ls][prec]_[p]sundials的例子都是[slv][PbName]_[ls]_[prec]_[p] 这样的形式命名的,中括号里面就是每个模块[slv]identifies the solver (for cvode examples this is cv, while for fcvode examples, this is fcv);[slv]部分表明了使用了什么求解器[PbName]identif原创 2021-10-30 10:27:37 · 94 阅读 · 0 评论 -
Sundial的c++例子
ODE原始来源由OdeInt的例子修改而来:https://www.boost.org/doc/libs/1_67_0/libs/numeric/odeint/doc/html/boost_numeric_odeint/tutorial/stiff_systems.html后续目标1 测试一下没有jac的效果2 和OdeInt做比较头文件#ifndef SimpleCvodeEample_h#define SimpleCvodeEample_h#include <iostream原创 2021-10-13 18:02:14 · 278 阅读 · 0 评论 -
SUNDIALS和OdeInt的性能比较
上面的一些ODE库的比较。我挑了SUNDIALS和OdeIntV2进行实际的比较,测试的例子是来自OdeInt:https://www.boost.org/doc/libs/1_67_0/libs/numeric/odeint/doc/html/boost_numeric_odeint/tutorial/stiff_systems.html一样的系统,编译参数使用O2SUNDIALS的计算时间:710OdeIntV2的计算时间:2610差得有点远啊...原创 2021-10-09 11:25:28 · 245 阅读 · 0 评论 -
SUNDIAL的CVODE求解器的使用步骤
A skeleton of the user’s main programThe following is a skeleton of the user’s main program (or calling program) for the integration ofan ODE IVP. Most of the steps are independent of the nvector, sunmatrix, sunlinsol, andsunnonlinsol implementations us原创 2021-10-13 10:28:42 · 950 阅读 · 0 评论 -
SUNDIAL各个solver的介绍
Package PurposeCVODE solves initial value problems for ordinary differential equation (ODE) systems.CVODES solves ODE systems and includes sensitivity analysis capabilities (forward and adjoint).ARKODE solves initial value ODE problems with additive Run原创 2021-10-13 09:48:52 · 188 阅读 · 0 评论 -
sundials库和头文件介
By default, ‘make install’ will install the SUNDIALS libraries under ‘libdir’ and the publicheader files under ‘includedir’. The default values for these directories are ‘instdir’/liband ‘instdir’/include, respectively, but can be changed at the configur原创 2021-10-13 09:47:31 · 371 阅读 · 0 评论 -
用于编译c++版本的SUNDIALS例子的cmake配置
# Set the minimum required cmake versioncmake_minimum_required(VERSION 3.5)project(main VERSION 0.1.0 LANGUAGES CXX C) set(PROJECT_NAME main)ADD_DEFINITIONS(-D_LINUX -D__LINUX__)set (CMAKE_C_FLAGS ${default_c_flags})set (CMAKE_CXX_FLAGS ${defaul.原创 2021-10-13 09:36:55 · 319 阅读 · 0 评论