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
1 answer
58 views

Dividing a list of integers into a list of sub-lists?

Suppose we have a list of integers for arbitrary $n\in\mathbb{N}$ Range[1,n] We take the integer in the list that rounds closest to $x=1$, $x=n$, and $x=1+(n-1)/2$....
user avatar
  • 199
0 votes
1 answer
60 views

How to plot the peak of a wavefunction depending on time

I am trying to define a function to find the spatial peak of some interpolation function of two variables (one spatial variable and one temporal variable) which is the output of ...
user avatar
  • 51
3 votes
1 answer
53 views

How to use ConvexOptimization on a piecewise function?

I define a simple piecewise convex function, but ConvexOptimization does not take it as a valid input: ...
user avatar
  • 332
3 votes
1 answer
105 views

How to use ConvexOptimization on a function constructed from data?

Given the following data points sampled from a convex function, how could I construct a convex function that can be minimized using ConvexOptimization? ...
user avatar
  • 332
1 vote
2 answers
137 views

Mathematica: How can I solve the problem "The Kernel Local has quit (exited) during the course of an evaluation"

I am using a Mac Book with Monterey and 16GB RAM for a calculation with 2 nested For loops. I am relatively new to Mathematika and still trying to learn the language properly, so I hope the problem is ...
user avatar
3 votes
0 answers
90 views

Solving or Minimizing the Norm of the matrix equation $M^TAM - M^TB - B^TM =C$

I am trying to solve the matrix equation $M^TAM - M^TB - B^TM=C$ where I know A, B and C. My unknown matrix is M which has the special form that all the rows and columns sum to zero. i.e. I have four ...
user avatar
  • 495
1 vote
0 answers
63 views

Can LinearOptimization (ex. LinearProgramming) support other methods (Ellipsoid method)?

Can LinearOptimization (ex. LinearProgramming) support methods other than "InteriorPoint", "Simplex", "RevisedSimplex"? Specifically, I need the Ellipsoid Method. Are ...
user avatar
  • 622
0 votes
1 answer
67 views

Tips and tricks for minimization problem

I am quite new to Mathematica and would like to use it for a minimization problem. The function I like to minimize is: ...
user avatar
  • 19
0 votes
1 answer
63 views

Formalization of one optimization problem or solution of inequalities - Part №2

Continuing the question: Formalization of one optimization problem or solution of inequalities Let's consider a more complex problem. We have two polynomial: $p_1=A_2t^2+A_1t+A_0$ $p_2=B_2t^2+B_1t+B_0$...
user avatar
  • 1,721
2 votes
1 answer
73 views

Formalization of one optimization problem or solution of inequalities

I have polynomial: $p=A_2t^2+A_1t+A_0$ $A_0=(x^2-y^2)+xz$ $A_1=x^2+y^2+z^2+\sin(x)$ $A_2=x^4+y^3+z^2$ $x,y,z$ - parameters, moreover $z$ - the value of which varies in the range $[0,1]$. Polynomial $p$...
user avatar
  • 1,721
1 vote
1 answer
104 views

How to set Initial Points for optimization problems

How to set Initial Points for optimization problems in MMA? In this case,we do not need to set the range of the variable x1, x2. ...
user avatar
  • 1,746
0 votes
1 answer
212 views

Can FindMinimum and NMinimize be so wrong?

Here is a whole block of code that computes a function at the point vx0=2.2 and returns 61.9113, which is much lower than the ...
user avatar
  • 1,350
1 vote
0 answers
29 views

mistake results when using SDP for large-scale matrix

Recently I am struggling with a question during my research. Using the following Wolfram Mathematica code I could create any even-order symmetric matrix (matriceNew in mathematica) whose entries is ...
user avatar
0 votes
0 answers
30 views

NMinimise for piecewise objective function with decision variable in the limit/present in the condition

...
user avatar
  • 11
1 vote
0 answers
32 views

NMinimize with if condition

...
user avatar
  • 11
0 votes
0 answers
67 views

How to create an animating torus using mathematica or python? [duplicate]

I want to create this animating torus using mathematica or python. If anyone knows how to make this please try to explain the steps. Thank you zo much.
user avatar
0 votes
2 answers
70 views

How to use FindMaxium for a list of parameters?

How to use FindMaxium for a list of parameters? In the following code, if I assign single values to z and Rth, it works fine. How do I do the same for a list? ...
user avatar
  • 11
3 votes
1 answer
75 views

How to prevent unwanted output in NMaximize or NMinimize

I have problems with unwanted outputs of NMaximize. I tried to use the command Quiet[] and Off[] in order to turn off the warnings and unwanted outputs but no avail. You can see the NMaximize part of ...
user avatar
0 votes
0 answers
85 views

Is an analytic solution possible?

I have this problem: the parameters are T1, T2, R, Rthhot, Rthcold, and Z with feasible range >0. The variables are Rth and Rload. X and Y are functions of Rload and Rth given by the 2 equations: <...
user avatar
  • 11
0 votes
2 answers
107 views

Min and Max of a function

I need to obtain for what $a_i$'s the function: $$a_1 \ln (\sqrt{2\pi e} s_1) + a_2 \ln (\sqrt{2\pi e} s_2),$$ has a maximum and minimum, under the constraint $a_1 + a_2 = 1$; also, $s_1, s_2 > 0$. ...
user avatar
2 votes
1 answer
121 views

How FunctionConvexity is implemented in Wolfram Mathematica?

I am wondering how FunctionConvexity was implemented in Wolfram Mathematica. I am trying to prove the convexity of the function $A(v)$: $$ A(v) = -\dfrac{k-1}{\...
user avatar
  • 57
5 votes
0 answers
61 views

Memory leak in FindMinValue?

I was running some geometric optimisation code today using FindMinValue and for some reason at one point the memory usage goes upwards of 14GB, making the kernel ...
user avatar
1 vote
1 answer
67 views

Minimize Reprojection Error [closed]

I have a function Point= {2, 0, 0, 1}; x = ProjectionMatrix[f] . (RotateMatrix . Point + t) Return[x]; x is a 3D Vector. where the Projection Matrix is ...
user avatar
2 votes
0 answers
35 views

Precision Issue in LinearOptimization - dual solution is not feasible

Trying to solve a linear program with high precision requirements and am interested in both the primal and the dual solution. Prefer solving the primal problem for convenience and solving the dual ...
user avatar
  • 349
2 votes
2 answers
112 views

Solve Equations using Mathematica

Good day. I have a question of how to get the algebraic expressions for $a$, real part $b$ (denoted $Re(b)$), and imaginary part $b$ (denoted $Im(b)$). Let's say $a$ is a real number and $b$ is a ...
user avatar
  • 47
1 vote
0 answers
34 views

Iterated LinearOptimization

One common method for solving large linear optimization problems is "column generation". That method is in essence the "revised simplex" method with one change: given a current ...
user avatar
  • 349
4 votes
1 answer
68 views

Avoid Extrapolation When Using NMaximize on Interpolating Functions

I want to use NMaximize to find the maximum value given by one interpolation function with respect to a constraint given by a second interpolation function. The main problem is that NMaximize produces ...
user avatar
8 votes
1 answer
270 views

How to compute RandomReal faster?

I have variables $E_{1},E_{3}$ that are bounded in the following way: $$ \tag 1 E_{1}>m_{1}, \quad E_{3}>m_{3}, E_{2}\equiv m-E_{1}-E_{3}>m_{2}, \\ -1 < \frac{E_{2}^{2}-m_{2}^{2}-(E_{1}^{2}...
user avatar
  • 3,832
1 vote
0 answers
49 views

Plotting a user-defined function with NMaximize

I am not sure what is going on with this plotting. I see that the following code works: ...
user avatar
2 votes
1 answer
69 views

Constrained Optimization with Interpolating Functions

My goal is to use a gradient descent type method to maximize interpolating function1 with respect to the constraint that interpolating function2 <= 0.5. I am working with 4D data (please see below)....
user avatar
0 votes
1 answer
111 views

Two problems with ConjugateGradient

I am trying to solve a maximization problem for which I give you the code and try to step by step show you were it broke down. The first issue is that I have a constrained problem, which I try to ...
user avatar
  • 313
1 vote
1 answer
55 views

Optimization problem with input variables

I've been trying to solve an optimization problem using Mathematica. I'm 100% familiar with the programme, I just practised a few tutorials available online, but they were very small and the problem ...
user avatar
  • 13
0 votes
0 answers
24 views

How could I define a different tolerance for each constraint?

I'm minimizing a single variable subject to several different constraints of several variables (all of which are part of the set of numbers to be found). Some of they obey a hierarchy of the form <...
user avatar
  • 353
1 vote
1 answer
90 views

optimization with multiple parameters and differential equations

There might be some relevant questions and answers, but I couldn't complete my code by myself just by reading them. Sorry that I am very new to Mathematica and my question could be a bit rough and not ...
user avatar
  • 27
0 votes
0 answers
32 views

How to simply this maximization problem with too many variables and parameters?

I'm someone who is trying to teach himself economics. My training in math is minimal. Forgive any inexact and/or irregular notations and terminologies below. I'm trying to find out if the following ...
user avatar
  • 1
2 votes
2 answers
200 views

Draw a (1/4) partial 3D cylinder in a quadrant

Here is a code to draw a full cylinder $\theta \in [0, 2\pi)$: Graphics3D[Cylinder[{{0, 0, 0}, {1, 0, 0}}, 1/2]] My question is that how do we draw a 1/4 of the cylinder, such that it only appears in ...
user avatar
  • 823
2 votes
2 answers
154 views

FindMinimum::lstol

I have a function SQ[b,zQ,zh] where I want to find at which zQ it is a minimum given b and <...
user avatar
0 votes
0 answers
26 views

Maximize function parameter such that constraint is satisfied on entire domain

I want to find the greatest value for At such that the constraint f[At,x]<=0.5 is satisfied for every value of x. I would try ...
user avatar
  • 353
0 votes
0 answers
68 views

FindMinimum/FindRoot failed to converge

I have a function SQ where it is also determined by sig. For b=0.1 and ...
user avatar
1 vote
0 answers
109 views

How to find quadrilateral with maximum area?

Let the lengths of the sides of a quadrilateral equal a,b,c,d. What is the maximum area of such quadrilaterals? Wiki says that the quadrilateral with its maximum ...
user avatar
  • 17.1k
0 votes
0 answers
43 views

NMinimize too slow with non-linear constraints. Help to speed it up

First, let me introduce some parameters: ...
user avatar
  • 1
1 vote
0 answers
38 views

How to give constraints of two parameter optimization in Lagrange multiplier?

In the lagrange multiplier method, the equations are : f[x_,y_]:=x^2+y^2 g[x_,y_]:=6x+8y The range of x and y values are 0<=x<=0.9, 0<=y<=10. How can I give the mentioned range of values ...
user avatar
1 vote
0 answers
63 views

Computing Jacobians and Hessians directly for IPOPT optimizer

I've got a complicated expression for my constraint function $g(x)$, too complicated to let Mathematica compute the derivatives symbolically. By forcing only numeric inputs, IPOPT does (it appears) an ...
user avatar
  • 6,898
0 votes
0 answers
75 views

Maximize algebraic trigonometric function

I'm trying to maximize an algebraic function containing trigonometric functions: $$\mathrm{sol}=\frac{\sin\theta \cos(\alpha +\beta)\cos(\theta+\alpha+\phi)\cos\bar{\delta}}{\cos^2\alpha\cos(\alpha+\...
user avatar
  • 173
0 votes
2 answers
94 views

NMaximize - global maximum fail - How to?

Problem : Let x,y,z be non-negative real number whose sum is 1. Find maximum of 0.2x + 0.2y + x^2*z + y*z^2 What I did first was reducing variable. ...
user avatar
  • 2,825
1 vote
0 answers
80 views

How to solve ODEs using deep learning in Mathematica [closed]

I have a number of ODEs (58) with 16 parameters and 9 variables. I want to solve the ODEs to obtain the analytical relationship between the parameters and variables. It is obviously that the ODEs ...
user avatar
2 votes
0 answers
72 views

Lanczos method to tridagonalize a matrix

I want to tridagonalize a sparse matrix using the Lanczos algorithm. I am working with a very large sparse matrix and I need some speed. In the following for example ...
user avatar
4 votes
1 answer
209 views

Issue with ConvexOptimization over Matrices with Mathematica 12.2

With Mathematica 12.2, ConvexOptimization was introduced, which, as its name suggests, can solve arbitrary convex optimization problems over matrices [Language ...
user avatar
0 votes
0 answers
104 views

Solving a system of equations as part of maximizing a multivariable function

This is my code ...
user avatar
  • 268
27 votes
1 answer
735 views

Efficient multidimensional optimization while constraining some coordinates

I have a function f[x] with a high-dimensional vector input and a scalar output. I am looking to minimize this function while constraining some of the components of ...
user avatar
  • 225k

1 2
3
4 5
39