Tag Info

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 ...
• 11.2k

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 ...
• 5,756

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 ...
• 311

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 ...
• 141
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 ...
• 31.1k
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. ...
• 5,893

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 ...

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' ...
• 81

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'...
• 5,756

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 ...
• 8,340

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 ...
• 512
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 <...
• 11.2k

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,...
• 1,225

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 ...
• 61
Accepted

MILP Minimum set Vertex cover coding by Python or MATLAB?

In Python, with pulp and networkx : ...
• 10.4k
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$.
• 22.7k
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)) ...
• 11.2k

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 ...
• 31.1k

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)
• 11.2k

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
• 2,275

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_\...
• 22.7k
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 ...
• 31.1k

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 ...
• 11.2k

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 ...

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 ...
• 41

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 ...
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 ...
• 31.1k
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. ...
• 31.1k
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,717