-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BVProblem Interface Summary #3378
Comments
@ErikQQY For your reference, this is the planned interface for MTK's codegen to BVProblem, does this all seem reasonable? |
@ErikQQY What's the BVP interface for optimization-type problems going to look like? Are the inequality constraints passed as a separate argument, like Also what should the function for inequality constraints look like? If you have x(0.5) < 1, y(0.5) > 2, is it like function ineqs(resid, sol, p, t)
resid[1] = x(0.5) - 1
resid[2] = 2 - y(0.5)
end and it ensures resid is less than zero? |
While there are no interfaces for optimization-type problems in BoundaryValueDiffEq.jl, that's something on the TODO list, I think we better follow the constraints function in Optimization.jl, e.g. in https://docs.sciml.ai/Optimization/stable/tutorials/constraints/, we can do like cons(res, sol, p, t) = (res .= [x(0.5) - 1, 2 - y(0.5)])
fun = BVPFunction(f!, cons = cons)
prob = BVProblem(fun, bc, u0, p, lcons = [-Inf, 0.0], ucons = [0.0, Inf]) |
Constraints
Specified as a vector of
Equation
, gets codegened to thebc
function. Constraints that have a numeric argument are interpreted to hold at that timestep, and constraints that havet
as the argument are interpreted to hold over the whole interval.Needs:
minsol, maxsol
on the BoundaryValueDiffEq side for the whole-interval constraints, and codegen should handle inequality constraints.Cost Function
For optimal control, specified as a vector of expressions, gets codegened to a
cost
function.norm(x(t) - y(t))
is argument is interpreted as the integral norm,x(0.3)
is just the value.Needs:
integralnorm
, and codegen to cost function needs to be implemented in MTK.Coalesce
A function that takes the vector returned by a cost function and returns a scalar (or a vector in the case of multi-objective). Passed directly to the
ODESystem
constructor.To discuss?
Multiphase problems and minimum final time problems
The text was updated successfully, but these errors were encountered: