Hot answers tagged

53 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 ...
Nikos Kazazakis's user avatar
20 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 ...
EhsanK's user avatar
  • 5,864
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 ...
lvenhofen's user avatar
  • 321
16 votes
Accepted

Ideal programming language for an operations researcher

For modelling, mainly Python. Julia works too but is much less commonly used in companies. For dedicated algorithm implementations, mainly C++. C works too but will require more lines of code and ...
fontanf's user avatar
  • 2,623
15 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 ...
AsAGuest's user avatar
  • 151
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 ...
prubin's user avatar
  • 38.8k
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. ...
Kevin Dalmeijer's user avatar
10 votes

Ideal programming language for an operations researcher

I am an academic who works on large projects in OR & power systems. This involves a mixture of machine learning (ML), optimization, data-processing, simulations, and more data processing. Our ...
mtanneau's user avatar
  • 4,108
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 ...
Peter Todd Williams's user avatar
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' ...
charlzee's user avatar
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'...
EhsanK's user avatar
  • 5,864
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 ...
Oguz Toragay's user avatar
  • 8,642
7 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 ...
Marc's user avatar
  • 71
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 ...
Qian Zhang's user avatar
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 <...
Mark L. Stone's user avatar
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,...
Edward Lam's user avatar
  • 1,235
6 votes
Accepted

MILP Minimum set Vertex cover coding by Python or MATLAB?

In Python, with pulp and networkx : ...
Kuifje's user avatar
  • 13.2k
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$.
RobPratt's user avatar
  • 31.5k
6 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_\...
RobPratt's user avatar
  • 31.5k
6 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 ...
prubin's user avatar
  • 38.8k
6 votes

Ideal programming language for an operations researcher

This is an interesting debate. And key if you remember Sapir - Whorf theory ("linguistic categories influence perception") You may use an Algebraic Modeling Language like AMPL or OPL or GAMS ...
Alex Fleischer's user avatar
6 votes

Ideal programming language for an operations researcher

Gretzky: Skate to where the puck is going to be. Or in this case, pucks, Julia being one of the pucks.. Putting on my O.R. hat and viewing language usage as a dynamic system, Julia is on a ...
Mark L. Stone's user avatar
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)) ...
Mark L. Stone's user avatar
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 ...
prubin's user avatar
  • 38.8k
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)
Nikos Kazazakis's user avatar
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
Robert Schwarz's user avatar
5 votes

Ideal programming language for an operations researcher

Operations research covers a lot of territory. Most of the answers posted are oriented toward optimization, which is fine but a bit limited. For analytics / data analysis, the two most popular ...
prubin's user avatar
  • 38.8k
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 ...
Nikos Kazazakis's user avatar
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 ...
mcfenelon's user avatar
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 ...
Zaragesh's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible