You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@warn"The BVProblem is overdetermined. The total number of conditions (# constraints + # fixed initial values given by u0map) exceeds the total number of states. The BVP solvers will default to doing a nonlinear least-squares optimization."
950
951
end
951
952
@@ -976,33 +977,35 @@ function generate_function_bc(sys::ODESystem, u0, u0_idxs, tspan, iip)
976
977
ps =get_ps(sys)
977
978
np =length(ps)
978
979
ns =length(sts)
979
-
conssys =get_constraintsystem(sys)
980
-
cons =constraints(conssys)
981
-
982
980
stidxmap =Dict([v => i for (i, v) inenumerate(sts)])
983
981
pidxmap =Dict([v => i for (i, v) inenumerate(ps)])
984
982
985
983
@variablessol(..)[1:ns] p[1:np]
986
-
exprs = Any[]
987
984
988
-
for st inget_unknowns(cons)
989
-
x =operation(st)
990
-
t =first(arguments(st))
991
-
idx=stidxmap[x(iv)]
985
+
conssys =get_constraintsystem(sys)
986
+
cons = Any[]
987
+
if!isnothing(conssys)
988
+
cons=[con.lhs - con.rhs for con inconstraints(conssys)]
Copy file name to clipboardExpand all lines: src/systems/diffeqs/odesystem.jl
+4-7Lines changed: 4 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -802,13 +802,11 @@ function validate_constraint_syms(constraintsts, constraintps, sts, ps, iv)
802
802
throw(ArgumentError("Too many arguments for variable $var."))
803
803
elseiflength(arguments(var)) ==1
804
804
arg =first(arguments(var))
805
-
operation(var)(iv) ∈ sts ||throw(ArgumentError("Variable $var is not a variable of the ODESystem. Called variables must be variables of the ODESystem."))
805
+
operation(var)(iv) ∈ sts ||
806
+
throw(ArgumentError("Variable $var is not a variable of the ODESystem. Called variables must be variables of the ODESystem."))
806
807
807
-
isequal(arg, iv) ||
808
-
isparameter(arg) ||
809
-
arg isa Integer ||
810
-
arg isa AbstractFloat ||
811
-
throw(ArgumentError("Invalid argument specified for variable $var. The argument of the variable should be either $iv, a parameter, or a value specifying the time that the constraint holds."))
808
+
isequal(arg, iv) ||isparameter(arg) || arg isa Integer || arg isa AbstractFloat ||
809
+
throw(ArgumentError("Invalid argument specified for variable $var. The argument of the variable should be either $iv, a parameter, or a value specifying the time that the constraint holds."))
812
810
else
813
811
var ∈ sts &&@warn"Variable $var has no argument. It will be interpreted as $var($iv), and the constraint will apply to the entire interval."
814
812
end
@@ -824,7 +822,6 @@ function validate_constraint_syms(constraintsts, constraintps, sts, ps, iv)
824
822
operation(var) ∈ ps ||throw(ArgumentError("Parameter $var is not a parameter of the ODESystem. Called parameters must be parameters of the ODESystem."))
825
823
826
824
isequal(arg, iv) ||
827
-
isparameter(arg) ||
828
825
arg isa Integer ||
829
826
arg isa AbstractFloat ||
830
827
throw(ArgumentError("Invalid argument specified for callable parameter $var. The argument of the parameter should be either $iv, a parameter, or a value specifying the time that the constraint holds."))
0 commit comments