linear ODE as a constraint within an milp problem

Good Morning,
I have a syntax question regarding a milp problem that I would like to solve with intlinprog function:
My objective function that I would like to minimize is f = 2 x1 + 3 x2 where x1 and x2 are binary variables.
Furthermore,
y01 = 5 x1 & y02 = 5 x2
where y01 and y02 are the initial conditions used to solve following first order linear ODE system:
dy1/dl = -a0 & dy2/dl = b0
y1 and y2 over whole interval L are calculated by iterational solving of the ODE system using ODE45 (since the parameters a0 and b0 are different on each small interval)
Now I have a constraint which is C sum(y1) + D sum(y2) < 100.
Following documentation it is easy to define the objective function and the binary variables:
f=[2;3];
intcon=1:2
However now I have no idea how to integrate the solving of the ODE routine into the constraint expression.
Can you give some hint?
Thanks!!

 采纳的回答

Well, I take it that a0, b0, C and D are known constants, so the ODEs have trivial analytical solutions
y1=5*x1-a0*l
y2=5*x2-b0*l
and so the constraint reduces to a simple linear inequality
C*(5*N*x1-a0*sum(l)) + D*(5*N*x2+b0*sum(l))<=100

1 个评论

Thank you Matt! I realized I had simplified the problem too much after posting it. Will try to express it again in a new post!

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Mathematics 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by