Skip to content

Commit 1a2cc38

Browse files
docs: document XSystem utility constructors
1 parent 35d7e24 commit 1a2cc38

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/systems/system.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,13 @@ function check_complete(sys::System, obj)
899899
iscomplete(sys) || throw(SystemNotCompleteError(obj))
900900
end
901901

902+
"""
903+
$(TYPEDSIGNATURES)
904+
905+
Convert a time-dependent system `sys` to a time-independent system of nonlinear
906+
equations that solve for the steady state of the system where `D(x)` is zero for
907+
each continuous variable `x`.
908+
"""
902909
function NonlinearSystem(sys::System)
903910
if !is_time_dependent(sys)
904911
throw(ArgumentError("`NonlinearSystem` constructor expects a time-dependent `System`"))
@@ -924,6 +931,11 @@ end
924931
# Utility constructors
925932
########
926933

934+
"""
935+
$(METHODLIST)
936+
937+
Construct a [`System`](@ref) to solve an optimization problem with the given scalar cost.
938+
"""
927939
function OptimizationSystem(cost; kwargs...)
928940
return System(Equation[]; costs = [cost], kwargs...)
929941
end
@@ -940,6 +952,11 @@ function OptimizationSystem(cost::Array, dvs, ps; kwargs...)
940952
return System(Equation[], nothing, dvs, ps; costs = vec(cost), kwargs...)
941953
end
942954

955+
"""
956+
$(METHODLIST)
957+
958+
Construct a [`System`](@ref) to solve a system of jump equations.
959+
"""
943960
function JumpSystem(jumps, iv; kwargs...)
944961
mask = isa.(jumps, Equation)
945962
eqs = Vector{Equation}(jumps[mask])
@@ -954,6 +971,11 @@ function JumpSystem(jumps, iv, dvs, ps; kwargs...)
954971
return System(eqs, iv, dvs, ps; jumps, kwargs...)
955972
end
956973

974+
"""
975+
$(METHODLIST)
976+
977+
Construct a system of equations with associated noise terms.
978+
"""
957979
function SDESystem(eqs::Vector{Equation}, noise, iv; is_scalar_noise = false, kwargs...)
958980
if is_scalar_noise
959981
if !(noise isa Vector)

0 commit comments

Comments
 (0)