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
0
votes
0answers
42 views

Global optimization problem with setting variables [closed]

I'm using NMaximize to obtain the global maximum of a function with 23 variables and some constraints. When I set some variables to 0, the output maximum is bigger than the output I obtained with all ...
1
vote
0answers
45 views

A question about Plot an NIntegrate and FindMaximum is too slow

I need to DensityPlot an NIntegrate where near the maximum piont. So I need to use ...
0
votes
1answer
87 views

When I define a Piecewise function containing a solution to a partial differential equation, the function cannot be evaluated numerically

I need to find an integral, in which there is a function YO [x_] = Sum[E^(((I h PI)/(λ f))x^2) Subscript[Y, h][x, z = 13.5], {h, - 5, - 1}] /. s where ...
1
vote
1answer
66 views

Find instance of equation that also minimizes one variable

I want to find an instance of solution of a very complicated equation like func[a, x, y, w, z] == c that is a global minimum (within the solution set) of a. Below ...
3
votes
2answers
107 views

Superimposed curves in two regions [closed]

If I have several data set like the following (I am showing just two): ...
1
vote
1answer
60 views

Maximize a function over several variables [closed]

I want to maximize the function, $$S_{v}=\sum_{a \in\{1,-1\}^{n}}\left\|\sum_{i=1}^{n} a_{i} v_{i}\right\|$$ over $v_{i}$ and a given $n$ (say $n$=3). $v_i$ are unit vectors. $a$ are lists with $n$ ...
0
votes
2answers
50 views

Plot Parametric f(x), inverse f(x) and f'(x) and then f(x)/f'(x) and inversef'(x)/inversef(x)

I want to plot f(x), inverse f(x) and f'(x) and then f(x)/f'(x) and inversef'(x)/inversef(x) f[x_] := 2 a ArcTanh[(# a)/Sqrt[-1 + #^2 b]] + a Log[1 + #^2 (a^2 - b)] - 2 Log[# b + Sqrt[-1 + #^2 b]] &...
0
votes
0answers
36 views

Scaling the edge length of a graph to be equal to edge weight for 3D graphs

This is a follow up to my previous post here The following is the solution provided here to set the edge length of a graph equal to the edge weights for a 2D graph posted in the previous post. The ...
1
vote
1answer
86 views

Find minimum of a function defined via NIntegrate [closed]

I need to find the minimum of a function f(t) = int g(t,x) dx over [0,1]. I used g[t_, x_] := *huge expression* f[t_?NumericQ] := NIntegrate[g[t, x], {x, -1, 1}] ...
5
votes
3answers
100 views

How I can indicate the maximum point on a curve [closed]

y = r^2 (0.5) - r^3 I am trying to get maximum point on this graph from range 0 to 0.5. Can some one help?? ...
1
vote
0answers
70 views

What is wrong with my code for implementing PSOR (Projected Successive Over Relaxation)? [closed]

I have written the numerical scheme of PSOR (Projected Successive Over Relaxation) method of a obstacle program in 1D, which is as follows: \begin{align*} &u_0=u_N=0\\ &u_i^{k+\frac{...
0
votes
1answer
78 views

Minimize returns strange root objects

I am using Minimize to find a solution for the following set of equations that minimizes my cost function $c + k\cdot r$: Essentially, I have two points $p_1,p_2$ ...
0
votes
0answers
33 views

Maximize recursive function (exact or numerical)

I am essentially just using Mathematica as an advanced calculator, but I know it is much more powerful. I am sure it can solve my problem. Any input is appreciated, including the tutorial or handbook ...
1
vote
0answers
43 views

Extract repeated patterns without user intervention

If I copy-paste HUGE analytical mathematical formulas from Mathematica to C++ (huge means > 800 chars), is there a way to extract repeated patterns? Because I don't want to recalculate the same ...
-1
votes
0answers
26 views

NDSolve initial condition as argument of NMinimize

I need to numerically minimize a function that involves a numerical solution of an ODEs system. One of the initial conditions of the ODEs is a function of some parameters with respect to which I ...
0
votes
0answers
31 views

Symbolic min max optimization

I have the following seemingly simple optimization problem Minimize[{Max[p^(c - 3) , a p^(c - 1) , b p^c], d <= p <= 1}, p] but the Mathematica does nothing. ...
3
votes
1answer
44 views

Can Mathematica automatically optimize an expression with PowerMod?

PowerMod[x,p,m] is significantly faster than Mod[x^p, m] for a large p I have an expression, ...
3
votes
4answers
356 views

Nested optimization problem - Function approximation

I need to maximize the following function (the input to NMaximize below) ...
0
votes
1answer
58 views

Simplifying Kronecker Delta in Partial Derivative

I am a Mathematica beginner. I am trying to solve an economics optimisation problem by using the lagrangian method. So I formalised my problem in the following way: ...
0
votes
1answer
57 views

FindMinimum for a large range

I have a function functionSL[0.01,zl,zh] where I want to find at which zl its minimum value occurs for each different ...
17
votes
4answers
880 views

Find the equidistance curve between two curves

I have three function $f(x)=x^x$, $g(x)=\ln(x)^{\ln(x)}$, $h(x)=\ln(x)^2$ and I want to find (numerically) $C$ the center of the circle tangent to the three curves. I think that one way is to find ...
4
votes
0answers
62 views

How to train each layer in a Neural Network so they optimize different loss functions in an adversarial network?

Example NetGraph to illustrate the idea (Input is an online signal with a value between -1 and 1, Noise is Gaussian Centered at 0 and standard deviation 0.1, EvilNet is constrained to output a value ...
2
votes
2answers
115 views

Speed up a differential equation solution + parameter integration + parameter maximization

The problem I am trying to solve can be described as a maximization of an integral of the solution of a differential equation. A MWE is ...
1
vote
0answers
42 views

How to write a program on gradients and the path for steepest ascent?

I'm given two functions f[x ,y ]=Cos[x]*Cos[y]/(6+x^2+y^2) and df[x ,y ]=Grad[F[x,y],{x,y}] I was given a note that ...
0
votes
0answers
45 views

Error Message with Maximize

So, I wanted to do the following maximization, from the article https://arxiv.org/abs/1706.06221 "Non-asymptotic entanglement distillation", which can be seen below: And they used ...
0
votes
0answers
15 views

How to reverse or restore the order of my cells in Wolfram Mathematica Cloud?

I was completing my assignment and I have no idea what I clicked but all the cells got reversed that is the 1st one on the last and the last is the first cell in my file. I want to restore it back. I ...
1
vote
0answers
51 views

Optimizing a parameter space search

This is related to my previous question: Solve for parameters so that a relation is always satisfied The Problem I am searching the parameter space of a large (many terms) function to find where the ...
2
votes
0answers
26 views

NMinimize to ignore arguments for which function is complex valued [closed]

I'd like to minimize a pretty complicated function $f(x, y, z)$ with NMinimize, however for certain values of the arguments $f$ becomes complex valued, and my ...
0
votes
2answers
268 views

Plot of the derivative of a function

I have a function functionSL as a function of t (t<0) where I want to find the extremum ...
0
votes
1answer
113 views

Zeros or minima of a multivariable function [closed]

what is the most reliable method for finding the zeros or at least the minimum of $f(x,y,z,w,r)= - \frac{3}{96 \pi^{2}z^{4}} \int_{y}^{\infty}\sqrt{x^{2}-y^{2}}x^{2} e^{-x} dx+ \frac{3}{16 \pi^{2}(1-r^...
0
votes
0answers
30 views

Finding/Printing Variables that Correspond to the Maximum Output of a List

I am very new to Mathematica and been having a problem that is frustrating because I feel that there must be a simple solution which I just can't grasp. Essentially, I am looking to automatically ...
2
votes
2answers
63 views

NMinimize violates constraints

I have a rather convoluted objective function to minimize, subject to some constraints. The results violates the constraints. The following example highlights the issue: ...
0
votes
1answer
115 views

Adopt Mathematica codes for circumscribed and inscribed ellipsoids to related sets

Users Daniel Huber and Dominic have provided an interesting answer each to the question JohnEllipsoids of constructing circumscribing and inscribing ellipsoids for a certain three-dimensional convex ...
2
votes
0answers
28 views

NMinimize differential evolution: how do search points and initial points really work?

I am puzzled by the settings of a specific method for NMinimize called DifferentialEvolution, given for example here. The ...
3
votes
2answers
97 views

Finding multiple local minimum

I have the following code: ...
0
votes
1answer
61 views

Maximize a simple expression based on EuclideanDistance takes too long

Do you know if there is a mistake in this command syntax? It is very simple and still it takes too long. I cannot obtain any result at all: ...
1
vote
0answers
52 views

Manipulate and Plot of Tangent Point in Optimization Problem with Kinked Constraint: Solve and PieceWise Problems

I'm trying to illustrate an optimization problem with a piecewise constraint creating a kink at the maximum value of T if n>0. ...
0
votes
0answers
64 views

Derivative of a Definite Integral

I have two equations as follows, $$a = \int_0^1 dx \frac{c z_s^{d+1} x^d}{\sqrt{(1-(z_s/z_h)^{d+1} x^{d+1})(1-c^2 z_s^{2d} x^{2d})}} \tag{1}\label{1},$$ \begin{align} S &= \frac{1}{4 z_s^{d-1}}\...
1
vote
2answers
55 views

Manipulate and Plot of Tangent Point in Optimization Problem: Solve Problems

I want to illustrate how changes in the values of exogenous variables and parameters (T,w,[Alpha]) are changing the optimal values of two endogenous variables (f,c)=(f*,c*). The solution is with a ...
0
votes
0answers
60 views

What's going on in this Newton-Raphson algorithm?

I'm looking at this post, over on Mathematics SE. I'll summarize here: A signal with a known velocity, c is emitted by some source. We're given the coordinates of ...
2
votes
6answers
285 views

Graph/Construct (John) ellipsoids circumscribing and inscribing a certain 3D convex set

A famous theorem JohnEllipsoids of Fritz John informs us that associated with a convex body are circumscribed and inscribed ellipsoids of minimal and maximal volumes. Now, a body--argued to be convex ...
1
vote
1answer
95 views

Maximum area of projection of cuboid onto plane

For didactic purposes I solve with Mathematica the following problem (see Vasilyev's box on p. 17): when the area of the projection of a rotating cuboid in the three-dimensional space with coordinates ...
0
votes
0answers
55 views

minimization in entropy

I am trying to calculate some minimization problems arising in entropy (with several variables). One typical case here is the fact that we deal with functions containing the forms $\lambda \log \...
0
votes
1answer
70 views

Speed up linear programming computation?

Consider setting up the following system for a linear programming optimization ...
5
votes
2answers
318 views

Summing over Partitions

Imagine I have a list of integers $l=\{l_1,l_2,...,l_{50}\}$, say, for example l = RandomInteger[10, 50] and I want to find how many ways there are of summing ...
1
vote
0answers
34 views

Minimization over Booles

I would like to set my domain of NMinimize so that my variables take values in {1,0}. I know I can use ...
0
votes
0answers
32 views

Table and FindMinimum

I have a function where I want to find its minimal value for some parameters. I tried to use FindMinimum separately for each function given some values of the ...
3
votes
1answer
98 views

Need help with a linear programming problem

Consider $1\rightarrow{}x+2y\leq{500}$, $2\rightarrow{}2x +y \leq{520}$, $3\rightarrow{}2x+5y \leq{}1200$, $4\rightarrow{}x \geq{}0$, $5\rightarrow{}y \geq{}0$, The above is the set of inequalities ...
3
votes
2answers
97 views

Why sometimes an input only return itself rather than the supposed result?

I encountered this problem several times but never managed to understand why. For example, I want to get the maximal value of a parametrized function $\log(c)+ b\log(k-c)$ with respect to $c$. I tried ...

1
2 3 4 5
33