Questions tagged [constraint]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
40 views

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

I have a certain three-dimensional constraint ...
1
vote
1answer
48 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
43 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
113 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
103 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
31 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
35 views
0
votes
1answer
63 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
429 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
36 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
240 views

Problems with solving PDEs

I am using NDSolve to solve the two equations: ...
12
votes
0answers
149 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
114 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
23 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
852 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
52 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
66 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
69 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
202 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
68 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))}$ (...
3
votes
3answers
177 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
55 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
49 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
70 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
80 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
51 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
74 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
137 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
122 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
113 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
27 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
91 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
297 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 ...
3
votes
1answer
522 views

Fitting a Multi-Exponential Decay With Constraints

I am having trouble finding a way to fit my data in Mathematica to a multi-exponential decay, with the critical condition that all contributions to the decay sum to 1. To start, I can fit my data to ...
0
votes
0answers
42 views

Constructing constraints from a list [duplicate]

I want to use FindMinimum to minimize some functional, say f[argList_] = Total[argList^2] Now the variables over which to ...
1
vote
1answer
67 views

Assignment to slots with inequality constraints

Suppose that I have a table A with each of its n columns corresponding to an "individual" and each of its m rows corresponding to a "task". The element of the jth ...
0
votes
1answer
145 views

RegionFunction with equalities?

Can we use RegionFunction with Plot3D for equalities? This answer (Plot multivariable function with constraints) has shown the use of RegionFunction with inequalities, but the same commands don't work ...
2
votes
1answer
226 views

Solving for coefficients in a polynominal

I've the following problem: how can I solve for the coefficients in a polynominal? So, I mean the following: I've the following expression: $$\left(56-85689\cdot x\right)^2-3136\tag1$$ And I ...
1
vote
0answers
38 views

Solving some constraints on a subgroup of a Lie group [closed]

Let $M$ be a rank-3 matrix, I am interested in searching all the group elements $g \in$ SU(3) Lie group, such that, $$ g^T M g =M. $$ Example 1. Let $$ M[1]= \left( \begin{array}{ccc} 0 & 1 &...
2
votes
2answers
117 views

Robust pattern matching for functions obeying quadratic constraints

I have a function, br, that takes multiple integer arguments (which for syntactic ease I collect in a list) and is Antisymmetric in any two arguments: ...
0
votes
1answer
76 views

Finding the optimum value of a variable subject to a nonlinear constraint

I want to know whether or not the objective function I have defined is correct. The nonlinear constraint has to be satisfied while ζ varies from 0 < ζ <= 1/2. This is the first time I am trying ...
4
votes
3answers
733 views

Solving equation with constraints [closed]

Given the following set of equations: vEq = v == Pi (L R^2 + 1/12 L^3 Tan[Alpha]^2) oEq = o == 1/2 Pi (4 R (L + R) + L^2 Tan[Alpha]^2) I can solve this with <...
0
votes
1answer
66 views

Constraints thread over lists, for NMinimize

I have the following code ...
1
vote
0answers
53 views

Help generate useful solutions with Solve

I have the Equations for converting between cartesian and spherical polar coordinates eqns = {u*Sin[v]*Cos[w], u*Sin[v]*Sin[w], u*Cos[v]} == {x, y, z}; when I ...
0
votes
1answer
104 views

Solving a System with some Row Sum Constraints

My question is about solving a linear solving system with variables $m_{i,j}, 1\le i \le 20, j\le 1\le 10$ with (1) nonnegative entries, (2) zeros in prescribed locations, (3) given row sums. I'd ...
1
vote
0answers
71 views

Large Deviations on Mathematica

I am not an expert with Mathematica, and I really need your help. I am trying to do some large deviation theory with Mathematica and I have to minimize a piecewise function. How do I minimize a ...
3
votes
1answer
94 views

Finding the slowest decay to a value for a 2D function

I have a function acf2[x,y] that describes the auto-correlation function of a simulated real surface, with a peak at the origin (...
2
votes
1answer
124 views

Specify a domain of inversion for an inverse function

I'm playing around with some functions related to the Lambert W Function. Namely those of the form: $$W(x;a) = f^{-1}\left(x \left( e^{x} - a\right) \right)$$ And when $a$ gets too large, ...