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
function SciMLBase.BVProblem{iip, specialize}(sys::AbstractODESystem, u0map = [],
834
+
tspan =get_tspan(sys),
835
+
parammap = DiffEqBase.NullParameters();
836
+
guesses =Dict(),
837
+
version =nothing, tgrad =false,
838
+
callback =nothing,
839
+
check_length =true,
840
+
warn_initialize_determined =true,
841
+
eval_expression =false,
842
+
eval_module =@__MODULE__,
843
+
kwargs...) where {iip, specialize}
844
+
845
+
if!iscomplete(sys)
846
+
error("A completed system is required. Call `complete` or `structural_simplify` on the system before creating an `BVProblem`")
847
+
end
848
+
!isnothing(callback) &&error("BVP solvers do not support callbacks.")
849
+
850
+
has_alg_eqs(sys) &&error("The BVProblem constructor currently does not support ODESystems with algebraic equations.") # Remove this when the BVDAE solvers get updated, the codegen should work when it does.
@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."
859
+
end
860
+
861
+
# ODESystems without algebraic equations should use both fixed values + guesses
occursin(iv, var) && (var ∈ sts ||throw(ArgumentError("Time-dependent variable $var is not an unknown of the system.")))
718
+
elseiflength(arguments(var)) >1
719
+
throw(ArgumentError("Too many arguments for variable $var."))
720
+
elseiflength(arguments(var)) ==1
721
+
arg =only(arguments(var))
722
+
operation(var)(iv) ∈ sts ||
723
+
throw(ArgumentError("Variable $var is not a variable of the ODESystem. Called variables must be variables of the ODESystem."))
724
+
725
+
isequal(arg, iv) ||isparameter(arg) || arg isa Integer || arg isa AbstractFloat ||
726
+
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."))
727
+
728
+
isparameter(arg) &&push!(constraintps, arg)
729
+
else
730
+
var ∈ sts &&@warn"Variable $var has no argument. It will be interpreted as $var($iv), and the constraint will apply to the entire interval."
731
+
end
732
+
end
733
+
734
+
ConstraintsSystem(constraints, collect(constraintsts), collect(constraintps); name = consname)
0 commit comments