Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Linear operators for discretizations of differential equations and scientific machine learning (SciML)

License

NotificationsYou must be signed in to change notification settings

SciML/DiffEqOperators.jl

Join the chat at https://julialang.zulipchat.com #sciml-bridgedGlobal Docs

codecovBuild StatusBuild status

ColPrac: Contributor's Guide on Collaborative Practices for Community PackagesSciML Code Style

This Package is in the Process of being Deprecated

Alternatives:

README

DiffEqOperators.jl is a package for finite difference discretization of partialdifferential equations. It allows building lazy operators for high order non-uniform finite differences in an arbitrary number of dimensions, including vector calculus operators.

For automatic Method of Lines discretization of PDEs, better suited to nonlinear systems of equations and more complex boundary conditions, please seeMethodOfLines.jl

For the operators, both centered andupwind operators are provided,for domains of any dimension, arbitrarily spaced grids, and for any order of accuracy.The cases of 1, 2, and 3 dimensions with an evenly spaced grid are optimized with aconvolution routine fromNNlib.jl. Care is taken to give efficiency by avoidingunnecessary allocations, using purpose-built stencil compilers, allowing GPUsand parallelism, etc. Any operator can be concretized as anArray, aBandedMatrix or a sparse matrix.

Documentation

For information on using the package,see the stable documentation. Use thein-development documentation for the version ofthe documentation which contains the unreleased features.

Example 1: Finite Difference Operator Solution for the Heat Equation

using DiffEqOperators, OrdinaryDiffEq# # Heat Equation# This example demonstrates how to combine `OrdinaryDiffEq` with `DiffEqOperators` to solve a time-dependent PDE.# We consider the heat equation on the unit interval, with Dirichlet boundary conditions:# ∂ₜu = Δu# u(x=0,t)  = a# u(x=1,t)  = b# u(x, t=0) = u₀(x)## For `a = b = 0` and `u₀(x) = sin(2πx)` a solution is given by:u_analytic(x, t)=sin(2*π*x)*exp(-t*(2*π)^2)nknots=100h=1.0/(nknots+1)knots=range(h, step=h, length=nknots)ord_deriv=2ord_approx=2const Δ=CenteredDifference(ord_deriv, ord_approx, h, nknots)const bc=Dirichlet0BC(Float64)t0=0.0t1=0.03u0=u_analytic.(knots, t0)step(u,p,t)= Δ*bc*uprob=ODEProblem(step, u0, (t0, t1))alg=KenCarp4()sol=solve(prob, alg)

Sponsor this project

 

Packages

No packages published

Contributors44

Languages


[8]ページ先頭

©2009-2026 Movatter.jp