51
votes
Accepted
MATLAB vs. Python in industry
Regardless of what completes the phrase "Python vs ...", the answer is always going to be Python.
Very few people who are serious about using optimisation in production use MATLAB, and the ones who ...
19
votes
MATLAB vs. Python in industry
I agree with everything Nikos said and I add some colors to some of the reasons:
Python is free and open-source but Matlab is not. Anyone can write codes in Python and share it with others who can ...
17
votes
MATLAB vs. Python in industry
Nikos Kazazakis and EhsanK have given you great reasons for using Python. I will focus on the point from you about needing to use an additional package/library in Python for matrix and vector ...
14
votes
MATLAB vs. Python in industry
I work for a company that offers a commercial optimization solver. The solver offers interfaces to both MATLAB and Python for solving problems defined in those languages.
We only get one or two ...
14
votes
Accepted
Solver rounding precision vs programming language rounding precision
Numerical stability (computations going sideways) and numerical tolerances are related but not identical. Floating point arithmetic being subject to rounding and truncation errors (unavoidably), every ...
10
votes
Accepted
Matlab fmincon for a problem with many nonlinear constraints
The problem might be @(x) in the first line of the function. Adding this creates an anonymous function, while MATLAB simply expects a numerical vector as output. ...
9
votes
MATLAB vs. Python in industry
MATLAB is a language built on top of a library.
Python (with NumPy & numba) is a language with a library built under it.
Neither is ideal. Like all languages, both have a few quirks, due to their ...
8
votes
MATLAB vs. Python in industry
I did my PhD on a topic involving numerical simulations of mechanical systems. I worked primarily in MATLAB, which I already had experience in and seemed to have some good 'out of the box' ...
8
votes
When should I use a solver for IP and MIP and can I just use a library from Python, R, Matlab, etc...?
I assume the solver you're referring to in Python/R/Matlab, are the open-source solvers such as CBC or GLPK (you can find out more in this question: Where can I find open source LP solvers?). If that'...
8
votes
Matlab fmincon for a problem with many nonlinear constraints
Following Kevin Dalmeijer's answer (Accepted), I found the following approach to solve the problem that I had. (composing this answer for future similar questions):
The general form of Fmincon ...
7
votes
Advantages of IBM CPLEX Studio over CPLEX in MATLAB?
Since you are asking from a MSc student's point of view and actually need to use CPLEX, I assume that your research mainly focuses on the applications of OR. Therefore, two things are required to be ...
7
votes
Accepted
What underlies intlinprog in MATLAB?
Mention of intlinprog, without further specification, generally means the intlinprog of the MATLAB Optimization Toolbox.
However, Gurobi also has a function called <...
6
votes
Solver rounding precision vs programming language rounding precision
(1) Numerical stability is a real issue but not so common in my area of discrete optimisation (for obvious reasons). I only get it in two cases. Sometimes I get preprocessed data that has been rounded,...
6
votes
MATLAB vs. Python in industry
I am geophysics professor and have been solving scientific computing problems in Matlab since 2000. In the last ~8 years graduate students have been preferring to work in Python. I have the following ...
6
votes
Accepted
MILP Minimum set Vertex cover coding by Python or MATLAB?
In Python, with pulp and networkx :
...
6
votes
Accepted
Is it possible to change the underlying field from Euclidean to $\mathbb{F}_p$?
Introduce an integer variable $y$ and replace the RHS with $k+py$.
5
votes
Accepted
Following code doesn't work in matlab with CVX
Use CVX's entr function.
$\sum_{i=1}^ 4x_i\ln(x_i)$ can be entered as -sum(entr(x))
...
5
votes
Branch and bound algorithm programming code
If you want to work inside Excel (or LibreOffice), you might look at OpenSolver. Google's OR-Tools includes the CBC solver and the option to use GLPK, SCIP or Gurobi. (Gurobi is commercial software ...
5
votes
Branch and bound algorithm programming code
Depending on the type of your MIP, there are numerous open-source options:
MILP: CBC
Convex MINLP: Bonmin
Non-convex MINLP: Couenne
All of the above: SCIP (free for academics)
5
votes
Branch and bound algorithm programming code
There are several open-source software packages that use branch-and-bound to solve integer programming, for example:
GLPK: https://www.gnu.org/software/glpk
CBC: https://github.com/coin-or/Cbc
5
votes
Transform nonlinear cost function to get LP or MILP
Assuming you meant $C=\max() - \min()$ instead of $C=\max() + \min()$,
you can introduce nonnegative variables
$X_\text{import}$ and $X_\text{export}$
and linear constraints
$$(P_\text{charge} + P_\...
5
votes
Accepted
Transform nonlinear cost function to get LP or MILP
Taking a different tack from Rob, I'm going to assume that the original objective function $C$ is correct as stated and is being minimized, with $C_\text{export}>0$ being a per-unit compensation ...
4
votes
When should I use a solver for IP and MIP and can I just use a library from Python, R, Matlab, etc...?
The main reasons are performance and quality of numerics. Non-professional stuff tend to lack the polish professionals spend time doing to ensure that numerical issues don't compromise the solving ...
4
votes
Matlab fmincon for a problem with many nonlinear constraints
You can specify many nonlinear constraints and objectives without having to define functions with the problem-based modeling approach starting with MATLAB R2019a. "Many" are those that are polynomial ...
4
votes
MATLAB vs. Python in industry
My first language I have learned was MATLAB. After learning C++ I realized MATLAB is bad for really learning about programming in such. I would recommend you also Python as language because it is ...
4
votes
MATLAB vs. Python in industry
Sounds like you are intending to build solvers. You will be better off in MATLAB. As you noted, matrix and vector operations are part of the language. You'll need matrix decompositions and maybe ...
4
votes
Accepted
How to normalize the objective functions of multi-objective optimization for a MPC?
The reason for minimizing fuel consumption is presumably to minimize fuel cost. If you can come up with a cost rate for travel time, then you can combine the two objectives into an overall cost ...
3
votes
Accepted
Why is the Lagrange Multiplier not equal the Shadow Price (Excel solver, Matlab linprog, Gurobi)?
If you look at the "allowable decrease" in the RHS of the highlighted constraint, it's zero. A number of the binding constraints have either allowable increase or allowable decrease zero. ...
3
votes
Accepted
How do I solve this Optimization problem?
Here is the model you can write using LocalSolver, our global optimization solver. Please note that LocalSolver is a commercial software like MATLAB. Nevertheless, you can benefit from free trial or ...
2
votes
MPS file generation
I am not an expert in YALMIP but you may check the saveampl(F,h,filename) command written in YALMIP website. An example of the implementation is given as:
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
matlab × 25optimization × 8
python × 6
linear-programming × 5
mixed-integer-programming × 4
cplex × 4
integer-programming × 3
solver × 3
gurobi × 3
nonlinear-programming × 3
convex-optimization × 2
sensitivity-analysis × 2
linearization × 1
scheduling × 1
algorithms × 1
graphs × 1
duality × 1
simplex × 1
pulp × 1
software × 1
multi-objective-optimization × 1
branch-and-bound × 1
gams × 1
simulation × 1
kkt-conditions × 1