linear ODE as a constraint within an milp problem
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Lenilein
el 24 de Sept. de 2019
Comentada: Lenilein
el 24 de Sept. de 2019
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!!
0 comentarios
Respuesta aceptada
Matt J
el 24 de Sept. de 2019
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Solver-Based Nonlinear Optimization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!