Skip to main content

Questions tagged [mathematical-optimization]

Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.

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! "...
xzczd's user avatar
  • 70.1k
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 ...
Tom's user avatar
  • 395
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. ...
hippo3773's user avatar
  • 1,294
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: <...
GongNanyue's user avatar
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. ...
GaAs's user avatar
  • 169
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 $ ...
pie's user avatar
  • 143
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 ...
Mam Mam's user avatar
  • 1,913
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 ...
Ama's user avatar
  • 21
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 ...
user avatar
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 ...
Liu Rick's user avatar
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 ...
A. Ali's user avatar
  • 21
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 ...
Thuy Nguyen's user avatar
  • 1,461
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... ...
flinty's user avatar
  • 26.1k
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, ...
Cansu's user avatar
  • 13
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 ...
RAJESH CHELL's user avatar

15 30 50 per page
1
2 3 4 5
155