# Tagged Questions

Questions on optimizing Mathematica code for higher performance. This may mean faster execution, lower memory usage or both. Not to be confused with mathematical optimization.

164 views

117 views

### How to increase speed of iterations with nonlinear functions

Let me ask about part of a problem which I have in solving of a nonlinear DE (numerically). I am working with vectors of length $xN$. I have an initial vector $v$, a given $xN\times xN$ matrix $A$ and ...
212 views

### Speeding up generation of block diagonal matrix

I'm struggling with the following problem. I have $48$ square matrices (full, filled with real machine precision numbers, thus are packed, all different) of size $128$. I wolud like to place them on a ...
87 views

### Deleting isomorphic graphs efficiently

I'm trying to delete isomorphic graphs from a large list. My solution is as follows: DeleteIsoG1[gl_List]:= Module[{}, DeleteDuplicates[gl,IsomorphicGraphQ]]; ...
852 views

### Terrifying performance decrease for contour/density plots in v10.1 -> 10.3

Bug introduced in 10.3 and fixed in 10.3.1 I setup for download a test dataset at http://www.inrim.it/~magni/cm.dat.gz (a set of 64800 triplets x,y,z). The behavior can be reproduced with the ...
91 views

### Count degrees of freedom of a polynomial

I want to count the independent degrees of freedom of a polynomial in three variables $(z_0,z_1,z_2)$. Therefore I take the coefficients of $f$ and compute the rank Jacobian with respect to the ...
109 views

### Manipulate gets stuck when ConvexHullMesh is made transparent

Version 10.3 The followinng Manipulate is a bit slow, but quite OK ...
168 views

### precision and speed inefficiency issues of Nearest function with sqrt expression [closed]

Recently, Nearest has been attacked for many bugs. Some are already fixed. I am going to show some issues when Nearest applied ...
147 views

### How to be more efficient/faster with this MatrixExp-vector multiplication?

I am looking for expertise that helps to improve speed of the code below. First, a little bit of background: There is some system of differential equations $\dot{\vec{m}}(t)=S(t)\vec{m}(t)$. In order ...
343 views

### Smallest element distance between two lists

I have a problem, where I generate two lists of points, and I want to see which points are the closest. If I just want to find which ones are exactly the same, I can use ...
97 views

### MySQL insert statement over remote server is extremely slow. How can I speed it up?

I need to insert values to a remote MySQL server. However it is extremely slow compared to a local MySQL server. This is my timing for the local MySQL server ...
160 views

### Efficient and fastest way to execute 4 nested loops

I have a question regarding the use of ParallelDo. I tried to parallelize the following code involving four nested Do loops by ...
215 views

### Speeding up code for lattice generation

Below is a lattice point generation code I write ...
97 views

### Expensive MeshRefinementFunction

I want to discretize a region using DiscretizeRegion. Now, I want the mesh to be more refined, when the curvature of a certain function ...
62 views

### Can not understand this timing result

I set a=1. tmptmp = Tuples[Range /@ {1000, 100}].{{3 a, 0}, {0, Sqrt[3] a}} And then run ...
55 views

### NMinimize error

I want to use NMinimize in the following way: ...
62 views

### Long delays before showing the result in a notebook

I'm new to Mathematica. I have Version 10.3.0 running under Windows 10, 64-bit. If I open the 10.3.0 kernel and type 2 + 2 Shift Return I get an immediate answer. If I open the main program and ...
128 views

### Speed matrix multiplications

I am trying to run this function ...
183 views

### Exceeding time constraint of 300 seconds when taking coefficients of some expressions from schur polynomial [closed]

I have written a code that takes coefficients of some expressions from schur function, but it seems to take a lot of time, and Mathematica will stop after 300 seconds saying that it's over the time ...
89 views

### Efficiently traversing a list

Suppose I have a large list of algebraic expressions, sorted by their equivalent numerical value (under a certain set of assumptions). Some of these expressions are identical, but commands like ...
202 views

### Timing problem with ReplaceRepeated

I have the following data: ...
108 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 ...