We’re rewarding the question askers & reputations are being recalculated! Read more.

All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
30 views

Is there a feasible computation?

I have to find the values of $p_1$ and $p_2$ which minimizes the expression $G$. However, when I took the partial differentiation of $G$ with respect to $p_1$ and $p_2$, the equations I obtained were ...
6
votes
4answers
644 views

MaxDetect speed

What's the fastest way to find the local maxima of a 2D list? E.g. ...
12
votes
0answers
135 views

Linear programming with lazy constraints

Does Mathematica offer any means for solving linear programming problems with "lazy constraints", as described e.g. here? While I am not very familiar with linear programming, my understanding of the ...
1
vote
0answers
25 views

Wish to increase speed of MaximizeOverPermutationMH merit function

I am working with MaximizeOverPermutationMH (see Link to discussion about function and would like to optimize the execution speed of the merit function. This function accepts a 100-digit permutation ...
2
votes
2answers
84 views

Finding extremes in discrete data by the fastest code

everybody! I'm new and that's my first post. I have such a problem: need to extract from a matrix (with dimensions n x 2) such points which have second coordinate smaller than -500 or higher than 500....
1
vote
1answer
58 views

How to disable symbolic preprocessing in NMinimize without performance loss?

I want to find a global minimum of a function which is defined only numerically and cannot be evaluated with symbolic arguments. For example, this could be a minimum of a compiled function. ...
1
vote
0answers
70 views

Memory leak in simple program

I am trying to solve a simple optimization problem on the sphere, and for some reason, I got some memory leak that I am not able to solve. To decompose the problem in step, what I wan to do is Take ...
0
votes
0answers
53 views

Rearrange a symbolic function in order that the result contains a minimum number of SQRT() and CBRT() calculations

I use mathematica for analytically calculating a function, which solves two equations: ...
4
votes
1answer
117 views

Speedup of DimensionReduce

I am interested in accelerating DimensionReduce using the "TSNE" method. I have a matrix with a size of 30000 * 10, and I want to reduce to 30000 * 8. But the calculation is very slow, any suggestions ...
0
votes
1answer
42 views

How can I specify the region for every variable simultaneously in NMinimize?

I want to use NMinimize to find the unknown unitary matrix that solves a (possibly nonlinear) matrix equation. For example, the one that transforms the Pauli matrix ...
1
vote
2answers
157 views

Anyway to Speed up this code?

I have the following code: ...
3
votes
2answers
116 views

Programming with Mathematica Syntax - Dunford decomposition

I am always amazed while I am reading some solutions of problems in mathematical problems of this site with Mathematica. For instance, look at the problem 48. Whereas I am writing 100 lines of code ...
1
vote
3answers
100 views

Find k largest edges with unique nodes (kind of maximum weighted matching)

I have a weighted graph, and I am interested to find k largest edges with unique nodes. Currently, I do it in the following manner ...
2
votes
1answer
58 views

Unable to use `Solve` to solve simultaneous equations, or use `Maximize` for exact maximum solution

Mathematica has found that the maximum of the following function is negative using NMaximize, but I am trying to prove that the maximum is negative (i.e. that the ...
0
votes
1answer
45 views

Optimization with constraint or with the constraint embedded into the problem?

I need to find the minimum of a function. However, the condition is that the final state should be normalized i.e. sum of the squares must be one. One way to deal with it is just add the constraint ...
3
votes
0answers
215 views

Automated searching for maximal 2D point configurations

I have some black-box function that takes lists of 2D points, and I would like to find some practical methods of searching for collections of points that maximize it. Motivation I've come across ...
1
vote
1answer
123 views

Speedup of reduce function?

I tried to run this $15$ variable feasibility linear programming to see what the solution looks like. Unfortunately it is taking too much time on my laptop. Is there a way to speed it up? Any tips ...
2
votes
1answer
66 views

Improve speed in Sum of probabilities ~ Normal Distribution

I am having some performance problems, and I need some advice. I understand that my code is not well written ...
8
votes
1answer
228 views

Is there any way to speed up this code that's Maximizing a function got from numerical integration?

I have this code below, which is calculating the Binding energy of an electron in a Quantum Well Wire with a hydrogenic impurity in it. Well you don't have to care much about what kind of calculation ...
0
votes
0answers
62 views

My method for finding local minima takes too long

I am trying to find all the local minima of a function, in a specified region of space. Unfortunately this is taking way too long for large system sizes, and I am wondering whether it's just because ...
2
votes
0answers
51 views

Using FindMinimum to solve equations as constraints

As suggested here, a system of equations can be seen as constraints in a minimization procedure with a zero cost function. For instance: ...
4
votes
1answer
441 views

Optimizing and Improving Gradient Descent Function

In an effort to create an interactive gradient descent visualization I am using the following gradient descent function, ...
11
votes
1answer
380 views

Maximize area of intersecting triangle and square with constraints

There is this nice problem on mathoverflow to find a maximum intersection area of a square and a triangle with a constraint that they both have unit areas. I tried to solve it with a help of ...
3
votes
1answer
83 views

Improving the efficiency of applying FindMinimum to a very large table

I am working with a large table that has around 200,000 elements. Each element is a function of a single variable u. For example, one element looks like ...
2
votes
1answer
140 views

How to improve the speed of NMaximize function

My problem is as follows: Consider a 5*5 matrix Obj with 0 and 1 Obj = Array[x, {5, 5}]; The objective function is: ...
-1
votes
2answers
188 views

Can Minimize work faster and/or be parallelized?

Having executed ...
0
votes
1answer
126 views

Calculating minimum potential energies for Thomson problem

I have found a table of values for minimum potential energies up to 470 electrons on Wikipedia. However, the method I used for calculating energies is not efficient enough for configurations that have ...
0
votes
0answers
49 views

How can I speed up the evaluation of my equations?

Calculation of eigenvalues and eigenvectors in dependence of the parameters ...
0
votes
0answers
102 views

Compile function for NMinimize

I have a the following script, which essentially minimizes the function $h$ with respect to all the variables $a[\alpha][s][j][n]$, where $\alpha,s\in\lbrace0,1\rbrace$, $j \in \lbrace ,\ldots,\text{...
2
votes
1answer
99 views

Optimization for routine repeatedly using FindMaximum

I have a routine which repeatedly calls FindMaximum to find the local maxima of f[m,a,b,c] as a function of m only (i.e. considers a,b,c as fixed and then finds the values of m for which the function ...
3
votes
1answer
111 views

Maximising area of intersection of regions

I'm interested in maximising the area of intersection between two or more geometric regions (for now, in 2D). For instance, I can calculate the offset between the centres of two annuli with given ...
2
votes
1answer
235 views

Why is FindMinimum slow for this convex cost function of one variable?

I implemented a Kalman filter, which perfectly works. This filter has four parameters denoted here by Q1,Q2,R1,R2. I'd like to find the optimal parameters, in the ...
1
vote
1answer
261 views

How to speed up this code with NMaximize?

I want to maximize the expected exponential growth rate of the portfolio, which contains 3 stocks. I get the adjusted stock price for General Electric, Du Pont, and IBM. ...
26
votes
1answer
390 views

FindMinimum doesn't increase step size when necessary

(Cross-posted on Wolfram Community.) I've spent much time finding a minimal example demonstrating this problem with FindMinimum. Normally one faces this problem ...
2
votes
3answers
105 views

Find extremal values while plotting

I have a parametric function {x[t],y[t]}. I then do ...
0
votes
1answer
169 views

Problems with NMaximize [duplicate]

The Objective function I would like to Maximize takes less than a second to evaluate. There are several packages needed to evaluate it, so I'm not showing it here. ...
2
votes
1answer
265 views

Error with FindMinimum. The Message is FindMinimum::cnpcons

I want to run a rather demanding check of feasibility. I have 3565 non-negativity constraints for my variables, and one that makes them sum to a certain budget they shall not surpass. I also have ...
1
vote
1answer
225 views

Improving strategy to solve this constrained root-finding problem

I am looking for roots of the function eqs defined below. It has $2k$ unknowns and returns a vector of $2k-1$ components. The sole purpose of the following block ...
0
votes
1answer
157 views

Minimization of linear combination of vectors

Suppose I have a vectors in $\mathbb{R}^{6}$. For example, take the vector $v = k(-2,2,4,6,2,2)$. I would like to find some $k$ with the constraint that the last two components are necessarily non-...
1
vote
1answer
120 views

NMinimize error

I want to use NMinimize in the following way: ...
5
votes
2answers
249 views

Parallel function evaluation for minimal value

I am asking myself, if the evaluation of a function f looking for a minimal value over a discrete set of values can be parallelize (brute scan for a potential ...
3
votes
1answer
146 views

Speeding up constrained optimization problem solving

I have a problem on my homework with Lagrangian multipliers that Mathematica has now been bashing at fruitlessly for 10 minutes. I'm not sure whether I did something horribly wrong codewise, but it's ...
4
votes
0answers
149 views

Improving the speed of an optimization algorithm via compilation and parallellization

I have written an implementation of eight variants of the PSO-algorithm and I want to test them over a set of test functions. I am using parallelization as it improves the speed a lot and I have also, ...
0
votes
0answers
92 views

NIntegrate within NMinimize - how to optimize the code?

How I can optimize these numerical calculations? Most annoying is encountering instabilities (numerical errors). I have a predefined function: ...
1
vote
0answers
71 views

Evaluation of likelihood very slow

I am trying to implement a simple statistical model for the first time in Mathematica. My model is made my one random variable which is the sum of background and signal. Background is an exponential ...
0
votes
0answers
117 views

Simplifying sums of rational trigonometric functions

After simplifying the trigonometric functions as advised before (cf. Simplifying Expressions for FindMinimum), I obtained a sum of 62 similar expressions, the first three as in the below: ...
3
votes
1answer
180 views

Simplifying Expressions for FindMinimum

I am currently trying to apply the FindMinimum function to find the lowest energy of an expression. My current expression as of now is relatively complicated. It is the summation of 48 similar terms, ...
4
votes
1answer
209 views

Performance of a bootstrap - time of computation not linear with number of iterations

I'm doing a bootstrap based on this thread with the following code (file.txt here): ...
6
votes
0answers
220 views

How to perform Bayesian optimization with Mathematica? [duplicate]

Does Mathematica have any Bayesian optimization methods for learning hyper-parameters? Practical Bayesian Optimization of Machine Learning Algorithms Jasper Snoek, Hugo Larochelle and Ryan P. ...
1
vote
0answers
187 views

How can I speed up this NM optimization? Most delay seems to be due to long analytic expression

I am struggling with computational speed of a NelderMead optimization. Nevertheless my impression is that I lose lots of speed not only due to the NM optimization itself but rather to for instance ...