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
1 vote
2 answers
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
1 answer
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): ...
user avatar
2 votes
3 answers
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
0 votes
3 answers
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
0 votes
0 answers
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
0 votes
2 answers
130 views

NMinimize keeps giving the error not a real number despite having used ComplexExpand

...
0 votes
1 answer
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) ...
0 votes
1 answer
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
2 answers
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 ...
1 vote
1 answer
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
0 votes
0 answers
36 views

Which result is more reliable in NMaximize in the given code? with `WorkingPrecision` or without it?

I have two functions $ f(x,y) $ and $ g(x,y) $ over the domains $ 1<x< 2$ and $0<y<\pi$. I use ContourPlot to ses those values of $(x,y)$ for which $g(...
  • 659
0 votes
2 answers
123 views

How to calculate the maximum value of $x $ which satisfy the conditions $g(x,y)=0$ and $f(x,y)>1$?

I have two functions $ f(x,y) $ and $ g(x,y) $ over the domains $ 1<x< 2$ and $0<y<\pi$. I use ContourPlot to ses those values of $(x,y)$ for which $g(...
  • 659
2 votes
2 answers
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
3 votes
2 answers
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: ...
0 votes
1 answer
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 votes
3 answers
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
6 votes
1 answer
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
0 votes
0 answers
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) ...
2 votes
1 answer
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
1 answer
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: ...
2 votes
1 answer
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 ...
0 votes
0 answers
159 views

The function value is not a number

I am trying to use NSolve and NMaxValue to solve pn for a problem like: $$ u(x^*,p_n)=0\...
0 votes
0 answers
78 views

Poincaré Sections with periodicity for non linear system

I am trying to calculate the Poincare section for this system of equation at different on Mathematica initial conditions \begin{align} x'(t)&=-0.1 x(t) y(t)^2-0.02 x(t) z(t) \sin ( \omega t )-y(t) ...
  • 1
0 votes
2 answers
98 views

Mathematica and analytical solution not matching

I have the function $$f(r,t)=r^{2n}-2 r^n\cos nt+1$$ where $n $ is an integer. I want to find the maximum value of $f$ over $(r,t) \in [0,1] \times[0,2 \pi]$. As usual in order to find the critical ...
0 votes
0 answers
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 ...
0 votes
0 answers
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
0 votes
1 answer
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 ...
1 vote
3 answers
107 views

Optimizing operations between vectors

Basically I am generating a grid in space (so a vector where v[[1]]=position 1 in x) and a random number of particles in space (so a vector where p[[1]]= position of particle 1 on space). Afterwards, ...
  • 21
1 vote
0 answers
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
0 votes
0 answers
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
0 answers
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
0 answers
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
0 votes
1 answer
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
0 votes
1 answer
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
3 votes
1 answer
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
3 votes
1 answer
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
2 answers
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 ...
4 votes
0 answers
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
0 answers
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
0 votes
1 answer
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
0 votes
1 answer
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
2 votes
1 answer
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
1 answer
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
0 votes
1 answer
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
0 answers
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 ...
0 votes
0 answers
34 views

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

...
  • 41
1 vote
0 answers
37 views

NMinimize with if condition

...
  • 41
0 votes
2 answers
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
3 votes
1 answer
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 ...
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: <...
  • 11

1
3 4
5
6 7
41