@@ -77,9 +77,21 @@ struct ODESystem <: AbstractODESystem
7777 [`generate_factorized_W`](@ref) is called on the system.
7878 """
7979 Wfact_t:: RefValue{Matrix{Expression}}
80+ """
81+ Name: the name of the system
82+ """
83+ name:: Symbol
84+ end
85+
86+ function ODESystem (deqs:: AbstractVector{ODEExpr} , iv, dvs, ps; name= gensym (:ODESystem ))
87+ tgrad = RefValue (Vector {Expression} (undef, 0 ))
88+ jac = RefValue (Matrix {Expression} (undef, 0 , 0 ))
89+ Wfact = RefValue (Matrix {Expression} (undef, 0 , 0 ))
90+ Wfact_t = RefValue (Matrix {Expression} (undef, 0 , 0 ))
91+ ODESystem (deqs, iv, dvs, ps, tgrad, jac, Wfact, Wfact_t, name)
8092end
8193
82- function ODESystem (eqs)
94+ function ODESystem (eqs; kwargs ... )
8395 reformatted = convert .(ODEExpr,eqs)
8496
8597 ivs = unique (r[1 ] for r ∈ reformatted)
@@ -93,22 +105,14 @@ function ODESystem(eqs)
93105 x. known & ! isequal (x, iv)
94106 end |> collect
95107
96- ODESystem (deqs, iv, dvs, ps)
97- end
98-
99- function ODESystem (deqs:: AbstractVector{ODEExpr} , iv, dvs, ps)
100- tgrad = RefValue (Vector {Expression} (undef, 0 ))
101- jac = RefValue (Matrix {Expression} (undef, 0 , 0 ))
102- Wfact = RefValue (Matrix {Expression} (undef, 0 , 0 ))
103- Wfact_t = RefValue (Matrix {Expression} (undef, 0 , 0 ))
104- ODESystem (deqs, iv, dvs, ps, tgrad, jac, Wfact, Wfact_t)
108+ ODESystem (deqs, iv, dvs, ps; kwargs... )
105109end
106110
107- function ODESystem (deqs:: AbstractVector{<:Equation} , iv, dvs, ps)
111+ function ODESystem (deqs:: AbstractVector{<:Equation} , iv, dvs, ps; kwargs ... )
108112 _dvs = [deq. op for deq ∈ dvs]
109113 _iv = iv. op
110114 _ps = [p. op for p ∈ ps]
111- ODESystem (getindex .(convert .(ODEExpr,deqs),2 ), _iv, _dvs, _ps)
115+ ODESystem (getindex .(convert .(ODEExpr,deqs),2 ), _iv, _dvs, _ps; kwargs ... )
112116end
113117
114118function _eq_unordered (a, b)
0 commit comments