Questions tagged [constraint]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
30 views
0
votes
1answer
60 views

NonlinearModelFit failing because varible range [on hold]

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
387 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
35 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
221 views

Problems with solving PDEs

I am using NDSolve to solve the two equations: ...
12
votes
0answers
131 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
88 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
17 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 ...
3
votes
1answer
186 views

Simple Solve[{y == 5 + 2 x + x^a}, {x}] not working?

I am trying to find a general expression for x, for the following equation y = 5 + 2 x + x^a, but Solve cannot accomplish this. ...
6
votes
4answers
836 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
44 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
60 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
66 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
196 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
66 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
159 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
53 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
46 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
65 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
79 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
45 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
66 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
130 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 ...
1
vote
1answer
96 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 ...
2
votes
0answers
92 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
25 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
76 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
169 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
342 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
34 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
61 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
134 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
200 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
36 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
116 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: ...
2
votes
1answer
51 views

The maximum value under the condition of complex constraint

Let a<0, (3x^2+a)(2x+b)>=0 be permanent established on (a, b), and what is the maximum value of b-a? Code 1 ...
0
votes
1answer
70 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
652 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
62 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
93 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
91 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
105 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, ...
1
vote
1answer
188 views

Constraints of vector element in FindMinimum

I try to find the local minimum of a function $$\Pi(\vec{d})$$ where $$\vec{d} = (d_1,d_2,...,d_n)$$ should satisfy $$d_i>0$$ for $i \in [1,n]$. I use the ...
0
votes
1answer
189 views

Minimizing with constraints

I would like to minimize the following function with respect to x: f[x_] := b/Sqrt[x] + ( 4.5 c x^6 Log[x] )^(1/3) where b ...
2
votes
1answer
341 views

how to find a function that minimizes the other function with a known function

The problem that i am facing is that of energy minimization. I have a function called totalenergy which is sum of two functions the elastic energy and the surface ...
2
votes
2answers
272 views

LinearFit, are constraints possible?

...
0
votes
1answer
170 views

NonlinearModelFit Returns Without Evaluating

When running NonlinearModelFit on certain functional forms, the method just returns the input expression without evaluating. For example: ...