Questions tagged [constraint]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
0answers
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=...
1
vote
1answer
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: ...
4
votes
1answer
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 ...
0
votes
0answers
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. ...
0
votes
1answer
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 ...
1
vote
0answers
31 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
79 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 ...
4
votes
1answer
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: ...
0
votes
0answers
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 ...
0
votes
2answers
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 ...
0
votes
1answer
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 ...
0
votes
0answers
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[[1]] /Norm[v]\;$ ...
1
vote
1answer
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.
5
votes
3answers
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 ...
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
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 <...
1
vote
2answers
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 ...
3
votes
3answers
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^{+\...
1
vote
2answers
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 ...
0
votes
0answers
34 views

FindRoot with constraint that the variables are not equal

I have this system of equations : ...
0
votes
0answers
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) ...
0
votes
1answer
57 views
0
votes
1answer
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 ...
4
votes
3answers
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 ...
1
vote
1answer
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 ...
5
votes
3answers
251 views

Problems with solving PDEs

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

Constraining a parametric plot

I have the following parametric plot: ...
0
votes
0answers
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 ...
0
votes
0answers
67 views

Perform a constrained integration over $[-1,1]^6--yielding a “separability probability”

To begin with, I have a set of three positivity constraints (ensuring the positivity of a certain (twelve-parameter) $6 \times 6$ "density matrix", denoted in the standard manner as $\rho$, namely, <...
0
votes
0answers
72 views

Approximate/estimate the ratio of two multidimensional constrained integrals

I have a hypothesis that a certain "qubit-qutrit separability probability" should assume the value $\frac{5}{3} \left(112 \pi ^2-1105\right) \approx 0.659488$. In its initial formulation, this is a ...
2
votes
3answers
208 views

Compute a certain “separability probability” via a constrained 4D integration over $[-1,1]^4$

I have employed the GenericCylindricalDecomposition command (applied to $6 \times 6$ "density matrix" positivity constraints) to compute the following expression ...
1
vote
2answers
74 views

Trouble finding a maximum of a constrained multivariate function

I have a multivariate function that I seek to maximize (ideally symbolically): The function has the form: $\frac{(-j*a)}{8 (-(b/2) - j (c-d-e)) ((j*b*c)/2 - (j*b*d)/2 + c*d - d^2 + a^2/4))}$ (...
4
votes
3answers
213 views

Cutting a section from a sphere by planes

I want to plot and find out the section of a sphere remaining after putting constraints in terms of cartesian planes. How it can be done? For example, if I have a sphere of $r = 1$, and I put the ...
0
votes
1answer
59 views

Guarantee a positive value for $a$ when using SolveAlways [closed]

SolveAlways[y - 3 - 4*(x - 1) == a*x + b*y + c, {x, y}] {{a -> -4, b -> 1, c -> 1}} But if I want to get the ...
1
vote
2answers
51 views

Define x as a multiple of a number as a constraint in the Maximize function

I am trying to optimize a linearly constrained Production Function. I have three inputs and want them all to be multiples of 150. I can make all the inputs to belong to the Integer Domain but is there ...
2
votes
1answer
75 views

Why is Reduce in Mathematica giving solution in other symbols that don't exist in original equation [closed]

Here is an example: Reduce[P/Q < (P - X)/(Q - X) && X > 0 && P > 0 && Q > 0 && P > Q, {X}, Integers] The solution ...
0
votes
1answer
83 views

Need a package to compute constraint structure

I want to compute constraint structure of some field theory and some gravitational field theory. By constraint structure I mean what is explained in the "Lectures on Quantum Mechanics" by P. A. M. ...
3
votes
0answers
56 views

How can I prevent ParallelTable[] from freezing?

I have spent some time trying to figure this out. I have a function that appears to be the reason my program is freezing. I am using both MemoryConstrained[] and <...
0
votes
1answer
82 views

Symmetric solution of ODE

Is it possible to force DSolve to calculate the symmetric solution? Obviously the ode x''[t] + x[t] == 0 has the symmetric solution ...
2
votes
2answers
139 views

“Forcing output of a function to be Real in Mathematica” Non-linear optimization

I am trying to solve a Nonlinear optimization problem with Mathematica. Since the maximization problem includes exponentiation with fractional power, the result generates the complex numbers that stop ...
2
votes
1answer
147 views

Intersection Mathematica and SMT

recently i started to investigate in SMT-solvers (SAT Modulo Theory), especially Z3. My interest is in using it as a constraint solver on mixed integer/boolean problems, with a spoonful of SAT. I am ...
3
votes
0answers
126 views

How to define a constraint implying covariant derivatives in XTensor/XAct?

I have two manifolds: M and M1 with metrics g and g1. ...
1
vote
1answer
29 views

Finding smallest domain within which variables can satisfy inequality

Given an arbitrary number of variables $\epsilon_i$ that can be picked from a domain $[0, W]$ and some inequality relation between all the variables $G(\epsilon_1, \epsilon_2, ...)$, is there some way ...
1
vote
1answer
122 views

Increasing accuracy of solving overdetermined linear system

I am given $48 \times 48$ matrix $A$ and a vector $b$ and I would like to solve system $Ax = b$. I know that $A$ is underdetermined, i.e. there exist many solutions for $x$. Due to some considerations,...
0
votes
2answers
418 views

Using Assuming for conditional expression in Solve

When I solve the following equation I obtain a solution with a conditional expression Solve[{0 == k Sin[x - y] - Sin[x], 0 == k Sin[y - x] - Sin[y]}, {x,y}] How ...