All Questions
Tagged with findminimum or mathematical-optimization
2,288 questions
0
votes
0
answers
22
views
Syntax to minimize function of a vector? [duplicate]
I have a linear function of 2 vectors, C1 and C2, that reproduces a rate, and I want to minimize the $\chi^2$ using observation data and uncertainties saved in variable S. Length of vectors C1 and C2 ...
0
votes
1
answer
61
views
Stable solution for constrained system of $c$ linear equations and $n>c$ unknowns
I have multiple cases of constrain linear systems with more unknowns than equations that will find a minimum depending on which equation is used as the objective function. Below is a minimum working ...
0
votes
1
answer
53
views
Constrained optimization with complex variables
I'm new to Mathematica so I'm sorry if my request will be stupid. I would like to find the minimum of the function $(|\alpha||\beta|-|\gamma||\delta|)^2$ with the constraints $|\alpha|^2 + |\beta|^2 + ...
2
votes
1
answer
123
views
Fastest way to approximate CDF in Mathematica
I need a very fast way to approximate the CDF of HypergeometricDistribution in Mathematica.
I need to evaluate it for very large ...
1
vote
0
answers
28
views
Is this a reasonable way to transform simple MSE loss function to weighted MSE for neural networks?
The idea is tested on a dataset with a clear outlier (see picture below)
...
3
votes
1
answer
147
views
How to model time series with Fourier series?
I want to apply Fourier series to a time series and then compare its estimates to the actual values. The data is related to the monthly rainfall of a city from 2000 to 2023. I used the following ...
4
votes
1
answer
163
views
Speeding up NIntegrate for some (simple?) trigonometry
I'm trying to determine the average distance you'd need to walk if you started at a point in a circle and walked to the edge of the circle, supposing I walked in a straight line and picked a random ...
1
vote
0
answers
43
views
How to Substitute a Metric into a Variation of the Action in Mathematica to Obtain Field Equations?
I have already calculated the variation of an action for a modified gravitational theory, and now I want to substitute a specific metric (e.g., the Schwarzschild metric) into this variation in ...
5
votes
1
answer
166
views
How can I find the minimum integrals faster?
Let 0 ≤ p₁ <p₂ <...p ≤1 be "n" separated points and let
$$L(x; p_k) = \frac{\prod_{j=1, j \ne k}^n (x-p_j)}{\prod_{j=1, j \ne k}^n (p_k-p_j)},$$
(1)
denote the well-known Lagrange ...
1
vote
1
answer
71
views
Problem solving constrainted integer problem with NMaximize
It seems that NMaximize fails to solve an instance of simple integer program. Any help on how to enhance the performance of NMaximize would be greatly appreciated.
...
0
votes
2
answers
110
views
How can I find the least value of a function with parameter?
With the function $f(x) = x^3 - 12 x + 2$. To find the least value of the function $f(x)$ with $-2\leqslant x \leqslant 2$, I tried
...
3
votes
0
answers
87
views
Optimising three variable to achieve a result
In the following, I want to adjust the values of a,b,c subjected to the condition ...
2
votes
1
answer
210
views
How can I find the integer numbers a, b, c so the total distances get minimum?
Let two points ptA = {1, 2, 3} and
ptB = {-2, 5, -3}. Find the point ptM on the plane has ...
0
votes
2
answers
105
views
Solving optimization problem by Lagrange method [duplicate]
I have an optimization problem as follows and I want to solve it with the Lagrange method. Is there a special command?
0
votes
1
answer
133
views
How to get last digit of an integer ended with (0 or 5) [closed]
Looking for algorithm
Integer Properties
Integer is ended with 0 or 5
Example: 64454542420, 83186482697426868635
Integer is very big.
Aim:
Want to get last digit of the integer. So result is 0 or ...
2
votes
0
answers
55
views
Scheduling optimization of workers and tasks based on a skills matrix over a fixed period
I'm seeking guidance on formulating a complex scheduling optimization problem in Mathematica. The goal is to allocate a team of 11 workers, each with varying levels of proficiency in 6 skills, to 93 ...
1
vote
0
answers
66
views
FindMaximum::nrnum: The function value is not a real number
I'm working on an optimization problem with three decision variables: n (shipment frequency), x (replenishment cycle in days), and g (preservation technology investment cost). To find the optimal ...
2
votes
4
answers
374
views
Finding a formula which involves iteration
Suppose I have the following set:
a = {0.338636, 0.422347, 0.449019, 0.477665, 0.533535, 0.541595, 0.573555, 0.578846, 0.601858, 0.609386};
And I need to find $r_i$...
3
votes
2
answers
160
views
Ensuring appropriate accuracy in integration over infinite sums
I would like to be able to evaluate, numerically, the function $f(n, a, w)$ shown below so that I can:
integrate $f(n, a, w)$ over the range $[0 \le p \le 1]$ for various positive integer $n < 50$ ...
0
votes
0
answers
93
views
The smallest area triangle containing a convex hexagon
Recently I came across that article
(Unfortunately, I do not have access to it at the moment.) and played on its theme.
Here are my trials. Let us consider a convex hexagon
...
0
votes
0
answers
32
views
Unexpected behaviour from NMaximize optimising a stochastic function
I have a complicated function whose output contains noise. I'm interested in Using Differential Evolution via NMaximize to solve it. However, NMaximize appears to compile or somehow 'freeze' the ...
4
votes
2
answers
209
views
Maximizing $\operatorname{Tr}(W)$ subject to orthogonality and linear constraints
I have $n\times d$ matrices $X$, $Y$, $n\le d$, and I'm interested in finding orthogonal $W$ with $\operatorname{Tr}(W)$ as large as possible subject to that $XW=Y$.
Is there a way to do this which ...
3
votes
4
answers
207
views
How to find extreme points of region from inequalities using Mathematica?
For the following inequalities how to find extreme points of the region using wolfram mathematica ?
$$ x_1 + 2x_2 + x_3 \le 5 \\ -x_1 + x_2 + 2x_3 \ \le 6 \\ x_1, x_2, x_3 \ge 0 $$
1
vote
1
answer
65
views
Underconstrained linear system, finding solution closest to $w_0\ne 0$?
How do I find solution of an under-constrained linear system in $\mathbb{R}^d$ that is closest to given reference $w_0$ in Euclidean distance?
Below is a solution that uses ...
1
vote
0
answers
59
views
Why does Reduce not work with Ceiling?
Consider the following code:
...
0
votes
0
answers
142
views
How to find the exact optimal bound
Is there any way to fix or revise this code to find the EXACT optimal bound, and could anyone help find the EXACT optimal bound? Thanks.
...
0
votes
0
answers
53
views
Is there any program using xAct to Solve Field Equations with Unknowns for a Given Metric?
I am considering solving any field equation with a given metric with unknown variables in it using xAct package in mathematica. Like in many cases, the Schwarzschild like solution holds:
$$ds^2=-B(r)...
-2
votes
3
answers
185
views
Question on the root [closed]
Is it true that the smallest root $t$ of the polynomial
$$
20 t^3 - 30 t^2 + (12 - 4 \cos^2 \alpha - 4 \cos^2 \beta - 4 \cos^2 \gamma) t + \cos^2 \alpha + \cos^2 \beta + \cos^2 \gamma - 2 \cos \alpha \...
0
votes
0
answers
30
views
Issue with solving an optimization model using FindMaximum and mismatch the result from a paper
I’m trying to solve an optimization model for growing items based on a paper that uses Excel Solver to obtain the optimal solution. The model has two decision variables: n (frequency of shipments) and ...
5
votes
4
answers
369
views
Finding the asymptotic rate of growth of a table of values
Suppose we define entropy[k] where:
...
3
votes
1
answer
152
views
Maximize finds solution outside the constraint
I'm trying to maximize a (quite simple) polynomial inside a sphere. The command is simply:
...
1
vote
1
answer
81
views
NMaximize::ntcnvx: The optimization was not solved by convex methods
I have a complex (but still finite-dimensional convex) program in mind for which I want to use Mathematica to solve numerically. For this reason, I was trying my hand on simpler instances. Consider ...
0
votes
1
answer
83
views
Speeding up NMaximize for an optimisation problem in thousands of variables
I am trying to find the set of parameters that maximize the log-likelihood $f(\mathbf{x}) = \ln P(G|\mathbf{x})$ in an graph-based optimisation problem.
I have an expression of the form $f(\mathbf{x}) ...
1
vote
2
answers
143
views
Find the global maxima over the interval [0,1]
I am trying to find the global maxima of this function
...
0
votes
1
answer
68
views
LinearOptimization fails to find minimum of mixed-integer problem
Consider the following setting:
...
1
vote
0
answers
56
views
How to plot potential function with Heaviside step function [closed]
How to plot $\frac{V(\varphi)}{V_{0}}$ with respect to $\frac{\varphi}{\varphi_{0}}$ for the following $V(\phi)$, where $\lambda_{0}=-1.0\times10^{-14},e=2.718,N_{UV}=15,g_{0}=0.0217,k=(16\pi^{2})^{-1}...
0
votes
2
answers
187
views
How to use Lagrange multipliers to find the maximum value with constraints?
How can the Lagrange multipliers method be employed to optimize the function?$f(x_1,x_2)=(x_1^p+x_1^p)^{1/p}$
subject to the constraint $g(x_1,x_2)=p_1x_1+p_2 x_2-y=0$
I am a beginner, and the results ...
0
votes
0
answers
51
views
Some functions keep on running endlessly on xTensor, xAct
I was trying to do some calculations to prove a few equations of the following paper https://arxiv.org/pdf/2004.08362 named "Derivation of regularized field equations for the Einstein-Gauss-...
3
votes
1
answer
250
views
FindInstance on a system with three variables keeps evaluating
I have been trying to find a set of parameters for a function that fit some constraints.
...
0
votes
0
answers
39
views
Making use of a threadpool in parallel computations
I have a user-defined function (implemented as a Module) that performs parallel computations with the application of ParallelDo[]. My function is to be minimized with the help of either FindMinimum[] ...
0
votes
0
answers
62
views
How do I implement the new VectorSymbol and MatrixSymbol with numeric data?
This post by @xzczd sent me down the rabbit hole trying to use numeric data with the portfolio optimization example in the Documentation for VectorSymbol
Here is the code in the documentation
...
0
votes
0
answers
38
views
Method Gurobi bug for NMaximize
Consider the following linear maximization problem. NMaximize using Method->Gurobi fails to include xs[4]=1 as a part of the solution. NMaximize using Method->Authomatic finds the correct ...
0
votes
1
answer
26
views
`NMinimize` provides wrong answer when `WorkingPrecision` is specified
I'm trying to use NMinimize to solve the 4th question of Hundred-dollar, Hundred-digit Challenge problems
What is the global minimum of the function
$\exp(\sin(50x)...
3
votes
0
answers
223
views
Box Scans in a Cartoon Warehouse
I used to be a package handler and was very slow at first. Part of the job was to find the appropriate barcode and then scan it.
I sped up a lot after realizing that if I grab opposite corners, then ...
1
vote
1
answer
83
views
Find the feasible solutions of a minimal path set of vectors
Finding the feasible solutions for vectors representing minimum paths based on the mathematical basis:
First example
I need to create the constraints according to equations (1) and (2) above:
...
1
vote
1
answer
66
views
NMaximize in Mathematica cannot find points that satisfy constraints
I have a strange behavior of NMaximize in Mathematica. In the following code, NMaximize cannot find points that satisfy constraints while 0 is an obvious point that satisfies. Could you help to ...
2
votes
0
answers
62
views
Minimum Distance to Fly to Each European Country
Help me plan my holiday. These are all my available flights that I can get on airline points. I'm trying to work out what is the shortest distance to travel if I want to go to each every European ...
1
vote
0
answers
43
views
TimeConstrained and optimization
I am trying to understand why wrapping TimeConstrained[] around optimization, e.g., MinValue[] can sometimes fail.
To reproduce ...
1
vote
2
answers
235
views
0
votes
0
answers
49
views
Checking whether a linear homogeneous system with m equations and n>m unknowns, has m unknowns that are sums with positive coefficients of the others
I call a "pseudo-linear", homogeneous system with m equations positively representable, if it has m terms that are sums with positive coefficients of the others. A class with precisely one &...