-
Notifications
You must be signed in to change notification settings - Fork 0
/
concave_relaxation_of_original_RHS.m
26 lines (25 loc) · 1.19 KB
/
concave_relaxation_of_original_RHS.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This function evaluates McCormick concave relaxations for the original %
%RHS function f_i(t, p, x) (see Assumption 3 in the article) %
% %
%Last modified by Yingkai Song 08/18/2020 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function fcci = concave_relaxation_of_original_RHS(t,p,x,xL,xU,pL,pU,i,original_RHS)
%retrieve the number of state variables and uncertain parameters
nx = length(x);
np = length(p);
%preallocate vectors of McCormick objects
xMC(1:nx) = McCormick(0,0,0,0);
pMC(1:np) = McCormick(0,0,0,0);
%construct McCormick objects xMC of (x, xL, xU) and pMC of (p, pL, pU)
for j = 1:nx
xMC(j) = McCormick(xL(j),xU(j),x(j),x(j));
end
for j = 1:np
pMC(j) = McCormick(pL(j),pU(j),p(j),p(j));
end
%apply McCormick relaxation method to the original RHS and return the
%concave relaxation
fiMC = original_RHS(t,pMC,xMC,i);
fcci = fiMC.concave;
end