# Questions tagged [mathematical-optimization]

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

2,206 questions
Filter by
Sorted by
Tagged with
87 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: ...
• 24.8k
262 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 ...
• 48.9k
120 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 ...
• 31
63 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 ...
202 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 ...
• 2,240
1 vote
82 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 ...
• 63
88 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. <...
• 2,240
1 vote
166 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 ...
47 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: <...
• 3
32 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}] ...
• 1,501
1 vote
43 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 ...
• 1,746
1 vote
131 views

### How to do BayesianMinimization in 2D?

Studying a new experimental BayesianMinimization command in 14.0 and following an example from the documentation ...
• 25.7k
68 views

### Convex function not recognized as convex by ConvexOptimization

I am working with a convex function that I want to minimize, say $f(x) = x+\frac{1}{x-1}, ~x>1$. When I run ConvexOptimization[x+1/(x-1),x>1,x], I receive the ...
71 views

### Animate a FindMinimum with NIntegrate

The objective is to investigate how a fitted normal distribution approximates the sum of two normal distributions with a difference in $\mu$, $\sigma$, and amplitude. The purpose is finding out how ...
125 views

### NDSolve gives High Oscillatory Solution [duplicate]

I want to solve a differential equation of second order with complex initial conditions. ...
95 views

43 views

### Minimizing stress and deflection (separately) using higher-order theory for static analyses of functionally graded cantilever beams

I wanted to generate an FGM beam's optimized volume fraction, minimizing stress and deflection separately. I wanted to use the following article as a reference for the related equations. DOI 10.1007/...
38 views

### Problems with NMinimize in identifying dynamic system parameters

I'm trying to identify the system's $K,T_1,T_2,T$. First I define the system ...
• 21
66 views

### Make function with variable arguments from output of symbolic manipulations

I have a fairly intricate symbolic calculation, which outputs a list of formulae as functions of several variables. The final symbolic formulae are much less complex than the large number of complex ...
139 views

### How to maximize over a set containing an isolated point?

How can I maximize a function F over a set composed by a compact set like [a, b], plus a single isolated point, like $[a, b] \cup \{p\}$? I cannot code the isolated point part.
1 vote
59 views

...
• 143
1 vote
84 views

### The first step to Speed Up using GPU

If we run the following code, mathematica kernel uses only CPU : LinearOptimization[ x + y, {x + 2 y >= 3, x >= -1, y >= -1}, {x, y}] I want the ...
• 3,935
1 vote
108 views

### Numerical optimization yields strange result with imaginary number

Edit: I changed the range for $r$ to $d/s \leq r \leq 1/2$ from the original one, $0 \leq r \leq 1/2$ and now it works! But there has emerged another issue, which is presented below. Consider the ...
• 817
1 vote
94 views

### An issue concerning the Maximize command in Mathematica [closed]

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 ...
• 31
113 views

### How can I compute the maximum value of a ConditionalExpression?

If we use GeometricSolveValues in version 14.0, we can use this code to get a ConditionalExpression expr: ...
• 26.5k
119 views

### How can I show that a function is always decreasing?

I am stuck in showing that the function s[t,j,i] is always decreasing. If I plot the function, its graph shows that it is decreasing over any interval $(0,2000]$, ...
139 views

### I need help in complements of subsets

I have two subsets and tried this expression with MapThread: ...
120 views

### How to write down and check the Karush-Kuhn-Tucker conditions?

This is a simple touchstone for a serious matter. I try to solve with Mathematica 13.3.1 on Windows 10 problem 1278 from "The Kvant". Let real numbers $x_1,x_2,\dots,x_n$ satisfy the ...
• 25.7k
57 views

### Derivative of this equation [closed]

I want to ask something. My friend asked me to help to check if the derivative of equation 9 is shown by equation 10. I don't really how to solve it manually so I tried to check from Mathematica, but ...
73 views

### Optimizing prallel computing for nested integration

I need an advice for optimization of computing with ParallelMap, as well as general hints to speed up computing discussed below. I have several questions about this ...
• 29
1 vote
107 views

### Error while using FullSimplify

I am trying to simplify a particular expression using Collect, Series, and FullSimplify: <...
• 1,746
270 views

### Plotting solutions to an equation for varying parameter value produces empty graphs

Consider an objective function v = ((i + lambda) Uem - (-1 + e) Uun)/(i (1 - e + i + lambda)) where ...
• 817
1 vote
75 views

### Plot with and without Table produce different results

Suppose a function v = ((i + lambda) Uem - (-1 + e) Uun)/(i (1 - e + i + lambda)) where ...
• 817
181 views

I need in my work to get series expansion of (2 E^x x HypergeometricPFQ[{1}, {1/2 + E^-x/4, 1 + E^-x/4}, -(x^2/4)])/Gamma[E^-x/2] + x^(1 - E^-x/2) Sin[x] up to n=... 1 vote 0 answers 65 views ### Plotting Minimize outcome yields an empty graph Why doesn't the following simple plotting of Minimize result work? ... • 817 2 votes 0 answers 75 views ### How to get the optimal arrangement minimizing depth and maximizing level usage for a dependency tree graph? Given a graph like as follows: ... • 9,293 0 votes 0 answers 100 views ### Solving an optimization problem with rather complicated functions I'm trying to solve the following optimization problem. \begin{aligned} \max_{e, s} \quad & v=\frac{(\lambda + i)U_{emp}+(1-e)U_{unemp}}{i(1-e+\lambda+i)}\\ \textrm{s.t.} \quad & \lambda = \... • 817 0 votes 0 answers 33 views ### How Do I Graph an SVEIAR function with the reproduction Number Just need help figuring out how to plot a graph of an SVEIAR model with its' reproduction number. I'm a bit confused on how to properly make a graph based off the model and reproduction number. ... 3 votes 1 answer 196 views ### How to find a unimodular integer matrixT$satisfying$T^\top A T=B$given symmetric integer matrices$A,B$? Given two unimodular symmetric integer matrices$A$and$B$, I asked how to find a unimodular integer$T$that satisfies this nonlinear relation between$T$and$A,B$like this in Mathematica: ... • 251 0 votes 1 answer 66 views ### Trouble with Finding a Supremum Constrained by a Condition I have a function$$f(x,y) = \sqrt{\left(x^4 y+\frac{2 x^2 y^2}{x^2 y^2+1}+\frac{2}{x^2 y^2+1}-41 x^2 y-7 x^2\right)^2+\left(-7 x^3 y-x^3-\frac{2 x y}{x^2 y^2+1}-\frac{2 x^3 y^3}{x^2 y^2+1}+41 x\... 8 votes 2 answers 381 views ### Given square matrices A and B, how to solve T obeys Transpose[T]. A . T = B? Dear Mathematica experts, Given two square matrices, A and B, how do we use Mathematica to solve a matrix T such that T satisfies this matrix equation? (Here we have A,B,T$\in$general linear matrix ... • 251 5 votes 3 answers 413 views ### How to find the nearest element that is bigger than x? Consider some list list=RandomReal[{0,1},10^6]; I would like to find the closest element to some value of x that is larger than it, and also extract its position. ... • 5,397 2 votes 1 answer 170 views ### Wolfram Engine 13.3.0 dies, is this a bug?$ wolframscript Wolfram Language 13.3.0 Engine for Linux x86 (64-bit) Copyright 1988-2023 Wolfram Research, Inc. ...
• 87
1 vote
I have the following function of four variables f=Sqrt[(1 + w - x + 4 y z) - Sqrt[4 (-w + x) + (1 + w - x + 4 y z)^2]]/Sqrt[2] I want to show that $f(w,x,y,z)<1$...