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
187 Views Asked by z-one ng At
1
There are 1 best solutions below
Related Questions in AMPL
- Pyomo not loading solvers ('couenne', 'bonmin') from ampl
- AMPL not running
- Already defined variable in AMPL
- Pyomo: reading a three dimensional parameter from a .dat file
- AMPL Syntax Error - N is already defined, but i didnt define it
- IPOPT solutions in the wrong order
- AMPL code. Error: Where is the issue? mod or dat file?
- Gurobi 10.0.1: Error: Objective Q not PSD (negative diagonal entry)
- Why each retailer is buying the same amount of each product from each supplier when I write display QuantityPurchased;
- AMPL: How can I run a for loop in AMPL to perform a logical comparison?
- Assignnemt problem - Help to write simple constraint - AMPL
- AMPL / Python - Performance & Memory issue
- Unauthorised Solver using Couenne in AMPL IDE
- I am trying to solve Min Cost problem in AMPL, but my objective function is 0
- how to implement in AMPL unsplittable flow and origin and destination contraint for a flow?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
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.