DASSL

Solves stiff differential algebraic equations (DAE) using variable stepsize backwards finite difference formula (BDF) in the SciML scientific machine learning organization

https://github.com/sciml/dassl.jl

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 18 committers (11.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords

bdf dae dassl differential-algebraic-equations differential-equations differentialequations ode ordinary-differential-equations scientific-machine-learning sciml

Keywords from Contributors

hybrid-differential-equations neural-sde pde sde numerical matrix-exponential stochastic-differential-equations neural-ode dde partial-differential-equations
Last synced: 6 months ago · JSON representation ·

Repository

Solves stiff differential algebraic equations (DAE) using variable stepsize backwards finite difference formula (BDF) in the SciML scientific machine learning organization

Basic Info
Statistics
  • Stars: 36
  • Watchers: 4
  • Forks: 16
  • Open Issues: 7
  • Releases: 11
Topics
bdf dae dassl differential-algebraic-equations differential-equations differentialequations ode ordinary-differential-equations scientific-machine-learning sciml
Created almost 12 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

DASSL.jl

Build Status Coverage Status

This is an implementation of DASSL algorithm for solving algebraic differential equations. To install a stable version run

Pkg.add("DASSL")

Common Interface Example

This package is compatible with the JuliaDiffEq common solver interface which is documented in the DifferentialEquations.jl documentation. Following the DAE Tutorial, one can use dassl() as follows:

```julia using DASSL u0 = [1.0, 0, 0] du0 = [-0.04, 0.04, 0.0] tspan = (0.0,100000.0)

function resrob(r,yp,y,p,t) r[1] = -0.04y[1] + 1.0e4y[2]y[3] r[2] = -r[1] - 3.0e7y[2]*y[2] - yp[2] r[1] -= yp[1] r[3] = y[1] + y[2] + y[3] - 1.0 end

prob = DAEProblem(resrob,du0,u0,tspan)
sol = solve(prob, dassl()) ```

For more details on using this interface, see the ODE tutorial.

Examples

To solve a scalar equation y'(t)+y(t)=0 with initial data y(0)=0.0 up to time t=10.0 run the following code

using DASSL F(t,y,dy) = dy+y # the equation solved is F(t,y,dy)=0 y0 = 1.0 # the initial value tspan = [0.0,10.0] # time span over which we integrate (tn,yn) = dasslSolve(F,y0,tspan) # returns (tn,yn)

You can also change the relative error tolerance rtol, absolute error tolerance atol as well as initial step size h0 as follows

(tn,yn) = dasslSolve(F,y0,tspan)

To test the convergence and execution time for index-1 problem run convergence.jl from the test directory.

Naturally, DASSL.jl also supports multiple equations. For example the pendulum equation

u'-v=0 v'+sin(u)=0

with initial data u(0)=0.0 and v(0)=1.0 can be solved by defining the following residual function

function F(t,y,dy) [ dy[1]-y[2], # y[1]=u, y[2]=v dy[2]+sin(y[1]) # dy[1]=u', dy[2]=v' ] end

The initial data should now be set as a vector

y0 = [0.0,1.0] # y0=[u(0),v(0)]

The solution can be computed by calling

tspan = [0.0,10.0] (tn,yn) = dasslSolve(F,y0,tspan)

Output

Apart from producing the times tn and values yn, dasslSolve also produces the derivatives dyn (as the byproduct of BDF algorithm), e.g.

(tn,yn,dyn) = dasslSolve(F,y0,tspan)

The decision to produce these values is that it is not entirely trivial to compute y' from F(t,y,y')=0 when t and y are given.

Keyword arguments

DASSL supports a number of keyword arguments, the names of most of them are compatible with the namse used in ODE package.

  • reltol=1e-3/abstol=1e-5 set the relative/absolute local error tolerances

  • initstep=1e-4/minstep=0/maxstep=Inf set the initial/minimal/maximal step sizes (when step size drops below minimum the integration stops)

  • jacobian The most expensive step during the integration is solving the nonlinear equation F(t,y,a*y+b)=0 via Newton's method, which requires a jacobian of the form dF/dy+a*dF/dy'. By default, the solver approximates this Jacobian by a method of finite differences but you can provide your own method as a function (t,y,dy,a)->dF/dy+a*dF/dy'. For the pendulum equation we would define jacobian as

jacobian=(t,y,dy,a)->[[a,cos(y[1])] [-1,a]]

  • maxorder=6 Apart from selecting the current step size DASSL method can also dynamically change the order of BDF method used. BDF is stable up to 6-th order, which is the default upper limit but for some systems of equations it may make more sense to use lower orders.

  • dy0=zero(y) When solving differential algebraic equations it is important to start with consistent initial conditions, i.e. to choose y and y' such that F(t,y,y')=0 initially. DASSL tries to guess the initial value of y', but if it fails you can set your own initial conditions for the derivative.

  • norm=dassl_norm/weights=dassl_weights DASSL computes the error roughly as err=norm(yc-y0), and accepting the step when err<1. The local error tolerances reltol and abstol are hidden in the definition of dassl_norm(v, wt)=norm(v./wt)/sqrt(length(v)), where weights wt are defined by dassl_weights(y,reltol,abstol)=reltol*abs(y).+abstol. You can supply your own weights and norms when they are more appropriate for the problem at hand.

  • factorize_jacobian=true is a Boolean option which forces the factorization of Jacobian before storing it. It dramatically increases performance for large systems, but may decrease the computation speed for small systems.

Iterator version

DASSL.jl supports an iterative version of solver (implemented via coroutines, so debugging might be a little tricky) via dasslIterator. In the following example the dasslIterator is used to stop the integration when the solution y drops below 0.1

``` F(t,y,dy)=dy+y

iterator version of dassl solver

for (t,y,dy) in dasslIterator(F,1.0,0.0) if y < 0.1 @show (t,y,dy) break end end ```

Owner

  • Name: SciML Open Source Scientific Machine Learning
  • Login: SciML
  • Kind: organization
  • Email: contact@chrisrackauckas.com

Open source software for scientific machine learning

Citation (CITATION.bib)

@article{DifferentialEquations.jl-2017,
 author = {Rackauckas, Christopher and Nie, Qing},
 doi = {10.5334/jors.151},
 journal = {The Journal of Open Research Software},
 keywords = {Applied Mathematics},
 note = {Exported from https://app.dimensions.ai on 2019/05/05},
 number = {1},
 pages = {},
 title = {DifferentialEquations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia},
 url = {https://app.dimensions.ai/details/publication/pub.1085583166 and http://openresearchsoftware.metajnl.com/articles/10.5334/jors.151/galley/245/download/},
 volume = {5},
 year = {2017}
}

GitHub Events

Total
  • Watch event: 1
  • Delete event: 2
  • Push event: 7
  • Pull request event: 5
  • Create event: 3
Last Year
  • Watch event: 1
  • Delete event: 2
  • Push event: 7
  • Pull request event: 5
  • Create event: 3

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 161
  • Total Committers: 18
  • Avg Commits per committer: 8.944
  • Development Distribution Score (DDS): 0.491
Past Year
  • Commits: 9
  • Committers: 3
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.444
Top Committers
Name Email Commits
Paweł Biernat p****t@g****m 82
Christopher Rackauckas C****t@C****m 47
dependabot[bot] 4****] 7
Anant Thazhemadam a****m@g****m 5
github-actions[bot] 4****] 3
Stamp1993 m****3@g****m 3
Tony Kelman t****y@k****t 2
Chris de Graaf me@c****v 2
Julia TagBot 5****t 1
Ivar Nesje i****e@g****m 1
Hendrik Ranocha m****l@r****e 1
David Widmann d****n@i****e 1
Anshul Singhvi a****7@s****u 1
Alex Arslan a****n@c****t 1
Lilith Orion Hafner l****r@g****m 1
ScottPJones s****s@a****u 1
Silvio Traversaro s****o@t****t 1
femtocleaner[bot] f****] 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 15
  • Total pull requests: 36
  • Average time to close issues: 16 days
  • Average time to close pull requests: about 7 hours
  • Total issue authors: 8
  • Total pull request authors: 17
  • Average comments per issue: 3.33
  • Average comments per pull request: 0.31
  • Merged pull requests: 35
  • Bot issues: 0
  • Bot pull requests: 11
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: about 3 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ChrisRackauckas (5)
  • mauro3 (3)
  • pwl (2)
  • stevengj (1)
  • MartinOtter (1)
  • IainNZ (1)
  • JuliaTagBot (1)
  • hzgzh (1)
Pull Request Authors
  • dependabot[bot] (11)
  • ChrisRackauckas (8)
  • thazhemadam (8)
  • github-actions[bot] (3)
  • Stamp1993 (2)
  • tkelman (2)
  • christopher-dG (2)
  • JuliaTagBot (1)
  • LilithHafner (1)
  • traversaro (1)
  • ranocha (1)
  • asinghvi17 (1)
  • ivarne (1)
  • devmotion (1)
  • femtocleaner[bot] (1)
Top Labels
Issue Labels
enhancement (2) bug (2)
Pull Request Labels
dependencies (11) github_actions (1)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 1 total
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 8
juliahub.com: DASSL

Solves stiff differential algebraic equations (DAE) using variable stepsize backwards finite difference formula (BDF) in the SciML scientific machine learning organization

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 1 Total
Rankings
Dependent repos count: 7.7%
Forks count: 9.1%
Stargazers count: 17.5%
Average: 18.7%
Dependent packages count: 40.4%
Last synced: 6 months ago

Dependencies

.github/workflows/CI.yml actions
  • actions/cache v3 composite
  • actions/checkout v4 composite
  • codecov/codecov-action v3 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/CompatHelper.yml actions
  • julia-actions/setup-julia latest composite
.github/workflows/FormatCheck.yml actions
  • actions/checkout v4 composite
  • julia-actions/setup-julia latest composite
.github/workflows/Invalidations.yml actions
  • actions/checkout v4 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-invalidations v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite