Questions tagged [mathematical-optimization]

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

1,818 questions
Filter by
Sorted by
Tagged with
29 views

My Differential evolution algorithm does not minimise

So far I have implemented the Differential evolution but my output does not show me any minimization is it possible to solve it ...
17 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 ...
22 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*} \...
31 views

why does parallelDo ignore these 2 lines of code? [closed]

I have this loop ...
50 views

How do I apply sow and reap in this loop? [closed]

Basically I want to make a graph about the intensity of elp over a line during a time interval. However elp and ...
87 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, ...
57 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 ...
67 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 ...
58 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 ...
54 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 ...
54 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$....
57 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 ...
37 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: ...
94 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? ...
107 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 ...
83 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 ...
59 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 ...
60 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$...
69 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$...
59 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. ...
198 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 ...
19 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 ...
29 views

...
30 views

...
65 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.
69 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? ...
67 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 ...
84 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: <...
76 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$. ...
111 views

45 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: ...
56 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)....
94 views

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 ...
47 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 ...
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 <...
77 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 ...
31 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 ...
193 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 ...
147 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 <...
25 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 ...
64 views

FindMinimum/FindRoot failed to converge

I have a function SQ where it is also determined by sig. For b=0.1 and ...