Skip to main content

Questions tagged [mathematical-optimization]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
41 views

How Can I Relax a Molecule in Mathematica?

I have a molecule in Mathematica. It consists of around 70 atoms, but let us for simplicity assume that we only have four atoms: ...
flg's user avatar
  • 11
0 votes
1 answer
73 views

How to speed up generating and filtering large lists of numbers?

I have the following code where I brute force search for two variables. list gives a list of 3 dimensional vectors, say {x,y,z}. ...
Dotman's user avatar
  • 456
0 votes
0 answers
42 views

LinearOptimization beeps then quits

I am executing a large binary LinearOptimization program that has to do with power production optimization. It has 729 variables, each takes the value of 0 or 1. There are about 250 constraints. ...
powereconomist's user avatar
1 vote
1 answer
82 views

Separation of variables

Is it possible to replicate the same procedure of placing the functions that depend on $r$ on one side of the equation and on the other side leave the equations that depend on $\theta$ in Mathematica? ...
Dayzk's user avatar
  • 147
0 votes
2 answers
101 views

Fixed coordinate is shifting in each frame of the animation

I am trying to animate a rotating coordinate system around fixed cartesian coordinates. The fixed coordinate system keeps shifting in each frame as the rotating coordinate system rotates. I am ...
SanGu's user avatar
  • 63
0 votes
1 answer
73 views

How does FindRoot work?

I have a system of 3 nonlinear equations in 3 unknown variables $f(x,y,z)=0, g(x,y,z)=0, q (x,y,z)=0$. I want to find $(x,y,z)$ that satisfies the 3 equation so I input: FindRoot[$\{f[x,y,z], g[x,y,z],...
Engineer's user avatar
  • 119
0 votes
1 answer
96 views

Finding the minimum of a multivariate function

I have a multivariate function defined by f[c_] := (1/2) . Transpose[c] . (G[c] + IdentityMatrix[n]) . c - Transpose[c] . M where ...
SpeedForce's user avatar
0 votes
0 answers
41 views

Formal solution to large system of equations using Reduce

I'm trying to solve a large system of equations (there are 12 equations with 12 complex variables, hence I'm expecting to be able to write 12 real components as functions of the remaining). I tried to ...
Fredrigo6's user avatar
0 votes
0 answers
29 views

Getting better answers by smaller working precision?

I have the following code ...
Dotman's user avatar
  • 456
0 votes
1 answer
45 views

NMaximize doesn't satisfy constraints

I have the following code; ...
Dotman's user avatar
  • 456
0 votes
0 answers
40 views

Optimisation fails / not evaluating when a if statement is included in the problem

Have an optimisation problem which I recently added an IF statement. Optimisation fails (or partially evaluated in my longer code) when the section in (**) is included. Can someone please explain why -...
legendary kaya's user avatar
3 votes
0 answers
50 views

Find perspective projection matrix under constraints

I have taken a photo (with a rectilinear lens) of a house's outside wall that sits on top a roof, from which I wish to take measurements from. However, to do so I would need to correct the perspective ...
小太郎's user avatar
  • 213
0 votes
1 answer
68 views

Find the minumum value of an expression [closed]

I am trying to find the minimum value of this expression satisfying the below condition, but this is not leading into a solution: ...
Steve237's user avatar
  • 435
5 votes
2 answers
177 views

SpherePoints problem

Cited from https://reference.wolfram.com/language/ref/SpherePoints.html?q=SpherePoints SpherePoints[n] gives the positions of n uniformly distributed points on the ...
azerbajdzan's user avatar
  • 18.9k
1 vote
0 answers
90 views

Wolfram Mathematica does not work at all [closed]

I have been using mma for years. But after using quit kernal or trying to set default values, mma suddenly stops working. It can not plot sin[x] , evaluate ...
sixpenny's user avatar
  • 149
2 votes
2 answers
119 views

How can I find minimal modulus of $z^2 - w z - 4$?

Let $z$ and $w$ be two complex numbers satisfying conditions: $|z| = 2$ and $|w i - 2 + 5i| = 1.$ How can I find the minimum of $|z^2 - w z - 4|$? I tried with setting $z = a + b i$ and $w = x + y i$: ...
minhthien_2016's user avatar
2 votes
2 answers
94 views

Can Mathematica compute the maximum as a function of parameters?

I have the following function: $\frac{s}{e^2}(e - s)^\alpha$ Where $e \in (0, 1)$ and $s \in (0, e)$. I want to maximize this function with respect to $e$ and $s$. Obviously the maximum value will ...
Ayush's user avatar
  • 21
2 votes
2 answers
57 views

NMaximize not giving the global maximum of SmoothKernelDistribution of 2D data

...
Unicorn's user avatar
  • 23
8 votes
3 answers
549 views

Fitting a disk in a non-polygonal region

...
Syed's user avatar
  • 55.5k
0 votes
1 answer
52 views

How to plot points on a graph curve under logarithmic coordinate axis

I am trying to draw a curve and set a special point based on the logarithmic abscissa, as shown in the following example. The function is 1/(1+(RCw)^2)^0.5. ...
Yao Li's user avatar
  • 111
3 votes
1 answer
49 views

How to disable add a hyperlink with "https" prefix when type shortcut Ctrl+Shift+H

I tried to add a hyperlink to the text using the shortcut Ctrl+Shit+H to open the Zotero application; but every time MMA notebook adds the "https" prefix by default, and can only be ...
Yao Li's user avatar
  • 111
2 votes
1 answer
91 views

Speeding up the nested NIntegration consisted of `Exp' and `Bessel' functions

I got stuck with optimizing the nested numerical integration of function with a high number of Bessel functions (first and second kinds) summed and several exponents. I will appreciate any suggestions ...
seva011's user avatar
  • 316
1 vote
1 answer
75 views

ParametricNDSolveValue, NMaximize: Dealing with complex results in maximization problem

I analyze a system of differential equations in several variables including mus[t], mui[t], and w[t]. Time runs from t=0 to t=T. The two initial values mus[0] and mui[0] can freely be chosen; their ...
beginners's user avatar
1 vote
3 answers
135 views

Maximum value of a constant in a function [closed]

I'm trying to find the maximum $B$ of the following function: ...
Dayzk's user avatar
  • 147
3 votes
2 answers
128 views

FindMaximum, error in solution

The problem cannot be solved; the FindMaximum function throws an error/warning: FindMaximum::cvmit: Failed to converge to the requested accuracy or precision within 10000 iterations. I tried ...
Vladimir's user avatar
  • 323
0 votes
0 answers
41 views

Why is `Minimize` function not working when expression has parameters and trigonometric functions?

I have been trying to minimize a simple function using Mathematica 13.3 $$\frac{4}{2} N \sin ^2\left(\frac{\theta }{2}\right) \left(\left(\frac{N}{2}+1\right) \sin ^2\left(\frac{\theta }{2}\right)-1\...
Uranium238's user avatar
2 votes
5 answers
264 views

How to find the minimum value of the absolute value under this trigonometric function relationship?

Given f[x_]=2Sin[x](Sqrt[3]Cos[x]-Sin[x]), and f[x1]f[x2]==-3, find the minimum of Abs[x1-x2]...
csn899's user avatar
  • 4,315
3 votes
3 answers
182 views

Find maximum and minimum

I have been trying to find the max and minimum values and make it to a list. I have been using some of the previous forms and it doesn´t work.This is my function: ...
wijjoha24's user avatar
-3 votes
2 answers
211 views

How to solve this geometric problem with Mathematica?

I try to solve the following problem, making use of 14.0 on Windows 10 Let a triangle $\Delta$ (a contour with its interior) be chosen in the unit square $S$. To prove that the closure of the ...
user64494's user avatar
  • 26.7k
0 votes
1 answer
63 views

How can I find minimum of the expression $y - 5 x$ knowing that $y \log _{3}(3 x+y+9)=\left(x^{2}+3 x+y\right) \log _{3}(x+3)$?

I am trying to find minimum of y - 5 x knowing that y Log[3, 3 x + y + 9] == (x^2 + 3 x + y) Log[3, x + 3], x >= 0, y >= 0...
minhthien_2016's user avatar
0 votes
0 answers
27 views

Nested optimization leads to conflict with constraints in inner problem

In this nested optimization problem something is going wrong in the step when I substitute u1op[x_] for w1 in <...
Recallme's user avatar
6 votes
1 answer
405 views

Finding an ellipse of minimum area that encloses a set of points

Is there a built-in function or set of functions in Mathematica that can take a set of points in the x-y plane and determine the ellipse of minimum area that contains all of the points? I am sure ...
BioPhysicist's user avatar
  • 1,124
4 votes
1 answer
135 views

Findroot :unable to find a solution that meets the convergence criteria

The stationary solutions of the Klein-Gordon equation refer to time-independent solutions, meaning they remain constant over time. For the non-linear Klein-Gordon equation, you are discussing:$$\frac{...
Athanasios Paraskevopoulos's user avatar
1 vote
1 answer
43 views

Different results using FindArgMax and ArgMax

I want to find the maximum of $|g(\kappa)|$ defined as follows, For some $A>0$, $\alpha\in (0,\infty)$, and $\kappa \in [-\kappa^{*},\kappa^{*}]\subset [-\pi,\pi]$, define $g(\kappa )$ \begin{...
KZ-Spectra's user avatar
0 votes
2 answers
64 views

Parametric Minimize strongly revisited

Let we try to run this simple code: Minimize[{Cos[x + a/2], {0 <= x <= \[Pi], 0 < a < 1}}, x] It doesn't work. But ...
lesobrod's user avatar
  • 1,729
0 votes
1 answer
70 views

Minimize doesn't work

I'm trying to minimize the function V(phi) using the code below ...
Gabriel Ybarra Marcaida's user avatar
0 votes
0 answers
42 views

How to find optimal solution

I want to ask something. Right now, I want to try to find the optimal solution from a function in a paper. here is the function : And here is the numerical example : There is solution procedure that ...
Grizzly54's user avatar
2 votes
1 answer
80 views

Log scale of y-axis is still very small [closed]

I am trying to use LogPlot of Mathematica to rewrite only y-axis (not x-axis) of the plot as log scale. But the y-axis is still very small. By the following code <...
Mehdi's user avatar
  • 31
0 votes
0 answers
40 views

MatrixExp introduces nonconstant expression #1 independent of variables

I am trying to use Mathematica to minimize a particular cost function. One part of the definition of the cost function is taking the matrix exponential of an arbitrary $4 \times 4$ Hermitian matrix. ...
Silly Goose's user avatar
10 votes
1 answer
137 views

How to make a Voronoi chart with areas proportional to data?

In this chart the areas of the voronoi cells have been apportioned so that they represent the fraction of total spending. How can I make a chart like this? Suppose we have the data: ...
flinty's user avatar
  • 25.5k
4 votes
1 answer
270 views

Placing a disk of maximum size in a region surrounded by random points

I start with an array of points (cba) and add randomness to generate (cbar). Four point are deleted from it to generate ...
Syed's user avatar
  • 55.5k
2 votes
3 answers
129 views

An issue concerning the NMaximize command in Mathematica

I have two sets. One set consists of constants and the other one consists of expressions depending on two variables "a" and "b". I find absolute values of correlations between the ...
Tona's user avatar
  • 31
3 votes
1 answer
69 views

Peak Appearances in Plot Outputs from Optimization Routines

Dear fellow researchers and Mathematica enthusiasts, I've been working on a computational physics problem and encountered an interesting issue regarding the appearance of peaks in my plots, which I ...
Everlin Martins's user avatar
5 votes
1 answer
226 views

Colouring Bifurcation Diagram

I need to plot the bifurcation diagram for the function given below. g[x_, r_] := 6 x^2 + r x^4 + x^6 Plot[g[x, -4.9], {x, -2, 2}] Bifurcation Code for ...
user444's user avatar
  • 2,456
1 vote
0 answers
83 views

How to efficiently calculate matrix operations when the elements are defined as functions?

I'm trying to calculate the one-body density matrix of a system of particles as described in this article, given in equations 14 and 15. Here, is my code but it seems very slow. Is there any efficient ...
sudipta's user avatar
  • 63
2 votes
1 answer
90 views

General Trend of a ListLogLinearPlot

I have a data file. I must plot this using ListLogLinearPlot and identify the trend (or the mean). Below is my code for Importing the data file and plotting it. <...
user444's user avatar
  • 2,456
1 vote
0 answers
171 views

How to Model a Parametric Fast Fourier Transform in Mathematica?

I'm using this code which evaluates the FFT of my original signal (which is a time series). Using the Manipulate function of Mathematica it is possible to vary the ...
Giuseppe Vonella's user avatar
1 vote
1 answer
51 views

About NMinimize with an array of variable

I was trying to test NMinimize on $$ \int_0^1 (a+b(cx+d))^2 dx $$, then I guess it should be minimized when the integrand equals 0. It works fine when the integrand is only (a+bx)^2, I use the code: <...
何子钦's user avatar
0 votes
0 answers
37 views

Compile constraints for NMinimize

I use complicated constraints for optimisation, something like Table[ EuclideanDistance[pts[[i]], pts[[j]]] >= 1 , {i, numPts - 1}, {j, i + 1, numPts}] ...
lesobrod's user avatar
  • 1,729
1 vote
1 answer
45 views

Performing logical reasoning to find minimum function between two functions

Consider the following two expressions: f[x_,y_] := (1+x) g[x_,y_] := (1+x*y^2) x,y are bounded in a unit hypercube. (Ignore ...
BabaYaga's user avatar
  • 1,888

1
2 3 4 5
45