Questions tagged [constraint]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
48 views

Maximization under constraints / find maxima

I am trying to code the following maximization program that I am not able to solve algebraically (Of course I manage to get the first derivative, but struggle finding its root): $\begin{equation} Max_{...
1
vote
0answers
31 views

Find the ratio of two volumes of 6 x 6 positive-definite symmetric matrices

Consider the class $A$ of $6 \times 6$ positive definite matrices with real entries and unit trace (that is, the sum of the six diagonal entries is 1). (In quantum information-theoretic parlance, this ...
1
vote
1answer
53 views

Control evaluation for functional constraints

I'm trying to understand how to use Mathematica to find a solution subject to constraints, where one of the constraints is specified as a predicate function. But I don't know how to control evaluation ...
-1
votes
0answers
26 views

Approximating polynomial under monotonicity constraint [migrated]

Given a bivariate data set, how does one obtain the most accurate least-squares polynomial approximation under the constraint that the resulting polynomial is non-decreasing. Similarly, how does one ...
0
votes
0answers
52 views

Construction of Navigation Function: Error

https://en.wikipedia.org/wiki/Navigation_function https://www.sciencedirect.com/science/article/abs/pii/S0921889015302451 https://arxiv.org/pdf/1605.00638.pdf - Paragraph III I am trying to create a ...
0
votes
2answers
101 views

listing of vectors satisfying some special constraint

We have list = {{1, 1, 0}, {1, 0, 1}, {0, 1, 1}, {-1, 1, 0}, {1,-1, 0}, {-1, -1, 0}, {-1, 0, 1}, {1, 0, -1},{-1, 0, -1},{0, -1, 1},{0, 1, -1},{0, -1, -1}} ...
2
votes
2answers
109 views

FindMinimum with constraint produces incorrect results

Issuing the following: FindMinimum[{x, ((2 x + 1)/(3 x - 2))^(4 x - 3) <= 10^-10}, {x, 2}] produces a value of 13.1686 . The constraint for that value is: 1....
1
vote
3answers
122 views

Maximize - Non binding constraint is changing the result

When I add a non-binding constraint to a maximization problem the result changes. I don't understand why. Below you can find the code that I am using. For the maximization A, H = 6837.66 For the ...
2
votes
1answer
43 views

In NMinimize, how to incorporate constraints on positive semidefiniteness of a matrix which is not the matrix variable being optimised?

The problem I want to solve the following problem for symmetric matrix $X$: $$ \begin{aligned} \min_{X\succ 0} \; & -\log(\det(X)) & \\ \text{subject to} \; & \begin{pmatrix} X &...
2
votes
2answers
59 views

Calculate the Viswanath's constant (Random Fibonacci sequences)

How Can I calculate first few digits of Viswanath's constant? Viswanath’s constant ≈ 1.1319882487943 is a real number whose nth power approximates the absolute value of the nth term of some random ...
0
votes
0answers
37 views

Constraints and Tolerance

So I'm running NMaximize for optimizing a value and for constraints, I need the parameters to belong to a discrete set of elements. Basically, the constraint looks ...
0
votes
1answer
61 views

How to find a numerical solution for a differential equation with constraints?

I want first to apologize for my poor english level ^^ Let me present my issue. I want resolve numerically (I use Python) for x in [0;1] the following differential equation : $$dy/dx = a(y - y^2) $$ ...
2
votes
1answer
104 views

Verify a conjectured formula for a modification of a 3D constrained integration successfully solved using Mathematica

I've acquired somewhat indirect--and not fully conclusive--evidence that the solution of a certain three-dimensional constrained integration takes the form ...
1
vote
1answer
28 views

Plotting 3D region depending on 2 parameters with constraints

I'm trying to plot the full range that a set of estimates gives. They depend on some parameters and conditions, but I haven't been able to to it effectively with RegionPlot3D. Here is the set that I ...
0
votes
0answers
35 views

Bug with ValueQ involving fractions? [duplicate]

Expected behavior: ClearAll[f]; ValueQ[f[1]] False Unexpected behavior: ...
0
votes
1answer
93 views

Find the probability (relative volume) of a certain 4-ball with respect to Hilbert-Schmidt measure

Let us consider the set of points {x,y,z,1-x-y-z} and impose the strict ordering constraint ...
2
votes
1answer
87 views

Solving an equation with a constraint involving not-equal

I am trying to solve an equation with a constraint involving not-equal. For example: $2 x + 3 y = 5$ with the constraint $2 x + 4 ≠ 2$. How should I approach this? Edit 1 I tried the suggestions in ...
1
vote
2answers
174 views

Confirm and possibly simplify a 2009 result for a 2D constrained integration

This is a direct descendant of two other recent questions, 3D and Equivalence, both of which have been answered in skillful, interesting manners. (See also the comment [actually answer] of JimB to ...
1
vote
1answer
55 views

How to force LinearModelFit to return Non-negative coefficients?

LinearModelFit[{m,v}] will return a coefficients list $\beta$ from the design matrix $m$ and response vector $v$, where $m.\beta$ is fitted to $v$. However, the ...
0
votes
2answers
48 views

FindMaximum under binary constrains

I'm trying to find a maximum for a function whose variables have binary values (either -1 or 1). The clumsy code for that constraint I use is shown below. There must be a more compact code, and I ...
2
votes
3answers
358 views

Evaluate a certain three-dimensional constrained integral

The result of the three-dimensional integration ...
0
votes
0answers
38 views

Maximization by imposing an asymptote constraint

I am trying to plot the profit curve for optimal e(or effort) with respect to c. ...
3
votes
0answers
58 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=...
2
votes
1answer
126 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: ...
4
votes
1answer
58 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 ...
0
votes
1answer
97 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 ...
1
vote
0answers
40 views

Tackling variational problem with constraints [closed]

I need to minimize (preferably symbolically) functional with constraints: $$ F = \int_{0}^{\pi/2} f(x)cos{x}dx\,\\ 1.1 \geq f(x) \geq 0\\ 2.\int_{0}^{\pi/2} f(x)dx=Const\\ 3. f(0) =1\\ 4.f(\pi/2) = 0\...
1
vote
1answer
93 views

Constrained NDSolve

Consider n particles constrained on the surface of a unit sphere. $i^{th}$ particle experiences a force from every other $j^{th}$ of the form $$\vec{f_{ij}}=\frac{k ...
5
votes
1answer
121 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: ...
0
votes
0answers
38 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 ...
0
votes
2answers
90 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 ...
0
votes
1answer
40 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 ...
0
votes
0answers
37 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[[1]] /Norm[v]\;$ ...
1
vote
1answer
81 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.
5
votes
3answers
211 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 ...
1
vote
1answer
43 views

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

I have a certain three-dimensional constraint ...
1
vote
1answer
137 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 <...
1
vote
2answers
50 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 ...
3
votes
3answers
179 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^{+\...
1
vote
2answers
109 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 ...
0
votes
1answer
136 views
0
votes
1answer
66 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 ...
4
votes
3answers
508 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 ...
1
vote
1answer
42 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 ...
5
votes
3answers
282 views

Problems with solving PDEs

I am using NDSolve to solve the two equations: ...
12
votes
0answers
208 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 ...
3
votes
1answer
171 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: <...
1
vote
1answer
35 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 ...
6
votes
4answers
873 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 ...