# Questions tagged [mathematical-optimization]

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

2,042 questions
Filter by
Sorted by
Tagged with
1 vote
160 views

### How to get x and y values and function of xy pairs (H[x,y]) from Histogramlist?

So I have generated a set of random data points as shown below sample1 = RandomVariate[BinormalDistribution[{0, 0.4}, {1.2, 1.2}, 0], 250]; From the sample, I ...
1 vote
77 views

### Path of Least Resistance Minimization Problem

I'm trying to find a path of least resistance using a matrix c of resistance and a given exogenous vector kOne of the total least resistance from point(n) to point(4) (the destination): ... 232 views

### How to prove or disprove an inequality with Mathematica?

I mean there exist $\lambda>0, x\in \mathbb R$ s.t. the inequality $$\frac{3^{\lambda } e^x+e^{3 x}+1}{2^{\lambda } e^{2 x}}<\frac{1}{10^{100}}$$ is valid. Here are my unsuccessful attempts. <...
• 21.1k
279 views

### How to compute higher iterations in mathemtica

I have the equation $u^{\prime\prime}(t)+u^{2}(t)-t^{4}-2=0$ such that $0\leq t\leq 1$and also I have $u(0)=0$ as well as $u(1)=1$. Noe the exact solution of the equation is $u(t)=t^{2}$. Now I ...
• 161
64 views

### NMinimize with a matrix argument

How does one specify that an argument in NMinimize should be understood as a matrix (of a given dimension)? For example, say I have two square matrices $F\succeq0$ ...
• 125
130 views

...
132 views

### How to find the value which minimises the residual sum of squares

I have 3 equations with 3 parameters(unknowns). I would to solve it using newton raphson method. I want to use initial values (parameters) for the Newton Raphson procedure as the value (parameters) ...
• 111
106 views

### How does one use NumericQ when NMinimize isn't being called in a function?

I have a value that is calculated based on the matric multiplication of 3 matrices, a projection in a hilbert space really. I then take the trace of this to calculate the probability ...
1 vote
197 views

### NMinimize does not reach the minimum

I need to minimize numerically an expression with constraints. The expression also includes a numerical integral (called 'PNoninteract'). The minimization apparently stops prematurely (I know roughly ...
• 11
1 vote
112 views

### Solution of a BVP by Means of DSolve [closed]

If we consider the BVP $y^{\prime\prime}(t)=\frac{3}{2}y(t)^{2}$ where $0\leq t\leq1$ and $y(0)=4$ and $y(1)=1$. Then its solution is $y(t)=\frac{4}{(1+t)^{2}}$. I have set the BVP above as in ...
• 161
36 views

• 659
152 views

### Bilevel optimization

I found a problem here How do we go about solving this in Mathematica? I did something like this: NMinimize[(x^2 + y^2 - 1)^2, {x, y}] this gives ...
• 653
196 views

### Animating Particle Motion Using Parametric Plot and Animate

I am attempting to animate my parametric plot and add a particle to move on the line but I am having difficulties. Here is my graph for the trajectory: ...
189 views

### Solve Riccati Equations by hand

I'm in the midst writing a bit about LQR problems and would like to show that some things in mathematica can be tested by trying to write such problems out by ones self, However I cannot seem to find ...
• 2,923
191 views

### How do I maximize the following?

I want to maximize $${T(\epsilon)=\max\left\{\log_{(1/y)}\left(|\sqrt{2}-x/y|\right):x,y\in\mathbb{N}, |\sqrt{2}-x/y|<\epsilon\right\}}$$ Edit: I changed the inequality, it was supposed to be ...
• 209
245 views

### Why does NMinimize using NelderMead without PostProcessing always stop at the nearest decade of iterations, e.g. 100, 110, 120

Why does NMinimize using NelderMead without PostProcessing always stop at the nearest decade of iterations, e.g. 100, 110, 120... Perhaps Catch Throw can prevent this e.g., see this answer, but that ...
• 645
74 views

### Optimization with NDSolve

Multiple variables involved in NDSolve need to be optimized. Previously, I shared my codes but didn’t get any helpful response. Please tell me how can I optimize multiple variables (say 30 or 40) ...
192 views

### FindMinimum running forever

I cannot get any output from the below-mentioned optimization problem. The program keeps running forever. What can I do to solve this optimization problem successfully? ...
1 vote
108 views

### RSolve unable to solve the equation

I gave the following code as input: RSolve[x[n + 1] == 1/2 x[n] + 2 Log[x[n]], x[n], n] Mathematica gave the same output: ...
69 views

### Minimize relating a geometric test

I want to find a circle with a center and a radius that includes all given points, like a circumscribed circle for the points. points data: https://www.dropbox.com/s/0unlv1vbngopu38/new_ref.txt?dl=0 ...
• 745
159 views

• 201
73 views

### Cannot Optimize where NSolve and NDSolveValue are involved with Multi-Variables

My Objective Function is Sqrt[Sum[((sol[[j]])^2), {j, 1, noofnode}]/noofnode] with variables v1, v2, v3, v4, v5, v6. But just ...
61 views

### NDSolve and system of differential equations

I want to solve an optimization problem. I got following code, but it end with no error message or a solution. Note : As of now, I am not using nu1,..nu4 variables even though they are defined in the ...
• 591
70 views

### Image of house being repaired via optimization (FindMinimum) example in documentation?

In Mathematica's documentation, I recall seeing an example where a noisy image of a house was repaired using an optimization method (possibly FindMinimum) with a very large number of parameters (one ...
• 217
1 vote
107 views

### Optimizing operations between vectors

Basically I am generating a grid in space (so a vector where v[]=position 1 in x) and a random number of particles in space (so a vector where p[]= position of particle 1 on space). Afterwards, ...
• 21
1 vote
69 views

### How can I make ParallelDo faster than Do?

I am trying to optimize my code as much as possible. So first I used a compile and now I am trying to parallelize the code in order to make it faster because in the end I will need to make a loop that ...
• 21
113 views

### How to Optimize a Finite Element Model with Multiple Variables in Mathematica?

Urgent Help, Please !!! I am attaching my codes for a Finite Element Model which needs to be optimized and the Objective Function ("of" in the code) has been mentioned at the last line of ...
1 vote
69 views

### Dividing list into smaller list using a set of rules?

Suppose we have the list for $n\in\mathbb{N}$ Range[1,n] We choose the number in the list where $x=1$, $x=n$ and $x=1+(n-1)/2$ round closest to and the numbers ...
• 209
1 vote
70 views

### Code review of my animation of Ellipsoid method

Feel free to suggest improvements (code-review) to my two functions (calculation and animation). They were made to visualize the workings of the Ellipsoid method in two dimensions. For example, see ...
• 622
61 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$....
• 209
61 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 ...
• 51
63 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: ...
• 332
113 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? ...
• 332
1 vote
227 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 ...
118 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 ...
• 717
1 vote
67 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 ...
• 622
74 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: ...
• 19
66 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$...
• 2,304
79 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$...
• 2,304
1 vote
285 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. ...
• 1,796
252 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 ...
• 1,350
1 vote
50 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 ...
• 11
34 views

...
• 41
1 vote
37 views

...
• 41
71 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? ...
• 11
81 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 ...
• 2,405