gpt4 book ai didi

Julia Differential Equations Repositories(Julia微分方程式资料库)

转载 作者:bug小助手 更新时间:2023-10-25 16:24:21 32 4
gpt4 key购买 nike



Is there a repository (or a web page) of all differential equations coded in DifferentialEquations.jl or at least ODE in OrdinaryDiffEq.jl?

有没有用DifferentialEquations.jl编码的所有微分方程式的存储库(或网页),或者至少在EveryaryDiffEq.jl中编码的ODE?


If there are no repositories, are there other sources, university classes, etc. where Julia code is used to solve differential equations and is available?

如果没有存储库,有没有其他来源、大学课程等可以使用Julia代码来解微分方程式?


更多回答

I voted to close because this is Seeking recommendations for books, tools, software libraries, and more This question is likely to lead to opinion-based answers.

我投票决定结束,因为这是在寻找书籍、工具、软件库等方面的推荐,这个问题可能会导致基于意见的答案。

That seems like a major misinterpretation of the question. They are asking about the code structure. Code structure of an open source project is something that is not opinion-based.

这似乎是对这个问题的重大误解。他们正在询问代码结构。开放源码项目的代码结构不是基于意见的。

优秀答案推荐

There are two ways to read this question. One is either looking for where the examples for the ODE definitions are contained, the other is looking for where the ODE solver codebases are found. I'll split this answer into the two possible interpretations.

有两种方式来解读这个问题。一个是查找包含ODE定义的示例的位置,另一个是查找找到ODE解算器代码库的位置。我会把这个答案分成两种可能的解释。


Where the ODE Problem Definition Examples are Found


The DifferentialEquations.jl documentation (https://docs.sciml.ai/DiffEqDocs/stable/) contains many examples for defining ODEs in its tutorials and examples section. It is highly recommended that one get started with the Getting Started with Differential Equations in Julia which uses examples such as the Lorenz equation. Other pages include more examples, such as the Classical Physics soler page in the documentation which shows how to implement 5 different classical physics models using standard ODE solvers and symplectic methods. There's also pages on dosing models, the Kepler problem, and much much more.

Jl文档(https://docs.sciml.ai/DiffEqDocs/stable/)在其教程和示例部分包含了许多定义ODE的示例。强烈建议大家从Julia的微分方程式开始学习,它使用了Lorenz方程等例子。其他页面包括更多的例子,例如文档中的经典物理解算器页面,它展示了如何使用标准的常微分方程解算器和辛方法来实现5种不同的经典物理模型。还有关于剂量模型、开普勒问题和更多内容的页面。


The ODEProblem definition page (https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/) also has an "Example Problems" section (https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/#Example-Problems) with more than 10 example problems implemented, including some classic ODEs such as the Brusselator. The source for these can be found in the DiffEqProblemLibrary.jl repository:

ODEProblem定义页面(https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/)也有一个“Example Problems”部分(https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/#Example-Problems),其中实现了10多个示例问题,包括一些经典的颂歌,如布鲁塞尔托。这些代码的源代码可以在DiffEqProblemLibrary.jl存储库中找到:


https://github.com/SciML/DiffEqProblemLibrary.jl

Https://github.com/SciML/DiffEqProblemLibrary.jl


For example, the 20 stiff ODE POLLU pollution model reference in the documentation at (https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/#ODEProblemLibrary.prob_ode_pollution) can be found at this location in the DiffEqProblemLibrary (in the sublibrary for ODEProblemLibrary):

例如,(https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/#ODEProblemLibrary.prob_ode_pollution)文档中引用的20 Stiff ODE Pollu污染模型可以在DiffEqProblemLibrary(在ODEProblemLibrary的子库中)的以下位置找到:


https://github.com/SciML/DiffEqProblemLibrary.jl/blob/master/lib/ODEProblemLibrary/src/pollution_prob.jl

Https://github.com/SciML/DiffEqProblemLibrary.jl/blob/master/lib/ODEProblemLibrary/src/pollution_prob.jl


All of the example problems can be found in that repository.

所有示例问题都可以在该存储库中找到。


Note that additional examples can be found by looking at the benchmark pages as well: https://docs.sciml.ai/SciMLBenchmarksOutput/stable/

请注意,通过查看基准测试页面也可以找到其他示例:https://docs.sciml.ai/SciMLBenchmarksOutput/stable/


Where the Solver Code is Found and How it's Organized


DifferentialEquations.jl is a metapackage which re-exports the solver codes. The solvers are documented in https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/. In the section "Full List of Methods", the first section is OrdinaryDiffEq.jl which has a few hundred methods. These are all implemented in the OrdinaryDiffEq.jl repository:

Jl是重新导出求解器代码的元包。Https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/.中记录了求解器在“完整的方法列表”一节中,第一节是包含数百个方法的EveryaryDiffEq.jl。这些都是在QuararyDiffEq.jl存储库中实现的:


https://github.com/SciML/OrdinaryDiffEq.jl

Https://github.com/SciML/OrdinaryDiffEq.jl


However, there are many other solvers available, as documented. A good set to know about for teaching is SimpleDiffEq.jl

但是,如文档所述,还有许多其他解算器可用。一个不错的教学设置是SimpleDiffEq.jl


https://github.com/SciML/SimpleDiffEq.jl

Https://github.com/SciML/SimpleDiffEq.jl


This for example has a bunch of self-contained implementations which can be easier to explain. For example, the GPUATsit5 implementation is mathematically equivalent to the standard OrdinaryDiffEq.jl Tsit5, but it's built without all of the extra machinery and options and is instead implemented as a single loop here:

例如,它有一系列自包含的实现,可以更容易地解释。例如,GPUATsit5实现在数学上等同于标准的QuararyDiffEq.jl Tsit5,但它没有构建所有额外的机制和选项,而是作为单个循环在这里实现:


https://github.com/SciML/SimpleDiffEq.jl/blob/v1.10.0/src/tsit5/gpuatsit5.jl#L104

Https://github.com/SciML/SimpleDiffEq.jl/blob/v1.10.0/src/tsit5/gpuatsit5.jl#L104


Thus for someone trying to understand or explain the code in a classroom setting, using GPUATsit5 instead of Tsit5 can be helpful.

因此,对于试图在课堂环境中理解或解释代码的人来说,使用GPUATsit5而不是Tsit5可能会很有帮助。


As another example of a solver library, there are the CVODE_BDF methods from Sundials which are a wrapper over the SUNDIALS C++ library, and this wrapper code is found at the Sundials.jl repository:

作为解算器库的另一个示例,有来自Sundials的CVODE_bdf方法,它是sundials C++库的包装器,该包装器代码可以在Sunial s.jl存储库中找到:


https://github.com/SciML/Sundials.jl

Https://github.com/SciML/Sundials.jl


A greater list of different solver packages are:

以下是不同解算器程序包的更多列表:



And there's more, the list is ever growing. Thus DifferentialEquations.jl is a common interface, where solve(prob, alg) works for any algorithm type that dispatches appropriately, and there's 10+ packages that are now supplying algorithm types to this interface that all solve ODEs in different ways, with some traditional methods while some of these are using neural networks or generating circuits to run on quantum computers. But all of them take the same input and choosing the solver of a different library is just a few characters change.

而且还有更多,名单还在不断增长。因此,DifferentialEquations.jl是一个公共接口,其中solve(prob,alg)适用于任何适当调度的算法类型,现在有10多个包向该接口提供算法类型,这些算法类型都以不同的方式求解ODE,使用一些传统方法,而其中一些方法使用神经网络或生成电路在量子计算机上运行。但它们都接受相同的输入,选择不同库的求解器只需几个字符的变化。


This interface is kept open by using multiple dispatch on the algorithm choice. If you're curious, more information about that is here: https://www.sciencedirect.com/science/article/abs/pii/S0965997818310251. It's specifically kept open so that researchers can add new methods to the interface without requiring that they contributing to existing libraries. This allows for someone to make a self-contained ODE solver, but then just add a single dispatch function and now it presents itself as part of the DifferentialEquations.jl interface. This is the reason why there isn't a single canonical repository to point to for DifferentialEquations.jl's solvers: it's intentionally built as an expandable interface.

该接口通过在算法选择上使用多调度来保持开放。如果你感兴趣,更多信息在这里:https://www.sciencedirect.com/science/article/abs/pii/S0965997818310251.它是专门保持开放的,这样研究人员就可以向接口添加新的方法,而不需要他们为现有的库做贡献。这允许某人制作一个自包含的ODE解算器,但随后只需添加一个分派函数,它现在就将自己作为DifferentialEquations.jl接口的一部分出现。这就是为什么DifferentialEquations.jl的求解器没有一个规范的存储库可以指向的原因:它被有意构建为一个可扩展的接口。


Summary


So to summarize:

因此,总结一下:



  • If you're looking for examples, look at the DifferentialEquations.jl tutorials and examples sections which have many examples.

  • If you want more examples, look at the DiffEqProblemLibrary.jl which has the code for many more examples that are not included in the documentation.

  • There's many different repos that implement different ODE solvers, some repos with one solver while others have hundreds.

  • DifferentialEquations.jl is a metapackage / interface and thus through this interface this fact is mostly abstracted from the user and user code almost doesn't have to change in order to switch solver packages. But if you are looking for "where is the solver code", indeed you have to go find the specific repo.

  • The canonical solvers that are developed as part of DifferentialEquations.jl are those of OrdinaryDiffEq.jl that can be found here https://github.com/SciML/OrdinaryDiffEq.jl.

  • A good set of solvers to look at which are designed for small-scale performance and teaching is the SimpleDiffEq.jl set found here https://github.com/SciML/SimpleDiffEq.jl


更多回答

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com