Skip to content

Commit

Permalink
Merge pull request #217 from SciML/bumps
Browse files Browse the repository at this point in the history
Version bumps
  • Loading branch information
ChrisRackauckas authored Mar 30, 2024
2 parents 8061d0b + 36eb200 commit dbea39a
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 206 deletions.
32 changes: 16 additions & 16 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,40 +50,40 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
AdvancedHMC = "0.5, 0.6"
AdvancedHMC = "0.6"
BenchmarkTools = "1"
CSV = "0.10"
CUDA = "4, 5"
ComponentArrays = "0.14, 0.15"
DataDrivenDiffEq = "1.2"
CUDA = "5"
ComponentArrays = "0.15"
DataDrivenDiffEq = "1.4"
DataDrivenSparse = "0.1"
DataFrames = "1"
DiffEqFlux = "2"
DiffEqGPU = "2, 3"
DiffEqFlux = "3"
DiffEqGPU = "3"
DifferentialEquations = "7"
Distributions = "0.25"
Documenter = "1"
DomainSets = "0.6, 0.7"
Flux = "0.13, 0.14"
ForwardDiff = "0.10"
IncompleteLU = "0.2"
Integrals = "3, 4"
Integrals = "4"
LineSearches = "7"
LinearSolve = "2"
Lux = "0.5"
MCMCChains = "6"
Measurements = "2"
MethodOfLines = "0.9, 0.10"
ModelingToolkit = "8"
MethodOfLines = "0.11"
ModelingToolkit = "9.9"
MultiDocumenter = "0.7"
NeuralPDE = "5"
NonlinearSolve = "1, 2"
NeuralPDE = "5.15"
NonlinearSolve = "3"
Optimization = "3"
OptimizationMOI = "0.1, 0.2"
OptimizationNLopt = "0.1"
OptimizationOptimJL = "0.1"
OptimizationOptimisers = "0.1"
OptimizationPolyalgorithms = "0.1, 0.2"
OptimizationMOI = "0.4"
OptimizationNLopt = "0.2"
OptimizationOptimJL = "0.2"
OptimizationOptimisers = "0.2"
OptimizationPolyalgorithms = "0.2"
OrdinaryDiffEq = "6"
Plots = "1"
SciMLExpectations = "2"
Expand Down
8 changes: 4 additions & 4 deletions docs/src/getting_started/find_root.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using ModelingToolkit, NonlinearSolve
eqs = [0 ~ σ * (y - x),
0 ~ x * (ρ - z) - y,
0 ~ x * y - β * z]
@named ns = NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
@mtkbuild ns = NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
# Convert the symbolic system into a numerical system
prob = NonlinearProblem(ns, [])
Expand All @@ -56,7 +56,7 @@ prob = NonlinearProblem(ns, [])
sol = solve(prob, NewtonRaphson())
# Analyze the solution
@show sol.u, prob.f(sol.u, prob.p)
@show sol[[x,y,z]], sol.resid
```

## Step-by-Step Solution
Expand Down Expand Up @@ -122,7 +122,7 @@ Finally, we bring these pieces together, the equation along with its states and
define our `NonlinearSystem`:

```@example first_rootfind
@named ns = NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
@mtkbuild ns = NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
```

### Step 3: Convert the Symbolic Problem to a Numerical Problem
Expand Down Expand Up @@ -178,5 +178,5 @@ We can check it as follows:

```@example first_rootfind
# Analyze the solution
@show sol.u, sol.resid
@show sol[[x,y,z]], sol.resid
```
33 changes: 11 additions & 22 deletions docs/src/getting_started/first_simulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,11 @@ eqs = [D(x) ~ α * x - β * x * y
z ~ x + y]
# Bring these pieces together into an ODESystem with independent variable t
@named sys = ODESystem(eqs, t)
# Symbolically Simplify the System
simpsys = structural_simplify(sys)
@mtkbuild sys = ODESystem(eqs, t)
# Convert from a symbolic to a numerical problem to simulate
tspan = (0.0, 10.0)
prob = ODEProblem(simpsys, [], tspan)
prob = ODEProblem(sys, [], tspan)
# Solve the ODE
sol = solve(prob)
Expand Down Expand Up @@ -173,22 +170,15 @@ to represent an `ODESystem` with the following:

```@example first_sim
# Bring these pieces together into an ODESystem with independent variable t
@named sys = ODESystem(eqs, t)
@mtkbuild sys = ODESystem(eqs, t)
```

Next, we want to simplify this into a standard ODE system. Notice that in our equations
we have an algebraic equation `z ~ x + y`. This is not a differential equation but an
algebraic equation, and thus we call this set of equations a Differential-Algebraic Equation
(DAE). The symbolic system of ModelingToolkit can eliminate such equations to return simpler
forms to numerically approximate. Let's tell it to simplify the system using
`structural_simplify`:

```@example first_sim
# Symbolically Simplify the System
simpsys = structural_simplify(sys)
```
Notice that in our equations we have an algebraic equation `z ~ x + y`. This is not a
differential equation but an algebraic equation, and thus we call this set of equations a
Differential-Algebraic Equation (DAE). The symbolic system of ModelingToolkit can eliminate
such equations to return simpler forms to numerically approximate.

Notice that what is returned is another `ODESystem`, but now with the simplified set of
Notice that what is returned is an `ODESystem`, but now with the simplified set of
equations. `z` has been turned into an “observable”, i.e. a state that is not computed
but can be constructed on-demand. This is one of the ways that SciML reaches its speed:
you can have 100,000 equations, but solve only 1,000 to then automatically reconstruct
Expand All @@ -213,7 +203,7 @@ like:
```@example first_sim
# Convert from a symbolic to a numerical problem to simulate
tspan = (0.0, 10.0)
prob = ODEProblem(simpsys, [], tspan)
prob = ODEProblem(sys, [], tspan)
```

### Step 4: Solve the ODE System
Expand Down Expand Up @@ -282,9 +272,8 @@ D = Differential(t)
eqs = [D(🐰) ~ α * 🐰 - β * 🐰 * 🐺,
D(🐺) ~ -γ * 🐺 + δ * 🐰 * 🐺]
@named sys = ODESystem(eqs, t)
simpsys = structural_simplify(sys)
prob = ODEProblem(simpsys, [], (0.0, 10.0))
@mtkbuild sys = ODESystem(eqs, t)
prob = ODEProblem(sys, [], (0.0, 10.0))
sol = solve(prob)
```

Expand Down
Loading

0 comments on commit dbea39a

Please sign in to comment.