Skip to content

Commit 09db732

Browse files
committed
change name, add docs
1 parent 3036eaa commit 09db732

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

docs/src/tutorials/initialization.md

+10
Original file line numberDiff line numberDiff line change
@@ -536,3 +536,13 @@ sol[α * x - β * x * y]
536536
```@example init
537537
plot(sol)
538538
```
539+
540+
## Summary of Initialization API
541+
```@docs; canonical=false
542+
Initial
543+
isinitial
544+
generate_initializesystem
545+
initialization_equations
546+
guesses
547+
defaults
548+
```

src/ModelingToolkit.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export toexpr, get_variables
286286
export simplify, substitute
287287
export build_function
288288
export modelingtoolkitize
289-
export generate_initializesystem, Initial, isInitial
289+
export generate_initializesystem, Initial, isinitial
290290

291291
export alg_equations, diff_equations, has_alg_equations, has_diff_equations
292292
export get_alg_eqs, get_diff_eqs, has_alg_eqs, has_diff_eqs

src/systems/abstractsystem.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ end
720720
"""
721721
Returns true if the parameter `p` is of the form `Initial(x)`.
722722
"""
723-
function isInitial(p)
723+
function isinitial(p)
724724
p = unwrap(p)
725725
if iscall(p)
726726
operation(p) isa Initial && return true

test/variable_utils.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ end
146146
end
147147
end
148148

149-
@testset "isInitial" begin
149+
@testset "isinitial" begin
150150
t = ModelingToolkit.t_nounits
151151
@variables x(t) z(t)[1:5]
152152
@parameters a b c[1:4]
153-
@test isInitial(Initial(z))
154-
@test isInitial(Initial(x))
155-
@test isInitial(Initial(a))
156-
@test isInitial(Initial(z[1]))
157-
@test isInitial(Initial(c[4]))
158-
@test !isInitial(c)
159-
@test !isInitial(x)
153+
@test isinitial(Initial(z))
154+
@test isinitial(Initial(x))
155+
@test isinitial(Initial(a))
156+
@test isinitial(Initial(z[1]))
157+
@test isinitial(Initial(c[4]))
158+
@test !isinitial(c)
159+
@test !isinitial(x)
160160
end

0 commit comments

Comments
 (0)