In MATLAB, if I have two vectors a=[a_1,..,a_n], b=[b_1,..,b_n]
, I can obtain another vector c = [a_1/b_1,..,a_n/b_n]
by a./b
. How can I achieve this in AMPL?
How can I do elementwise operation on parameter vectors in AMPL
160 Views Asked by z-one ng At
1
You can use something like this:
or alternately:
However, your ability to do this may be limited by the constraints supported by your solver, e.g. if you define a relationship that implies a nonlinear constraint while using a nonlinear solver.