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
3
votes
2answers
103 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 ...
0
votes
0answers
140 views

Not understanding the reason for not getting full rank matrix

I have a structure shown in figure. It has four members. Each member has represented by two displacement field $W_i$ and $U_i$. I have expressed this displacement field using some functions. I found ...
1
vote
1answer
54 views

Memory problem for maximizing a multivariable function

I need to maximize the following function. Unfortunately I have to maximize without using numerical methods to prove that the maximal value is 3Sqrt(2Sqrt(3)-3) (about 2.04375). I tried it twice (once ...
0
votes
1answer
82 views

How to solve the Summation equation by FindRoots [closed]

I want to find out the value of alpha and lambda where u lies between 0 and 1.
2
votes
3answers
205 views

Most efficient way to solve partly integer optimization problem

Let $0 < u < v < w < 10$ be natural numbers. I want to maximize $r$ across all choices of $u, v, w$ subject to the inequalities $(42 - 100 r) - (6 - 10 r)(w + v) + vw(1 - r), -(42 - 100 r) ...
0
votes
1answer
52 views

FindMinimum with Manipulate

I have an expression for the energy of a given physical system and I need to plot its minimum with respect to one of the parameters while the others are allowed to vary. The expression is the ...
-3
votes
1answer
65 views

Permutation Combinations Mobile Pattern Codes [closed]

Please help write codes to determine 4 to 6 dot patterns. I am stuck after permutations input. It would really help if one could write direct so I could copy paste code to determine list of 4 to 6 dot ...
3
votes
3answers
244 views

A question on the exact value [closed]

Could anyone help me find the exact value of ...
5
votes
2answers
126 views

Wish to compute ln(x) with millions of digits of precision fast as possible

Computing $\ln(10)$ to 6 million digits of precision on my 2.5 GHz machine running Mathematica 12.1 takes about 23 seconds using the methods below. Wish to compute $\ln(x)$ with much higher precision....
0
votes
2answers
57 views

How to make calculations involving symbolic summation?

I want to minimize a function involving the sum of $n$ fixed (but indetermined) $x$ values, for example: Minimize[Sum[(x[i] - a)^2, {i, 1, n}], a] Expected answer: ...
0
votes
2answers
81 views

How to know, which constraint is being violated in linear programming problem?

my task is to minimize costs of dispatching various power plants in order to meet demand in a transmission grid. I solve the task as a linear programming problem with the help of Minimize[] function ...
1
vote
2answers
167 views

Minimizing simple function of three variables fails

I need to minimize simple function with all variables are positive integers, but the out is the same as the input. No solution ...
1
vote
1answer
58 views

Non-Linear optimization with NMaximize fails to find the parameters

I am trying to solve an optimization problem with several parameters and here is my code: ...
0
votes
2answers
60 views

Is it possible to change the tick labels using string text by CustomTicks package?

I want to get a high-resolution figure using Mathmatica. However, the FrameTicks are too short, and thus I installed the CustomTicks package. With its help, I can plot good ticks. However now a new ...
0
votes
1answer
139 views

Linear diophantine equation

How to use Mathematica to solves any linear diophantine equation of the form ax+by=c, whenever it is solvable. Such as this example, How to get the x = -165, y = 238. Thanks! Link: https://mathworld....
0
votes
0answers
38 views

What does ScalingFactor do in NMaximize?

I'm working with NMaximize. Currently, I use the "DifferentialEvolution" method. Let us assume that, as a general rule, the more time Mathematica spends looking for a maximum, the more ...
0
votes
0answers
30 views

Inner parameters are not updated in the nested optimization

I have a problem with nested optimization. In my program, I select one from the list minipotentX that can maximize the value of the function ...
0
votes
0answers
20 views

How to write the resultant of NMinimaize as a vector?

I used NMinimize, and I get a result which after some modification is like: ...
2
votes
2answers
67 views

Wolfram Cloud memory limit exceeded with complex Lagrange multipliers

I'm new to the forum and I have problems when I try to run this code. The computation exceeds the limit of my plan. This is my code. What can I do? ...
5
votes
3answers
349 views

How to Minimize a problem with a big number of variables?

Here is a problem from math folklore. Minimize $$\sum_{j=1}^{j=n} x_j$$ under the constraints $$x_1+x_2\ge 1,\, x_2+x_3\ge 2,\dots,x_n+x_1 \ge n .$$ The Mathematica codes ...
0
votes
3answers
131 views

Maximizing a function of two variables

I have the simple function: $\qquad f(x,a)=a\,x−ln(x/100)$ with the constraints: $0.1 < a < 1$ and $0.1 < x < 10$ I want find the minimum of $f(x,\,a)$, assuming that the variable $a$ can ...
0
votes
1answer
31 views

Verify Minimum of a certain function [closed]

Consider $\frac{1}{2} \leq a,b \leq 1$ and an arbitrary but fixed $\varepsilon$ between $0$ and 1 I would like to verify that the function $$a + b - \sqrt{a^2 + b^2 - 2ab + \frac{4ab}{(1+\varepsilon)^...
3
votes
4answers
67 views

How to minimize equation over a list of values?

I tried to do something like Minimize[x+y, {x,y} ∈ {2,3,4,5}] but that doesn't work. How could I minimize an expression where I restrict the inputs to values from a ...
1
vote
1answer
139 views

Eliminate a variable within an integral

I have two expressions given by, $$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},$$ $$S = \int_\epsilon^{z_s} dx \frac{1}{x^d} \...
0
votes
1answer
88 views

FindMaximum not working with ParametricNDSolve

I have the following code (ignore the manipulate parameters, assume them constant in this context). For background, what I'm trying to do is take the results of a 2D differential equation, find where ...
0
votes
0answers
80 views

getting the coordinates

With the given function from a previous problem I was solving link, I want to create/collect the coordinate points of Min. value for 21 values of parameter a (from -7 to 7), and find a,b, and c such ...
1
vote
1answer
68 views

SemidefiniteOptimization stops and does not work

I am trying to make the following code work: ...
3
votes
1answer
117 views

adding a point in a manipulate command

I am having trouble adding a point to mark the Min values of each parabola when using the Manipulate command? ...
1
vote
0answers
73 views

Running NonlinearModelFit in more one kernel simultaneously [closed]

I want to perform a nonlinear least square fit of data points upto 3000. Because the model I provide is huge polynomials with 300 to 400 fitting parameters to be estimated, my mac i7 computer proceeds ...
0
votes
0answers
42 views

NMaximize on Which Function

I have a function covering multiple cases made by using 'Which' function. Based on some parameters, the function value changes. When I plot it, I could see the function is continuous. Now I am trying ...
4
votes
1answer
79 views

Weird behaviour of FindMinimum

On Mathematica 12.1, I tried to do FindMinimum[Sin[x] + 1, {x, 55.00000000000001`, 54, 56}, Method -> "PrincipalAxis"] It gives the output ...
1
vote
0answers
33 views

Minimize doesn't work with more parameters

In the code I wrote there is a ParametricNDSolve with four parameters. I want to minimize an error function with Minimize. If I consider ParametricNDSolve with just one parameter everything works, and ...
12
votes
4answers
447 views

Finding the largest disk within a convex region using Region primitives

This question asks to find the largest circle within a convex polygon, specifically this one: ...
0
votes
0answers
37 views

How do I extract the minima from a list of NMinimize outputs in a smart way?

I am trying to find the absolute minimum of a potential surface on the x-y plane as a function of a third parameter p which changes the shape of this surface. In other words: at p=1, I want the ...
3
votes
1answer
97 views

Issue while evaluating Mathematica expressions from Python [closed]

This is a follow up to my question posted here I am trying to run the code posted here as an answer in the above-mentioned link here from Python I tried, ...
2
votes
1answer
85 views

Smoothen the result of FindRoot

I have a set of code for which it involves finding the corresponding c for each a (although I will give a value of ...
0
votes
0answers
52 views

Plot Table of Equations

I have a code where the first line of the body consists of an algebraic equation involving NIntegrate and the parameter a, for a ...
0
votes
1answer
31 views

Using results from Nmaximize in loop

I try to Append the vector S by z+x whereby z and ...
0
votes
0answers
34 views

Steady state customer behavior in queuing model — Numerical Optimization

With the following code I try to calculate the steady-state equilibrium waiting time at two different queues. A fraction tau of users turns away entriely, a ...
2
votes
0answers
76 views

For any countable totally-ordered $A$, how can mathematica show my choice function gives a unique collection of finite sets whose union is $A$?

Suppose $A=\sqrt{\mathbb{Q}}_{>0}$. We want a unique $\bigcup\limits_{i\le j}A_i$ for $i,j\in\mathbb{N}$ such that $A_i$ is finite, $A_i\subseteq A_{i+1}$, and $\lim\limits_{j\to\infty}\bigcup\...
4
votes
1answer
122 views

Any trick to solve this optimization problem?

I'm relatively new to solving optimization problems using Mathematica. I have an optimization problem but Mathematica does not seem to be able to solve it. I have tried all sorts of way to re-write it ...
2
votes
2answers
161 views

Continuous Min-Max problem

Being new to Mathematica, I tried my best to find some built-in functions or guides on how to solve the classical min-max problem $$ \min_{x} \max_{k} f(x,k,params) $$ with some additional variables $...
6
votes
2answers
234 views

Optimizing the edge lengths of a graph

This is a follow up to my question posted here The following code scales the edge lengths of a graph to be equal to edge weights ...
0
votes
2answers
47 views

FindMaximum under binary constrains

I'm trying to find a maximum for a function whose variables have binary values (either -1 or 1). The clumsy code for that constraint I use is shown below. There must be a more compact code, and I ...
0
votes
1answer
105 views

Maximize an expression with respect to a variable after its minimization with respect to other variables

I started to use Mathematica a few time ago. I want to minimize the following expression (function of $l,p,q,r,c$) with respect to variables $l, p, q, r$ and then maximize the result obtained with ...
1
vote
2answers
102 views

Maximize: x in Vectors[5, R] is not a valid variable

I am learning how to do optimization with a variable number of variables in Mathematica. I tried to write one experiment that I need to do but I have failed to get even a stripped-down version working....
2
votes
1answer
68 views

Generate constraints that ensure positive definiteness

What is a good way to generate algebraic constraints that ensure matrix be positive definite? Ideally, I'd be able to do something like below ...
0
votes
0answers
36 views

Speeding up a Table with NMinimize

I have a parametric system of differential equations (a and b are the parameters). For every value of the parameters in a given range I want to find the right initial conditions to fit some ...
1
vote
1answer
48 views

Minimize a function of a variable of four variables and one parameter with constraints

I just started to use Mathematica. Using the following simple command to minimize a function of variables $a,b,c,d$ with parameter $n$, it takes too much time. Do you know if there is a mistake in ...
0
votes
0answers
29 views

Minimize and ParametricNDSolve

I'm trying to fit an observed orbit data={years,xobs,dx,yobs,dy} where xobs and yobs are the observed coordinates and dx,dy the corresponding errors. I must fit ...

1 2 3
4
5
35