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
6 votes
0 answers
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: ...
flinty's user avatar
  • 24.8k
4 votes
1 answer
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 ...
Syed's user avatar
  • 48.9k
2 votes
3 answers
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 ...
Tona's user avatar
  • 31
3 votes
1 answer
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 ...
Everlin Martins's user avatar
5 votes
1 answer
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 ...
user444's user avatar
  • 2,240
1 vote
0 answers
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 ...
sudipta's user avatar
  • 63
2 votes
1 answer
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. <...
user444's user avatar
  • 2,240
1 vote
0 answers
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 ...
Giuseppe Vonella's user avatar
0 votes
1 answer
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: <...
何子钦's user avatar
0 votes
0 answers
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}] ...
lesobrod's user avatar
  • 1,501
1 vote
1 answer
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 ...
BabaYaga's user avatar
  • 1,746
1 vote
1 answer
131 views

How to do BayesianMinimization in 2D?

Studying a new experimental BayesianMinimization command in 14.0 and following an example from the documentation ...
user64494's user avatar
  • 25.7k
0 votes
0 answers
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 ...
Cryme's user avatar
  • 1
0 votes
1 answer
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 ...
OmnipotentEntity's user avatar
0 votes
0 answers
125 views

NDSolve gives High Oscillatory Solution [duplicate]

I want to solve a differential equation of second order with complex initial conditions. ...
Jules Alvarez's user avatar
0 votes
1 answer
95 views

How to find the maximum and minimum values of a function

I am given $\alpha = \sin \theta \cos \phi$ and $\beta =\sin \theta \sin \phi$. How should I proceed to find the maximum and minimum values for the below function subject to the constraint $x^2 +y^2 \...
wanderer's user avatar
  • 125
2 votes
1 answer
144 views

Speeding up minimization problem related to a minimal surface

I am trying to find the minimum of the function $$f(x)=\int_0^1(1+t^x)\sqrt{1+x^2 t^{2(x-1)}}dt$$ which arises from trying to minimize the surface area of a function rotated around the $x$ axis. Here ...
Kamal Saleh's user avatar
0 votes
1 answer
70 views

Solving for Lagrangian multipliers with additional assumptions

I want to solve the Lagrangian with two multipliers $\lambda_1$ and $\lambda_2$, but with an additional convexity assumption. However, when I solve it case by case under such an assumption, I get 0 as ...
Lizy Jackson's user avatar
0 votes
0 answers
71 views

DSolve running for 4.5 hours

...
nuj_hossain's user avatar
2 votes
1 answer
93 views

Maximize a function of $x$ and $y$ where $x^2 +y^2 \leq 1$

I have the following function: $f(x,y) = x(y^2-x^2)- \frac{(x^2 +y^2)^2}{2\rho}+\frac{3x^2(y^2-4x^2)}{\rho}$ where $\rho>0$ is a constant. My goal is to find the maximum value of this function ...
wanderer's user avatar
  • 125
2 votes
0 answers
212 views

Solving `Integrate` of `InterpolatingFunction` from an `NDSolve`

I am interested in solving a system of Differential Equations, particularly u''[\[Tau]]=-f[t]u[\[Tau]] This system has for initial conditions $u(0)=1/\sqrt{2\cdot ...
Jules Alvarez's user avatar
0 votes
0 answers
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/...
nuj_hossain's user avatar
2 votes
0 answers
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 ...
ing W's user avatar
  • 21
0 votes
1 answer
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 ...
Paul Harrison's user avatar
4 votes
1 answer
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.
Martin and Friends's user avatar
1 vote
1 answer
59 views

Weird behaviour of NMinimize

...
Paul R's user avatar
  • 143
1 vote
0 answers
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 ...
imida k's user avatar
  • 3,935
1 vote
1 answer
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 ...
ppp's user avatar
  • 817
1 vote
0 answers
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 ...
Tona's user avatar
  • 31
2 votes
1 answer
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: ...
yode's user avatar
  • 26.5k
0 votes
1 answer
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]$, ...
Mathematician's user avatar
4 votes
3 answers
139 views

I need help in complements of subsets

I have two subsets and tried this expression with MapThread: ...
Alyasaa Jasim's user avatar
5 votes
0 answers
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 ...
user64494's user avatar
  • 25.7k
0 votes
1 answer
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 ...
Icebear's user avatar
2 votes
0 answers
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 ...
seva011's user avatar
  • 29
1 vote
1 answer
107 views

Error while using FullSimplify

I am trying to simplify a particular expression using Collect, Series, and FullSimplify: <...
BabaYaga's user avatar
  • 1,746
2 votes
2 answers
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 ...
ppp's user avatar
  • 817
1 vote
0 answers
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 ...
ppp's user avatar
  • 817
3 votes
3 answers
181 views

Evaluating series expansion is very slow

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=...
Mohamed Mostafa's user avatar
1 vote
0 answers
65 views

Plotting `Minimize` outcome yields an empty graph

Why doesn't the following simple plotting of Minimize result work? ...
ppp's user avatar
  • 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: ...
user13892's user avatar
  • 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 = \...
ppp's user avatar
  • 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. ...
izayafiji's user avatar
3 votes
1 answer
196 views

How to find a unimodular integer matrix $T$ 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: ...
zeta's user avatar
  • 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\...
Martin Strmiska's user avatar
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 ...
zeta's user avatar
  • 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. ...
John Taylor's user avatar
  • 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. ...
Ytrewq's user avatar
  • 87
1 vote
1 answer
64 views

Is a four-variable function less than one?

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$...
Julio Abraham Mendoza Fierro's user avatar
2 votes
0 answers
103 views

How to set up the Gurobi optimizer?

How do I set up Mathematica to use the commercial Gurobi optimizer? Mathematica should be able to use it, as the Method -> "Gurobi" option exists for ...
István Zachar's user avatar

1
2 3 4 5
45