# Tagged Questions

Questions about optimizing code for faster results, or how to do faster computations.

117 views

### Frontend cursor movement speed depends on the position in large notebook file

I run Mathematica v9 on my Atom laptop (don't ask) and I got used to the fact that everything is slower. Except for one annoying thing: cursor movement (in text) is slower than the keyboard key repeat ...
827 views

### Integration strategies for oscillatory multidimensional function

I am seeking to integrate a highly oscillatory, multidimensional function. I am currently using NIntegrate's QuasiMonteCarlo approach. However, this is time-consuming and, given my current resources, ...
342 views

### Performance in parameter estimation from ParametricNDSolve using varied initial conditions

I have 250 data points from a timecourse exeriment in a list, with columns specifying (1) time, (2-4) initial conditions, (5) absorbance reading. I want to fit 4 parameters (k1, k2, k3, k4) in a DAE ...
551 views

### Remove linear trend from data

I have a large data set with 150k lines and two data columns. I noticed that there is a linear trend, which I want to remove. So, I do the following: first fit with a linear model ...
205 views

### Speeding up a simple simulation with random extractions

I wonder if anybody can help, I need a hand with a simple simulation I am writing with Mathematica (I am using version 8). Basically it creates a list (called l) with numbers from 1 to n and a random ...
230 views

### Project Euler (memory and speed issues)

Let n be a positive integer. An integer triple (a, b, c) is called a factorisation triple of n if: 1 ≤ a ≤ b ≤ c a·b·c = n. Define f(n) to be a + b + c for the factorisation triple (a, b, c) of n ...
412 views

### Efficiently finding the positions of a large list of targets in another, even larger list

I have a big list. It contains nearly 60,000 sub-lists. It's structured like bigList = {{x1,y1,z1},{x2,y2,z2},{x3,y3,z3},.....,{x60000,y60000,z60000}}; I have ...
184 views

### Alleviating a bottleneck involving a function call with symbolic derivatives

I have a bottleneck problem involving a function call with symbolic derivatives. I don't have much experience with Mathematica (or any dynamic language) and I'm certain that the way I've set this up ...
197 views

### EmpiricalDistribution for Gini Coefficient Runs Slow

I am repurposing code that I found in this blog post (http://datavoreconsulting.com/sports/gini-coefficients-and-the-olympic-medal-race/) to generate the Gini coefficient for other data sets I am ...
319 views

### Speeding up code by avoiding repeated evaluation of a function

I want to speed up my code and I have two ideas, but I don't know how I can implement them. Here is a little part of my code, which I want to improve: ...
757 views

### Speed up Numerical Integration

EDIT: I need to evaluate a very complicated multi-dimensional Integral. The dimension of the Integral depends on a variable j. Let's make my point clear with the ...
577 views

### symbolic integration of a definite integral, how to speed up

I am wondering what are the general tips & hints for speeding up symbolic integration. As far as I understand, it solely depends on the form a function is represented before it is processed by ...
520 views

### Random number generation with specific distribution

I am writing a program for solving the shortest path in travelling salesman problem, with a twist that there are multiple salesmen who partition the cities among themselves, thus creating two part ...
317 views

### Use of Cellular Automaton or Discrete Convolution to calculate Potts Energy of a 2D Matrix

In a project of Monte Carlo Modelling of Grain Growth (Link) one of the most costly subroutines is the calculation of the Potts-Energy of an Monte Carlo Grid cell by comparing the center cell value ...
558 views

### Fast Simulations with Compile

this post relates to another post that I didn't follow up propely. If I wanted to simulate a system of stochastic proesses like the following, and loop over this run many many times would writing the ...
2k views

### Convolution with interpolated function

I have some problems to calculate in reasonable speed the convolution of an interpolated function with a Gauss function. I have here (ExampleData.txt, alternate Pastebin link) data which I ...
676 views

### How can I speed up the classic GA for graph coloring?

I'm trying to compute the chromatic number of this graph (which is 28): g = Import@"http://www.info.univ-angers.fr/pub/porumbel/graphs/dsjc250.5.col"; My genetic ...
389 views

### Why is AstronomicalData so slow?

I'm having trouble getting some pretty simple functions using AstronomicalData to perform at anywhere near the speed I need them to. For example, I have many ...
1k views

### Improving NDSolve speed for heavily stiff problems

Having looked around the intergoogles and Mathematica.SE, I thought I'd pose a question with a minimum working example. Here is the situation I am trying to improve: I am solving a 4th order non ...
382 views

### How to speed up drawing a tangent plane?

I have this code to produce an interactive visualization of a tangent plane to a function: ...
1k views

### How to quickly calculate intersections of filled curves?

I am trying to quickly calculate the intersection of polygons with more than 6,000 points. A compiled solution would be preferable. Here is one example of the problem: ...
736 views

### Is there a simple example using OpenCLLink that shows performance advantages?

OpenCLLink allows Mathematica to use the OpenCL parallel computing language. I have done some tests on simple examples, but so far, the CPU regularly outperforms ...
222 views

### Why is LogLogPlot[] slower than Plot[]?

I notice that LogLogPlot runs quite bit more slowly than ordinary Plot. For example, consider the following two blocks of code ...