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!!

 Réponse acceptée

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 commentaire

Lenilein
Lenilein le 24 Sep 2019
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!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by