# Questions tagged [constraint]

The tag has no usage guidance.

108 questions
Filter by
Sorted by
Tagged with
50 views

### How to generate a large number of constraints for all indices ($\forall i$)

Is it possible to generate a set of constraints in the form "$\forall$". For example: \begin{align} \min\ & f\left(\sum x_i\right)\\ s.t.\ & \\ & x_i\geq 17 && \forall i=...
106 views

### Solving symbolic system of non-linear equations takes too long

I am trying to solve a set of system of symbolic non-linear equations: ...
50 views

### Nonlinearmodelfit with integral or nintegral as constrain

Until now I have been using the Nonlinearmodelfit without any issues, but I want to add a new constrain (Integral or NIntegral) to my modelfit. My fitting function is ...
38 views

### Help with NMinimize and setting limits

Im trying to minimize the error of a function Penality that i have defined and am using the following code. ...
78 views

### Global optimisation - Error bound on NMaximize?

Is it possible to obtain an error bound on NMaximize? e.g. convert the number returned by NMaximize into a rigorous upper bound ...
31 views

91 views

### How do I tell FindMinimum to only work with positive, real numbers?

I have a function that I'm trying to minimize. It currently works reasonably well with this: ...
32 views

### Maximising the minimum of a linear combination of polynomials

I have list of finArray of 6 rational polynomials, of degrees of about 4 to 6, in around 200 variables allVars, along with a ...
46 views

### Is it possible to use Reduce in a way that “eliminates” some unwanted variables, and only gives constraints between wanted variables?

Reduce[{x == z, y == z}] gives y == z && x == z but say I'm only interested in constraints that appear between ...
34 views

### Find parameter value for which sharply-peaked constrained 3d-integral equals 1

I want to find the value (desirably to high-precision) of the parameter $i$ for which the constrained 3d integration ...
35 views

### What happens when NMinimize constraints are unsolvable

I have an algebraic function in many variables which outputs a vector $v$. The coefficients of the vector are high degree polynomials in many variables. I want to maximize $\;v[] /Norm[v]\;$ ...
70 views

### Finding whether the convex cone from a vector list is null

Given a list of vectors, I want to find whether there exists a vector such that its dot product with those in the list is all (semi)positive, or at least above a certain small negative value.
123 views

### How to randomly generate a positive semidefinite matrix?

How would I randomly generate a positive semidefinite matrix? I'm aware how to generate a random $n\times n$ matrix with real values between -1 and 1 with ...
43 views

### Show, if possible, small isolated “islands” in the unit cube using RegionPlot3D

I have a certain three-dimensional constraint ...
66 views

### ArgMin over intervals and discrete sets

I was playing with ArgMin but I'm not sure how to use it for constrained optimization. For example, ArgMin[x^2, x] returns <...
45 views

### Find maximum of x given a bunch of constraints [closed]

Trying to find maximum of x given that '''0<=x<=3''' and some other stuff. This works fine: Clear[x, y] FindMaximum[{x, 0<=x<=3}, x] But this does ...
125 views

### Constraint of NDSolve with an integral of the solution

I'd like to use NDSolve and to make a constraint with an integral. For example, take the very simple : $$f'(x)=-f(x)/x_0$$ the solution is $$f(x)=f_0 e^{-x/x_0}$$ And $f_0$ is given by : \int_0^{+\...
105 views

### Optimize with constraints

I want to find the smallest $k$ such that $kx^2 \ge (\sin(x)-x)^2$ for all scalar $x\in[a,\ b]$? Obviously, I can do it analytically, but how can I do it (symbolically) in Mathematica? I am new to ...
34 views

### FindRoot with constraint that the variables are not equal

I have this system of equations : ...
25 views

### Establish a certain formula for a constrained integration over an ordered subsection of a 3-simplex

Some ten years ago, I convinced myself that the solution to this problem (although, it would seem, not carried out with this specific command then) ...
57 views

...
64 views

### NonlinearModelFit failing because varible range [closed]

I'm trying to fit a specific equation to a plot of points but its failing because the equation has a square root in it and I need to keep the values of x between a certain range. I know how to do this ...
460 views

### How to set a tolerance level for equality constraints

Given two equality constraints: x+y==250 and z+p==65 where x=190, y=50, z=45, p=15, I want ...
37 views

### Maximize violate constraint of non approximated function

here is my code Maximize[{-(10/17) - x + (20 (1 + x))/(17 (2 + x)), 0 <= x <= 1.5}, x] The result I got: {6.66134*10^-16, {x -> -9.79755*10^-16}} As you ...
251 views

### Problems with solving PDEs

I am using NDSolve to solve the two equations: ...
170 views

### Linear programming with lazy constraints

Does Mathematica offer any means for solving linear programming problems with "lazy constraints", as described e.g. here? While I am not very familiar with linear programming, my understanding of the ...
125 views

### Solving a stiff nonlinear ODE system

The system I am trying to solve is simple, but looks pretty stiff and I have unsuccessfully tried to solve it with StiffnessSwitching. It is the following one: <...
26 views

### Numerical Maximization with Alternating Sum

I need to maximize a function that involves an alternating sum and a set of constraints. I have tried the following code: NMaximize[{(-1)^{m}*n!, n + m == 7, m > 0, n > 0}, {m, n}] However, the ...
859 views

### RandomInteger with equal number of 1 and -1

I want to generate a list of random integers with only three values 1,0,-1. I know it can be done through RandomInteger[{-1, 1}, n]. How can I impose constraint on this list so that every integers in ...
58 views

### Constraining a parametric plot

I have the following parametric plot: ...
77 views

### Differential equation with some condition

I'm trying to solve a harmonic oscillator equation with a time-dependent (real) frequency, $v_k''(\tau) + \omega_k^2(\tau) v_k(\tau)=0$, where $\omega_k^2(\tau) = k^2 - \frac{2}{\tau^2}$. This ...