Questions tagged [mathematical-optimization]
Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.
2,311 questions
4
votes
0
answers
76
views
Why doesn't NMaximize handle this improper function definition?
First, consider this toy example:
expr = (1 - x)/(x^2 + y^2);
Clear[f];
f[x_?NumericQ, y_?NumericQ] := expr
"Wait, this function definition is wrong! "...
1
vote
1
answer
83
views
Extreme Points - Parameter Changes and Table
I want to simulate extreme points and illustrate results with exogenous parameters and optimal values. I created the input table and table with the optimization problem.
My initial one with a 3x15 ...
1
vote
2
answers
122
views
Minimization of a numerical model function
I have a simple model coded as a function mod[x], which returns a single value. Inside of the model I solve a.o. a small system of linear differential equations, with x being one of the coefficents. ...
0
votes
1
answer
67
views
Why is there a difference between matrix form input and list input for calculating the Jacobian matrix?
Why do different forms of input for calculating the Jacobian matrix yield different results, and the first result seems very similar to the second result?
The following is the input in matrix form:
<...
1
vote
1
answer
167
views
How to get NMinimize to work properly
I am encountering difficulties with the nonlinear least-square fitting process used to get an approximate analytical formula and would greatly appreciate any advice or suggestions to solve this issue.
...
4
votes
1
answer
193
views
Computing gcds of polynomials
I am new to Mathematica and need help writing a code to check counterexamples for the following conjecture about the GCD of Faulhaber polynomials.
In this question I made this conjecture Let $ f_n $ ...
1
vote
0
answers
108
views
Possible ways to increase the speed of integral calculations
The code below is used to calculate the matrix elements He. However, the calculation of each element takes a very long time.
Question: How can the speed of these ...
0
votes
0
answers
77
views
Minimizing a non-algebraic equation
I need to minimize this equation over $η$ in Mathematica:
$$I(ω)=\inf I(η,j), \quad {j=ωη}$$
that:
$$I(η,j) = η\ln η+(1−η)\ln(1−η)−η\ln r−(1−η)\ln(1−r) + [(j−μ)^2]/4$$
with condition ${j=ωη}$ and ...
9
votes
2
answers
634
views
Chess Piece Movement and Pathfinding in Grids
In an $ n \times n $ grid, we define: The chess piece starts from the initial square and can only move up, down, left, or right to adjacent squares in each move. It cannot move outside the $ n \times ...
1
vote
0
answers
57
views
Weird Result when Minimizing
constraints = {A >= 0, B >= 0, A + 2 B == T, S == T*V + 2.4*B^3};
Simplify[Minimize[{T, constraints}, {A, B, T}, Reals], {S > 0, V >= 0}]
Above is the ...
1
vote
0
answers
65
views
Finding the Stationary Points of a Potential Function in Mathematica
I'm new to Mathematica, and want to solve the problem, which is shown in my code below. The issue is Mathematica runs for 20+ hours without returning any output for ...
2
votes
1
answer
73
views
How can I get RegionNearest from a curve to a line?
I am trying to find shortest distance form a point on the curve has the equation $ y = 1/10 (-x^3 + 9 x^2 - 15 x + 56)$ to the line has equation $ y = -1.5x + 18$. I tried
...
3
votes
1
answer
87
views
NMaximize with Polygon domain fails with "The following constraints are not valid"
Running Mathematica v14.2 Windows 10, this fails with The following constraints are not valid...
...
1
vote
3
answers
166
views
How can I fit two datasets simultaneously using two different functions but with the same parameters?
There are two sets of data: firstHalf and secondHalf. Both firstHalf and secondHalf are fitted using the models modelPositive and modelNegative, respectively. Both models use the same parameters: MS, ...
0
votes
0
answers
64
views
Using FindFit for non linear model fitting how to calculate standard deviation of fitted parameters?
Is FindFit function of Mathematica works faster than NonLinearModelFit ?? I found FindFit works much faster in my model (almost 8 times). Can someone helps me how to calculate the standard deviation ...