When testing different types of combinatorial constraints, I noticed that set_max_up_times does not work as intended. The function limits the total up-time over the entire prediction horizon instead of limiting the time after activation.
I created a simple example (Python code: PycombinaTestCombinatorialConstraints.zip):
t=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
b_rel=[0.9,0.9,0.8,0.7,0.1,0.,0.,0.7,0.8]
- No combinatorial constraints
b_bin=[1. 1. 1. 0. 0. 0. 0. 1. 1.]
J_CIA=4.0e-1
- Benchmark
binapprox.set_min_up_times([4,0])
b_bin=[1. 1. 1. 1. 0. 0. 0. 0. 1.]
J_CIA=7.0e-1
- Works as intended
binapprox.set_max_up_times([3,0])
b_bin=[1. 1. 1. 0. 0. 0. 0. 0. 0.]
J_CIA=1.9e-0
- According to the definition this should give the same results as 1, but this is not the case; the last two values are 0 instead of 1. This simple example indicates that set_max_up_times limits the TOTAL number of 1’s instead of per activation
binapprox.set_total_max_up_times([3,0])
b_bin=[1. 1. 1. 0. 0. 0. 0. 0. 0.]
J_CIA=1.9e0
- This gives the same result as 3, indicating that both functions lead to the same result.
When testing different types of combinatorial constraints, I noticed that
set_max_up_timesdoes not work as intended. The function limits the total up-time over the entire prediction horizon instead of limiting the time after activation.I created a simple example (Python code: PycombinaTestCombinatorialConstraints.zip):
t=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]b_rel=[0.9,0.9,0.8,0.7,0.1,0.,0.,0.7,0.8]b_bin=[1. 1. 1. 0. 0. 0. 0. 1. 1.]J_CIA=4.0e-1binapprox.set_min_up_times([4,0])b_bin=[1. 1. 1. 1. 0. 0. 0. 0. 1.]J_CIA=7.0e-1binapprox.set_max_up_times([3,0])b_bin=[1. 1. 1. 0. 0. 0. 0. 0. 0.]J_CIA=1.9e-0binapprox.set_total_max_up_times([3,0])b_bin=[1. 1. 1. 0. 0. 0. 0. 0. 0.]J_CIA=1.9e0