Skip to content

Commit

Permalink
Update the README to point to the new docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed May 5, 2020
1 parent eec2854 commit 3d2fc2c
Showing 1 changed file with 79 additions and 6 deletions.
85 changes: 79 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,84 @@
[![Coverage Status](https://coveralls.io/repos/JuliaDiffEq/DataDrivenDiffEq.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/JuliaDiffEq/DataDrivenDiffEq.jl?branch=master)
[![codecov.io](http://codecov.io/github/JuliaDiffEq/DataDrivenDiffEq.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaDiffEq/DataDrivenDiffEq.jl?branch=master)

DataDrivenDiffEq.jl is a component package in the DifferentialEquations ecosystem.
It holds the tools for data-driven differential equation structural estimation and identification.
Users interested in using this functionality should check out
[DifferentialEquations.jl](https://github.com/JuliaDiffEq/DifferentialEquations.jl).
DataDrivenDiffEq.jl is a package in the SciML ecosystem for data-driven differential equation
structural estimation and identification. These tools include automatically discovering equations
from data and using this to simulate perturbed dynamics.

## Documentation
For information on using the package,
[see the stable documentation](https://datadriven.sciml.ai/stable/). Use the
[in-development documentation](https://datadriven.sciml.ai/dev/) for the version of
the documentation which contains the un-released features.

Extensive documentation of this functionality is on the [Structural Estimation page](http://docs.juliadiffeq.org/dev/analysis/structural_estimation.html).
## Quick Demonstration

```julia
## Generate some data by solving a differential equation
########################################################

using DataDrivenDiffEq
using ModelingToolkit
using OrdinaryDiffEq

using LinearAlgebra
using Plots
gr()

# Create a test problem
function lorenz(u,p,t)
x, y, z = u
= 10.0*(y - x)
= x*(28.0-z) - y
= x*y - (8/3)*z
return [ẋ, ẏ, ż]
end

u0 = [-8.0; 7.0; 27.0]
p = [10.0; -10.0; 28.0; -1.0; -1.0; 1.0; -8/3]
tspan = (0.0,100.0)
dt = 0.001
problem = ODEProblem(lorenz,u0,tspan)
solution = solve(problem, Tsit5(), saveat = dt, atol = 1e-7, rtol = 1e-8)

X = Array(solution)
DX = similar(X)
for (i, xi) in enumerate(eachcol(X))
DX[:,i] = lorenz(xi, [], 0.0)
end

## Now automatically discover the system that generated the data
################################################################

@variables x y z
u = Operation[x; y; z]
polys = Operation[]
for i 0:4
for j 0:i
for k 0:j
push!(polys, u[1]^i*u[2]^j*u[3]^k)
push!(polys, u[2]^i*u[3]^j*u[1]^k)
push!(polys, u[3]^i*u[1]^j*u[2]^k)
end
end
end

basis = Basis(polys, u)

opt = STRRidge(0.1)
Ψ = SInDy(X, DX, basis, maxiter = 100, opt = opt, normalize = true)
print_equations(Ψ)
get_error(Ψ)
```

```
3 dimensional basis in ["x", "y", "z"]
dx = p₁ * x + p₂ * y
dy = p₃ * x + p₄ * y + z * x * p₅
dz = p₆ * z + x * y * p₇
# Error
3-element Array{Float64,1}:
6.7202639134663155e-12
3.505423292198665e-11
1.2876598297504605e-11
```

0 comments on commit 3d2fc2c

Please sign in to comment.