# Questions tagged [constraint]

The tag has no usage guidance.

133 questions
Filter by
Sorted by
Tagged with
176 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 ...
36 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 ...
126 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. ...
74 views

### How do you make two interactive sliders dependent on eachother?

I have this code. Definition of q is: ...
50 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 ...
32 views

### Matrix modification with constraint on it

$q$ is a real antisymmetric matrix and can be defined as: ...
106 views

71 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 ...
45 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 ...
67 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)$$ ...
106 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 ...
32 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 ...
35 views

### Bug with ValueQ involving fractions? [duplicate]

Expected behavior: ClearAll[f]; ValueQ[f] False Unexpected behavior: ...
98 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 ...
100 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 ...
178 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 ...
74 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 ...
52 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 ...
367 views

### Evaluate a certain three-dimensional constrained integral

The result of the three-dimensional integration ...
61 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=...
131 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: ...
61 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 ...
101 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 ...
43 views

139 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: ...
40 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 ...
95 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 ...
41 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 ...
39 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[] /Norm[v]\;$ ...
83 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.
231 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 ...
46 views

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

I have a certain three-dimensional constraint ...
168 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 <...
54 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 ...
211 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^{+\...
110 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 ...
193 views

...