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
1 answer
69 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
218 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. <...
user avatar
  • 16.6k
0 votes
3 answers
237 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 ...
user avatar
  • 169
0 votes
0 answers
48 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$ ...
user avatar
  • 125
0 votes
2 answers
107 views

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

...
user avatar
0 votes
1 answer
71 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 ...
user avatar
0 votes
2 answers
127 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 ...
user avatar
1 vote
1 answer
104 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 ...
user avatar
  • 169
0 votes
0 answers
34 views

How to obtain the most accurate maximum value of the given equation? Changing WorkingPrecision gives different results

I have two functions $ f(x,y) $ and $ g(x,y) $ over the domains $ 1.56 <x< 1.6$ and $3<y<\pi$. ...
user avatar
  • 463
0 votes
0 answers
31 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(...
user avatar
  • 463
0 votes
2 answers
109 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(...
user avatar
  • 463
2 votes
2 answers
127 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 ...
user avatar
  • 633
3 votes
2 answers
126 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: ...
user avatar
0 votes
1 answer
87 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 ...
user avatar
2 votes
3 answers
181 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 ...
user avatar
  • 199
6 votes
1 answer
205 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 ...
user avatar
  • 621
0 votes
0 answers
60 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) ...
user avatar
2 votes
1 answer
171 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? ...
user avatar
1 vote
1 answer
93 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: ...
user avatar
2 votes
1 answer
63 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 ...
user avatar
0 votes
0 answers
95 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\...
user avatar
0 votes
0 answers
68 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) ...
user avatar
  • 1
0 votes
2 answers
94 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 ...
user avatar
0 votes
0 answers
67 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 ...
user avatar
0 votes
0 answers
57 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 ...
user avatar
  • 581
0 votes
1 answer
67 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 ...
user avatar
0 votes
0 answers
31 views

Social Planner Problem and Dynamic Optimization

I am reading following article: https://www.tse-fr.eu/sites/default/files/medias/doc/by/nguyen/1august13_jmerev_gln.pdf and trying to code the optimization problem given in the page 6 (eq P-6). The ...
user avatar
  • 581
0 votes
0 answers
28 views

How to solve Dynamic Optimization problem involving expectations

I am very new in wofram mathematica, so please apologies if my question is too obvious or not clear enough. I have the optimization problem which involves expactations and summation, \begin{align*} \...
user avatar
  • 103
1 vote
3 answers
101 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, ...
user avatar
  • 21
1 vote
0 answers
64 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 ...
user avatar
  • 21
0 votes
0 answers
95 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 ...
user avatar
1 vote
0 answers
68 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 ...
user avatar
  • 199
1 vote
0 answers
57 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 ...
user avatar
  • 612
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
51 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
104 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
134 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
89 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
  • 485
1 vote
0 answers
62 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
  • 612
0 votes
1 answer
66 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
62 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,626
2 votes
1 answer
72 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,626
1 vote
1 answer
83 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,624
0 votes
1 answer
208 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
27 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
30 views

NMinimize with if condition

...
user avatar
  • 11
0 votes
0 answers
66 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

1
2
3 4 5
38