Thanks a lot for your answer!
Following your suggestion, if add a reaction to the reaction system, the problem arises:
n1 = @network_component n1 begin
@parameters k = 1.0
@species x(t) = k
end
n2 = @network_component n2 begin
@parameters k = 2.0
@species x(t) = k
end
@named rn = ReactionSystem([Reaction(1.0,[n1.x],[n2.x])], default_t(); systems = [n1, n2])
which gives
Model rn:
Subsystems (2): see hierarchy(rn)
n1
n2
Unknowns (2): see unknowns(rn)
n1₊x(t) [defaults to k]
n2₊x(t) [defaults to k]
Parameters (3): see parameters(rn)
k [defaults to 2.0]
n1₊k [defaults to 1.0]
n2₊k [defaults to 2.0]
I don’t know why their are 3 parameters here… And
oprob = ODEProblem(complete(rn), [], (0.0, 10.0))
gives:
ODEProblem with uType Vector{Float64} and tType Float64. In-place: true
Initialization status: FULLY_DETERMINED
Non-trivial mass matrix: false
timespan: (0.0, 10.0)
u0: 2-element Vector{Float64}:
2.0
2.0
Maybe I did something wrong. If not, the problem may come from MTK because I could actually also reproduce the same thing:
@mtkmodel Decl1 begin
@parameters begin
k = 1.0
end
@variables begin
x(t) = k
end
end
@mtkmodel Decl2 begin
@parameters begin
k = 2.0
end
@variables begin
x(t) = k
end
end
@named m1 = Decl1()
@named m2 = Decl2()
@named sys1 = ODESystem([D(m2.x) ~ 0, D(m1.x) ~ 0], t)
prob1 = ODEProblem(complete(sys1))
gives:
ODEProblem with uType Vector{Float64} and tType Nothing. In-place: true
Initialization status: FULLY_DETERMINED
Non-trivial mass matrix: false
timespan: (nothing, nothing)
u0: 2-element Vector{Float64}:
1.0
1.0