Skip to content

Commit 3a0784a

Browse files
Merge pull request #3380 from vyudu/discrete_docs
add documentation page for `DiscreteSystem`
2 parents 0a5c1ce + 992ec21 commit 3a0784a

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

docs/pages.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ pages = [
4141
"systems/JumpSystem.md",
4242
"systems/NonlinearSystem.md",
4343
"systems/OptimizationSystem.md",
44-
"systems/PDESystem.md"],
44+
"systems/PDESystem.md",
45+
"systems/DiscreteSystem.md"],
4546
"comparison.md",
4647
"internals.md"
4748
]

docs/src/systems/DiscreteSystem.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# DiscreteSystem
2+
3+
## System Constructors
4+
5+
```@docs
6+
DiscreteSystem
7+
```
8+
9+
## Composition and Accessor Functions
10+
11+
- `get_eqs(sys)` or `equations(sys)`: The equations that define the discrete system.
12+
- `get_unknowns(sys)` or `unknowns(sys)`: The set of unknowns in the discrete system.
13+
- `get_ps(sys)` or `parameters(sys)`: The parameters of the discrete system.
14+
- `get_iv(sys)`: The independent variable of the discrete system
15+
- `discrete_events(sys)`: The set of discrete events in the discrete system.
16+
17+
## Transformations
18+
19+
```@docs; canonical=false
20+
structural_simplify
21+
```
22+
23+
## Problem Constructors
24+
25+
```@docs; canonical=false
26+
DiscreteProblem(sys::DiscreteSystem, u0map, tspan)
27+
DiscreteFunction(sys::DiscreteSystem, args...)
28+
```

src/systems/discrete_system/discrete_system.jl

+13
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,19 @@ end
323323
function SciMLBase.DiscreteFunction{false}(sys::DiscreteSystem, args...; kwargs...)
324324
DiscreteFunction{false, SciMLBase.FullSpecialize}(sys, args...; kwargs...)
325325
end
326+
327+
"""
328+
```julia
329+
SciMLBase.DiscreteFunction{iip}(sys::DiscreteSystem,
330+
dvs = unknowns(sys),
331+
ps = parameters(sys);
332+
kwargs...) where {iip}
333+
```
334+
335+
Create an `DiscreteFunction` from the [`DiscreteSystem`](@ref). The arguments `dvs` and `ps`
336+
are used to set the order of the dependent variable and parameter vectors,
337+
respectively.
338+
"""
326339
function SciMLBase.DiscreteFunction{iip, specialize}(
327340
sys::DiscreteSystem,
328341
dvs = unknowns(sys),

0 commit comments

Comments
 (0)