math - Mathematical expression to check if value changed from 1 to 0 -
a - b 0 1 - new connection 0 0 - unchanged 1 1 - unchanged 1 0 - disruption
i'm working on industrial engineering modelling/coding project. facing data processing problem sample data above in gams code.
i need mathematical way of finding 1-0 patterns(which means disruptions in model). cannot use logical statements, if
, affect model , make non-linear.
i tried
sum(i,a(i)-b(i))
it returned 0 values cancelled each other. need pure mathematical expression detect disruptions. ideas?
edit:absolute value not acceptable.
answer: after few hours of playing numbers came following:
{ (a(i) + b(i)) - (a(i) * b(i)) - b(i) }
thanks contributions
ak - old values,
bk - new values
Comments
Post a Comment