# Tag Info

Accepted

### Markov (Chain) image generators?

I've implemented this recently, basically it counts how many times each specific colour borders another colour to make up a frequency table. To generate an image, a random colour and position are ...
• 226

### Constrained simulated annealing

Simulated annealing comes from computations in statistical mechanics. When I think of simulated annealing, I very much think in terms of physics: I want to minimize some potential energy function that ...
• 603
Accepted

### Solving constrained odes's using inbuilt solvers in Matlab/Octave

Yes you can. If the term that multiplies $N$ is never zero, then $N$ is an algebraic variable of index 1. Its combination with the ODEs on $x$ yields a system of differentiel-algebraic equations (DAEs)...
• 1,943
Accepted

Accepted

### Is there a way to bound the values of a variable when using scipy.integrate.solve_ivp in python?

If the exact solution indeed stays within [0,1], the solver may still resolve too coarsely the dynamics and "jump" over the physical bounds. One way to solve this is to use lower absolute ...
• 1,943
Accepted

### Constraint programming problem with conditional constraints and some unknown indicator variables

You should have a look at Satisfiability Modulo Theories or SMT for short. A huge number of problems can be thought of as instances of SMT for a particular theory. For example, correctly designing ...
• 10.4k
1 vote

### Defining a soft constraint in cvxpy

EDIT: Intermediate solution ...
1 vote

### Markov (Chain) image generators?

Blog post on an experimentation using Markov to recreate art: https://magenta.as/using-machine-learning-to-make-art-84df7d3bb911 Code is on github made by @william-index: https://github.com/william-...
1 vote

### Newton's method with box-constraints

You should put "mirrors" to bracket your domain. For example, in a one-dimensional case: If I know that my unknown $x$ is bounded between $0$ and $a$. At each iteration of my method, i will check if ...
1 vote
Accepted

### Eigenvalue problem constrained with a penalty method

I found the error, I just need to constrain the implied identity matrix on the right-hand-side too: ...
• 121
1 vote

### Simple methods for solving 2D steady incompressible flow?

Ironically, there is an iterative method called "SIMPLE" (semi-implicit method for pressure-linked equations) designed to resolve the steady state navier-stokes equations based on a predictor-...
• 12.1k
1 vote

### Simple methods for solving 2D steady incompressible flow?

With the continuity eqn only, you are missing all the mechanical balance: viscous and/or inertial effects will decide of the streamlines of such a flow. If your major aim is to keep it as simple as ...
• 362
1 vote

### How to handle the quadratic constraint $x y \leq z$?

To me it looks you are dealing with a standard Geometric Program (GP) which can be handled easily by commercial solvers (see e.g. https://www.cvxpy.org/tutorial/dgp/index.html)
• 111
1 vote

### How to handle the quadratic constraint $x y \leq z$?

If this is the only relevant part of your problem, you can write this as a semidefinite program. Since $x_1, x_2$ do not appear individually you can treat it as a square of a positive number then your ...
• 393
1 vote

### Nonlinear least squares with box constraints

The R minpack.lm CRAN package provides a Levenberg-Marquardt implementation with box constraints. In general, Levenberg-Marquardt is much better suited than L-BFGS-B for least-squares problems. It ...
• 121
1 vote

### Nonlinear least squares with box constraints

(Years later) two solvers that handle box constraints: Scipy least_squares has 3 methods, with extensive doc: 'trf’: Trust Region Reflective 'dogbox' 'lm': a legacy wrapper for MINPACK, without box ...
• 932

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