# Tag Info

Accepted

### RandomInteger with equal number of 1 and -1

A combination of IntegerPartitions, RandomChoiceand RandomSample: ...
• 399k
Accepted

### Finding "nice" solution for under-determined system with constraint?

If I understand the question correctly, you wish to obtain a parameterized solution {U2[U1], W2[W1]} from the equation in the question, so that you can vary that ...
• 61.8k
Accepted

### Creating a random symmetric matrix with a particular rank

Documentation There is a ResourceFunction calledRandomMatrix contributed by Dennis M Schneider. The documentation reads For ...
• 36.9k
Accepted

### How do I plot a function subject to a constraint?

Try MeshFunction Plot3D[f[x, y], {x, -2, 2}, {y, -2, 2}, MeshFunctions -> Function[{x, y}, g[x, y]], Mesh -> {{0}}]
• 55.1k

### How do I plot a function subject to a constraint?

Or use RegionFunction and only display it's boundary. ...
• 77.9k
Accepted

### Solving for coefficients in a polynominal

Solve[ CoefficientList[(56 - 85689 x)^2 - 3136, x] == CoefficientList[-2 a b x + b^2 x^2, x], {a, b}] ...
• 1,808
Accepted

### NonlinearModelFit Returns Without Evaluating

The eighth data point is {2.18395, 4.16667} and the parameter tl starting value is 2.17. So, this data point will give a complex value for the starting parameter ...
• 12.6k

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

Numerically stable integrand First thing we have to do is make the integrand numerically stable, if we look at the vanilla expression ...
• 8,834
Accepted

### Constraint of NDSolve with an integral of the solution

Can be used ParametricNDSolveValue ...
• 46.6k

### Cutting a section from a sphere by planes

ClipPlanes does exactly what you need: You can use ClipPlanes in two different ways: (1) As an option to clip all the 3D ...
• 399k

### RandomInteger with equal number of 1 and -1

If you want to sample uniformly from all possible tuples that sum to 0, you can do the following: ...
• 131k

### How to set a tolerance level for equality constraints

You can use Congruent. ...
• 37.9k

### How to set a tolerance level for equality constraints

Some more ways, with the relative error e = 0.05: ...
• 239k

### Constraint of NDSolve with an integral of the solution

Knowing f[x]==FF'[x] you can expand your ode and solve without need of additional NMinimize. Only additional constraints ...
• 55.1k
Accepted

...
• 161k

### How to randomly generate a positive semidefinite matrix?

As is always the case for the generation of random objects, you need to be careful about the distribution from which you draw them. In the case of random positive semi-definite matrices I would try to ...
• 49.1k
Accepted

### How do I tell FindMinimum to only work with positive, real numbers?

This seemed to do the trick: ...
• 1,610

### How to find a numerical solution for a differential equation with constraints?

First hint: This side is "mathematica.stackexchange.com" (not python ;-) ) Second hint: Try to introduce a new function z[x]=Integrate[y[u],{u,0,x}] from ...
• 55.1k

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

Region @ RegionProduct[Disk[{0, 0}, 1/2, {0, Pi/2}], Line[{{0}, {1}}]] ...
• 399k
Accepted

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

I am not sure if I have full understand the problem. Here just provide a thinking. ...
• 77.9k
Accepted

...
• 77.9k
Accepted

### LinearOptimization - how to solve with vector constraints?

Note: I have assumed that $p_k = \delta^k(1-\delta)^{n-k}$, as in OPs code. Solution 1. One could use Minimize: ...
• 11.9k
Accepted

### How to define variables $a$,$b$,$c$,$d$ are all elements of set $\{2,3,5,7\}$?

And @@ Or @@@ (Thread[# == {2, 3, 5, 7}] & /@ {a, b, c, d}) ...
• 77.9k

### sum + Integral involving dirac delta function

There is no need for numeric techniques, this can be done analytically Sum[ Integrate[x^2 DiracDelta[x - n], {x, 0, 100}], {n, 0, 10}] (* 385 *) Since <...
• 161k
Accepted

### Solving a stiff nonlinear ODE system

The computation can be performed as follows. First, solve for {x, y} instead of {F, G}, because the ODEs are simpler, and then ...
• 61.8k

### Problems with solving PDEs

As noted in the question, the computation fails when v[x, t] >= 1. This is easy to fix by replacing (1 - v[x, t]) by ...
• 61.8k
Accepted

### How to set a tolerance level for equality constraints

ClearAll[choppedEqual] SetAttributes[choppedEqual, {HoldFirst, Listable}] choppedEqual[a_ == b_, c_] := Chop[N@(a - b)/a, c] == 0. Examples: ...
• 399k

### Optimize with constraints

Edit: I think you need MinMax. How about this? NMaximize[{(x^2 - 2 x Sin[x] + Sin[x]^2)/x^2, 4 <= x <= 5}, x] {1.48166, {x -> 4.49341}} So \$ k=1....
• 10.9k
Accepted

### Nonlinearmodelfit with integral or nintegral as constrain

Use ?NumericQ: ...
• 239k