Skip to content

Commit e2b9cd3

Browse files
major docs cleanup
1 parent b4b6410 commit e2b9cd3

File tree

9 files changed

+65
-13
lines changed

9 files changed

+65
-13
lines changed

docs/src/systems/SDESystem.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ SDESystem
1818
## Function Calculation and Generation
1919

2020
```@docs
21-
calculate_jacobian
22-
calculate_tgrad
23-
calculate_factorized_W
21+
calculate_jacobian(sys::ModelingToolkit.AbstractODESystem)
22+
calculate_tgrad(sys::ModelingToolkit.AbstractODESystem)
23+
calculate_factorized_W(sys::ModelingToolkit.AbstractODESystem, simplify)
2424
generate_jacobian
2525
generate_tgrad
2626
generate_factorized_W

src/ModelingToolkit.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ function independent_variables end
6666
"""
6767
$(TYPEDSIGNATURES)
6868
69-
Get the set of dependent variables for the given system.
69+
Get the set of states for the given system.
7070
"""
71-
function dependent_variables end
71+
function states end
7272

7373
"""
7474
$(TYPEDSIGNATURES)

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ function DiffEqBase.ODEProblem(sys::AbstractODESystem, args...; kwargs...)
173173
ODEProblem{true}(sys, args...; kwargs...)
174174
end
175175

176+
"""
177+
$(TYPEDEF)
178+
179+
Generates an ODEProblem from an ODESystem and allows for automatically
180+
symbolically calculating numerical enhancements.
181+
"""
176182
function DiffEqBase.ODEProblem{iip}(sys::AbstractODESystem,u0map,tspan,
177183
parammap=DiffEqBase.NullParameters();
178184
version = nothing, tgrad=false,

src/systems/diffeqs/first_order_transform.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function flatten_differential(O::Operation)
1313
end
1414

1515
"""
16-
ode_order_lowering(sys::ODESystem)
16+
$(TYPEDSIGNATURES)
1717
1818
Takes a Nth order ODESystem and returns a new ODESystem written in first order
1919
form by defining new variables which represent the N-1 derivatives.

src/systems/diffeqs/modelingtoolkitize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
$(SIGNATURES)
2+
$(TYPEDSIGNATURES)
33
44
Generate `ODESystem`, dependent variables, and parameters from an `ODEProblem`.
55
"""

src/systems/diffeqs/odesystem.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ $(TYPEDEF)
44
A system of ordinary differential equations.
55
66
# Fields
7-
* `eqs` - The ODEs defining the system.
7+
$(FIELDS)
88
9-
# Examples
9+
# Example
1010
1111
```
1212
using ModelingToolkit
@@ -19,7 +19,7 @@ eqs = [D(x) ~ σ*(y-x),
1919
D(y) ~ x*(ρ-z)-y,
2020
D(z) ~ x*y - β*z]
2121
22-
de = ODESystem(eqs)
22+
de = ODESystem(eqs,[x,y,z],[σ,ρ,β])
2323
```
2424
"""
2525
struct ODESystem <: AbstractODESystem

src/systems/diffeqs/sdesystem.jl

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,36 @@
1+
"""
2+
$(TYPEDEF)
3+
4+
A system of stochastic differential equations.
5+
6+
# Fields
7+
$(FIELDS)
8+
9+
# Example
10+
11+
```
12+
using ModelingToolkit
13+
14+
@parameters t σ ρ β
15+
@variables x(t) y(t) z(t)
16+
@derivatives D'~t
17+
18+
eqs = [D(x) ~ σ*(y-x),
19+
D(y) ~ x*(ρ-z)-y,
20+
D(z) ~ x*y - β*z]
21+
22+
noiseeqs = [0.1*x,
23+
0.1*y,
24+
0.1*z]
25+
26+
de = SDESystem(eqs,noiseeqs,t,[x,y,z],[σ,ρ,β])
27+
```
28+
"""
129
struct SDESystem <: AbstractODESystem
230
"""The expressions defining the drift term."""
331
eqs::Vector{Equation}
432
"""The expressions defining the diffusion term."""
5-
noiseeqs
33+
noiseeqs::AbstractArray{Operation}
634
"""Independent variable."""
735
iv::Variable
836
"""Dependent (state) variables."""
@@ -122,6 +150,12 @@ function rename(sys::SDESystem,name)
122150
ODESystem(sys.eqs, sys.noiseeqs, sys.iv, sys.states, sys.ps, sys.tgrad, sys.jac, sys.Wfact, sys.Wfact_t, name, sys.systems)
123151
end
124152

153+
"""
154+
$(TYPEDEF)
155+
156+
Generates an SDEProblem from an SDESystem and allows for automatically
157+
symbolically calculating numerical enhancements.
158+
"""
125159
function DiffEqBase.SDEProblem{iip}(sys::SDESystem,u0map,tspan,p=parammap;
126160
version = nothing, tgrad=false,
127161
jac = false, Wfact = false,

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $(TYPEDEF)
44
A nonlinear system of equations.
55
66
# Fields
7-
* `eqs` - Vector of equations defining the system.
7+
$(FIELDS)
88
99
# Examples
1010
@@ -76,6 +76,12 @@ function generate_function(sys::NonlinearSystem, vs = states(sys), ps = paramete
7676
return build_function(rhss, vs′, ps′, (), NLSysToExpr(sys), expression; kwargs...)
7777
end
7878

79+
"""
80+
$(TYPEDEF)
81+
82+
Generates an NonlinearProblem from a NonlinearSystem and allows for automatically
83+
symbolically calculating numerical enhancements.
84+
"""
7985
function DiffEqBase.NonlinearProblem{iip}(sys::NonlinearSystem,u0map,tspan,
8086
parammap=DiffEqBase.NullParameters();
8187
jac = false, sparse=false,

src/systems/optimization/optimizationsystem.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $(TYPEDEF)
44
A scalar equation for optimization.
55
66
# Fields
7-
* `op` - The objective function
7+
$(FIELDS)
88
99
# Examples
1010
@@ -70,6 +70,12 @@ end
7070
equations(sys::OptimizationSystem) = isempty(sys.systems) ? sys.op : sys.op + reduce(+,namespace_operation.(sys.systems))
7171
namespace_operation(sys::OptimizationSystem) = namespace_operation(sys.op,sys.name,nothing)
7272

73+
"""
74+
$(TYPEDEF)
75+
76+
Generates an OptimizationProblem from an OptimizationSystem and allows for automatically
77+
symbolically calculating numerical enhancements.
78+
"""
7379
function DiffEqBase.OptimizationProblem{iip}(sys::OptimizationSystem,
7480
parammap=DiffEqBase.NullParameters();
7581
u0=nothing, lb=nothing, ub=nothing,

0 commit comments

Comments
 (0)