Skip to content

Commit 8a79030

Browse files
big doc update
1 parent 8e29750 commit 8a79030

File tree

8 files changed

+73
-9
lines changed

8 files changed

+73
-9
lines changed

docs/src/assets/favicon.ico

1.36 KB
Binary file not shown.

src/ModelingToolkit.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ include("build_function.jl")
9898

9999
export ODESystem, ODEFunction
100100
export SDESystem, SDEFunction
101+
export ODEProblem, SDEProblem, NonlinearProblem, OptimizationProblem
101102
export NonlinearSystem, OptimizationSystem
102103
export ode_order_lowering
103104
export PDESystem
@@ -111,10 +112,12 @@ export Operation, Expression, Variable
111112
export calculate_jacobian, generate_jacobian, generate_function
112113
export calculate_tgrad, generate_tgrad
113114
export calculate_gradient, generate_gradient
115+
export calculate_factorized_W, generate_factorized_W
114116
export calculate_hessian, generate_hessian
115117
export calculate_massmatrix, generate_diffusion_function
116118
export independent_variable, states, parameters, equations
117-
export simplified_expr
119+
export simplified_expr, rename, get_variables, substitute_expr!
120+
export build_function
118121
export @register
119122
export modelingtoolkitize
120123
export @variables, @parameters

src/systems/abstractsystem.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""
2+
```julia
23
calculate_tgrad(sys::AbstractSystem)
4+
```
35
46
Calculate the time gradient of a system.
57
@@ -9,7 +11,9 @@ call will be cached in the system object.
911
function calculate_tgrad end
1012

1113
"""
14+
```julia
1215
calculate_gradient(sys::AbstractSystem)
16+
```
1317
1418
Calculate the gradient of a scalar system.
1519
@@ -19,7 +23,9 @@ call will be cached in the system object.
1923
function calculate_gradient end
2024

2125
"""
26+
```julia
2227
calculate_jacobian(sys::AbstractSystem)
28+
```
2329
2430
Calculate the jacobian matrix of a system.
2531
@@ -29,7 +35,9 @@ call will be cached in the system object.
2935
function calculate_jacobian end
3036

3137
"""
38+
```julia
3239
calculate_factorized_W(sys::AbstractSystem)
40+
```
3341
3442
Calculate the factorized W-matrix of a system.
3543
@@ -39,7 +47,9 @@ call will be cached in the system object.
3947
function calculate_factorized_W end
4048

4149
"""
50+
```julia
4251
calculate_hessian(sys::AbstractSystem)
52+
```
4353
4454
Calculate the hessian matrix of a scalar system.
4555
@@ -49,47 +59,59 @@ call will be cached in the system object.
4959
function calculate_hessian end
5060

5161
"""
62+
```julia
5263
generate_tgrad(sys::AbstractSystem, dvs = states(sys), ps = parameters(sys), expression = Val{true}; kwargs...)
64+
```
5365
5466
Generates a function for the time gradient of a system. Extra arguments control
5567
the arguments to the internal [`build_function`](@ref) call.
5668
"""
5769
function generate_tgrad end
5870

5971
"""
72+
```julia
6073
generate_gradient(sys::AbstractSystem, dvs = states(sys), ps = parameters(sys), expression = Val{true}; kwargs...)
74+
```
6175
6276
Generates a function for the gradient of a system. Extra arguments control
6377
the arguments to the internal [`build_function`](@ref) call.
6478
"""
6579
function generate_gradient end
6680

6781
"""
82+
```julia
6883
generate_jacobian(sys::AbstractSystem, dvs = states(sys), ps = parameters(sys), expression = Val{true}; sparse = false, kwargs...)
84+
```
6985
7086
Generates a function for the jacobian matrix matrix of a system. Extra arguments control
7187
the arguments to the internal [`build_function`](@ref) call.
7288
"""
7389
function generate_jacobian end
7490

7591
"""
92+
```julia
7693
generate_factorized_W(sys::AbstractSystem, dvs = states(sys), ps = parameters(sys), expression = Val{true}; sparse = false, kwargs...)
94+
```
7795
7896
Generates a function for the factorized W-matrix matrix of a system. Extra arguments control
7997
the arguments to the internal [`build_function`](@ref) call.
8098
"""
8199
function generate_factorized_W end
82100

83101
"""
102+
```julia
84103
generate_hessian(sys::AbstractSystem, dvs = states(sys), ps = parameters(sys), expression = Val{true}; sparse = false, kwargs...)
104+
```
85105
86106
Generates a function for the hessian matrix matrix of a system. Extra arguments control
87107
the arguments to the internal [`build_function`](@ref) call.
88108
"""
89109
function generate_hessian end
90110

91111
"""
112+
```julia
92113
generate_function(sys::AbstractSystem, dvs = states(sys), ps = parameters(sys), expression = Val{true}; kwargs...)
114+
```
93115
94116
Generate a function to evaluate the system's equations.
95117
"""

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,14 @@ function DiffEqBase.ODEFunction(sys::AbstractODESystem, args...; kwargs...)
117117
end
118118

119119
"""
120-
$(SIGNATURES)
120+
```julia
121+
function DiffEqBase.ODEFunction{iip}(sys::AbstractODESystem, dvs = states(sys),
122+
ps = parameters(sys);
123+
version = nothing, tgrad=false,
124+
jac = false, Wfact = false,
125+
sparse = false,
126+
kwargs...) where {iip}
127+
```
121128
122129
Create an `ODEFunction` from the [`ODESystem`](@ref). The arguments `dvs` and `ps`
123130
are used to set the order of the dependent variable and parameter vectors,
@@ -177,7 +184,15 @@ function DiffEqBase.ODEProblem(sys::AbstractODESystem, args...; kwargs...)
177184
end
178185

179186
"""
180-
$(TYPEDEF)
187+
```julia
188+
function DiffEqBase.ODEProblem{iip}(sys::AbstractODESystem,u0map,tspan,
189+
parammap=DiffEqBase.NullParameters();
190+
version = nothing, tgrad=false,
191+
jac = false, Wfact = false,
192+
checkbounds = false, sparse = false,
193+
linenumbers = true, multithread=false,
194+
kwargs...) where iip
195+
```
181196
182197
Generates an ODEProblem from an ODESystem and allows for automatically
183198
symbolically calculating numerical enhancements.

src/systems/diffeqs/sdesystem.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ function generate_diffusion_function(sys::SDESystem, dvs = sys.states, ps = sys.
8787
end
8888

8989
"""
90-
$(SIGNATURES)
90+
```julia
91+
function DiffEqBase.SDEFunction{iip}(sys::SDESystem, dvs = sys.states, ps = sys.ps;
92+
version = nothing, tgrad=false, sparse = false,
93+
jac = false, Wfact = false, kwargs...) where {iip}
94+
```
9195
9296
Create an `SDEFunction` from the [`SDESystem`](@ref). The arguments `dvs` and `ps`
9397
are used to set the order of the dependent variable and parameter vectors,
@@ -151,7 +155,14 @@ function rename(sys::SDESystem,name)
151155
end
152156

153157
"""
154-
$(SIGNATURES)
158+
```julia
159+
function DiffEqBase.SDEProblem{iip}(sys::SDESystem,u0map,tspan,p=parammap;
160+
version = nothing, tgrad=false,
161+
jac = false, Wfact = false,
162+
checkbounds = false, sparse = false,
163+
linenumbers = true, multithread=false,
164+
kwargs...)
165+
```
155166
156167
Generates an SDEProblem from an SDESystem and allows for automatically
157168
symbolically calculating numerical enhancements.

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,14 @@ function generate_function(sys::NonlinearSystem, vs = states(sys), ps = paramete
6464
end
6565

6666
"""
67-
$(TYPEDEF)
67+
```julia
68+
function DiffEqBase.NonlinearProblem{iip}(sys::NonlinearSystem,u0map,tspan,
69+
parammap=DiffEqBase.NullParameters();
70+
jac = false, sparse=false,
71+
checkbounds = false,
72+
linenumbers = true, multithread=false,
73+
kwargs...) where iip
74+
```
6875
6976
Generates an NonlinearProblem from a NonlinearSystem and allows for automatically
7077
symbolically calculating numerical enhancements.

src/systems/optimization/optimizationsystem.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ equations(sys::OptimizationSystem) = isempty(sys.systems) ? sys.op : sys.op + re
7171
namespace_operation(sys::OptimizationSystem) = namespace_operation(sys.op,sys.name,nothing)
7272

7373
"""
74-
$(TYPEDEF)
74+
```julia
75+
function DiffEqBase.OptimizationProblem{iip}(sys::OptimizationSystem,
76+
parammap=DiffEqBase.NullParameters();
77+
u0=nothing, lb=nothing, ub=nothing,
78+
hes = false, sparse = false,
79+
checkbounds = false,
80+
linenumbers = true, multithread=false,
81+
kwargs...) where iip
82+
```
7583
7684
Generates an OptimizationProblem from an OptimizationSystem and allows for automatically
7785
symbolically calculating numerical enhancements.

src/variables.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ end
7676
$(TYPEDEF)
7777
7878
An expression which wraps a constant numerical value.
79-
80-
The value of the constant can be extracted with [`Base.get`](@ref).
8179
"""
8280
struct Constant <: Expression
8381
"""The constant's numerical value"""

0 commit comments

Comments
 (0)