Questions tagged [constraint]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
76 views

Imposing constraints on any undefined symbol appearing in a matrix automatically

I want to know how can I can I tell Mathematica that all symbols that appear in an object, e.g. a matrix, obey certain constrains, without having to write these conditions by hand. More specifically, ...
user avatar
  • 517
0 votes
1 answer
42 views

How is Mathematica minimizing correlation exactly with linear constraints?

I made a random data matrix as data = Table[Random[], {i, 5}, {j, 5}]; In my case it was $$ \left( \begin{array}{ccccc} 0.951203 & 0.546669 & 0.86928 &...
user avatar
  • 1,028
2 votes
1 answer
61 views

How to find constrains on variables that make a system of inequalities not have a solution

My problem is as follows: How do I ask Mathematica the following question. Let $f(x,y,z,a,b)$ be a 5 variable polynomial. I want to find all values of $a,b$ for which $f$ has no zeros in the region $...
user avatar
  • 553
1 vote
1 answer
163 views

Find right end-point satisfying an integral constraint

I am solving the following system of first-order ODEs with a variable right-end point l1num and boundary condition at that point ...
user avatar
0 votes
1 answer
122 views

Can this previously solved three-dimensional constrained integration also be solved with certain added products in the integrand?

In Solved3DConstrainedIntegration the constrained three-dimensional (Hilbert-Schmidt-metric-based HSmetric) integration problem for the absolute separability probability of the two-qubit (quantum bit)...
user avatar
2 votes
1 answer
67 views

Constrained Optimization with Interpolating Functions

My goal is to use a gradient descent type method to maximize interpolating function1 with respect to the constraint that interpolating function2 <= 0.5. I am working with 4D data (please see below)....
user avatar
2 votes
2 answers
200 views

Draw a (1/4) partial 3D cylinder in a quadrant

Here is a code to draw a full cylinder $\theta \in [0, 2\pi)$: Graphics3D[Cylinder[{{0, 0, 0}, {1, 0, 0}}, 1/2]] My question is that how do we draw a 1/4 of the cylinder, such that it only appears in ...
user avatar
  • 823
0 votes
0 answers
38 views

Generating iteration and constraint lists dynamically

I have a model for which I want to perform a set of calculations with successively deeper iterations and more constraint. In other words for a given value of a Do iterator, n, I want to: perform a ...
user avatar
  • 201
0 votes
1 answer
203 views

Equation of motion through the Lagrangian with Lagrange multipliers

I ask for advice, I'm a little confused. I have such a Lagrangian. $L=\frac{1}{2}m(\dot{x}^2+\dot{y}^2)-\lambda(2x^2+3y^2-1^2)$ Here $\lambda(2x^2+3y^2-1^2)$ is the constraint on the phase variables. ...
user avatar
  • 1,636
3 votes
2 answers
79 views

How do you make two interactive sliders dependent on eachother?

I have this code. Definition of q is: ...
user avatar
2 votes
1 answer
95 views

use of parametric ndsolve with a constraint

I want to solve differential equation $$ \frac{y''[x]}{(1+y'[x]y'[x])^{3/2}} = -a -y[x]/ \sqrt{2} + x/ \sqrt{2} $$ subject to boundary condition $y(-1) = y(1) = 0$ for some value of $a$. $a$ is found ...
user avatar
  • 123
0 votes
0 answers
34 views

Matrix modification with constraint on it

$q$ is a real antisymmetric matrix and can be defined as: ...
user avatar
  • 1,163
3 votes
2 answers
116 views

Creating a matrix of dimension d with constraints on indices

Is there a way to create a matrix $q$ of dimension $d$ with constraints on the indices given by: $$d\longrightarrow dimension$$ $i,j $ are indices $$q_{i,j}=\begin{cases} -b & j=i+d,\\ c & j=...
user avatar
  • 1,163
1 vote
1 answer
72 views

How to enforce constraints on matrix equations for unknowns to have only one non zero element per row?

I am trying to find a nice and efficient way to approach the following problem: I need to solve (for example using Solve, Reduce, or NSolve) certain type of equations involving a set of unknown square ...
user avatar
  • 517
0 votes
1 answer
58 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_{...
user avatar
  • 107
1 vote
0 answers
42 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 ...
user avatar
1 vote
1 answer
66 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 ...
user avatar
  • 113
0 votes
0 answers
56 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 ...
user avatar
  • 1,636
0 votes
2 answers
102 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}} ...
user avatar
  • 179
2 votes
2 answers
126 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....
user avatar
1 vote
3 answers
127 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 ...
user avatar
  • 13
2 votes
1 answer
92 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 &...
user avatar
  • 215
2 votes
2 answers
84 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 ...
user avatar
  • 8,648
0 votes
1 answer
93 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) $$ ...
user avatar
  • 11
2 votes
1 answer
111 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 ...
user avatar
1 vote
1 answer
34 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 ...
user avatar
0 votes
0 answers
35 views

Bug with ValueQ involving fractions? [duplicate]

Expected behavior: ClearAll[f]; ValueQ[f[1]] False Unexpected behavior: ...
user avatar
  • 699
0 votes
1 answer
100 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 ...
user avatar
2 votes
1 answer
133 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 ...
user avatar
1 vote
2 answers
183 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 ...
user avatar
1 vote
1 answer
115 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 ...
user avatar
  • 2,633
0 votes
2 answers
60 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 ...
user avatar
  • 1
2 votes
3 answers
394 views

Evaluate a certain three-dimensional constrained integral

The result of the three-dimensional integration ...
user avatar
2 votes
0 answers
63 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=...
user avatar
  • 181
2 votes
1 answer
163 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: ...
user avatar
4 votes
1 answer
64 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 ...
user avatar
  • 43
0 votes
1 answer
102 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 ...
user avatar
1 vote
0 answers
46 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\...
user avatar
  • 11
0 votes
1 answer
55 views

Should I believe this numerical trivariate integration result involving Liouville's constant to fifteen decimal places?

I have two constraints ...
user avatar
1 vote
1 answer
121 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 ...
user avatar
  • 902
5 votes
1 answer
160 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: ...
user avatar
  • 1,481
0 votes
0 answers
41 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 ...
user avatar
0 votes
2 answers
102 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 ...
user avatar
0 votes
1 answer
43 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 ...
user avatar
0 votes
0 answers
46 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]\;$ ...
user avatar
1 vote
1 answer
87 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.
user avatar
6 votes
3 answers
280 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 ...
user avatar
1 vote
1 answer
49 views

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

I have a certain three-dimensional constraint ...
user avatar
1 vote
1 answer
213 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 <...
user avatar
  • 125
1 vote
2 answers
65 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 ...
user avatar
  • 847