Linked Questions

0
votes
0answers
80 views

Why mathematica is returning error when computing correlation under Compile?

Can someone tell me what am I doing wrong here .. ...
4
votes
1answer
120 views

What exactly prevents this code from compiling?

I am trying to compile a function that operates on an initial array (doing some sequential operation) to produce a matrix (which consists of N iterations of the initial array). Below is a minimal ...
3
votes
1answer
93 views

Compiled Function is slower than non-compiled version?

I need to maximize a function numerically, thus the speed of this function is very important. Here is the most time consuming part of this function. ...
3
votes
1answer
84 views

How to do meta-programming inside Compile?

I'd like to do this: solve some linear systems, compiling the task of getting the building up the matrices from parameter values, and then I have a compiled implementation of LinearSolve. The problem ...
3
votes
1answer
68 views

How to use a list inside Compile—it says it should be a machine-size real number?

Super simple question, but I'm lost here. f = Compile[{{a, _Real}, {b, _Real}, {c, _Real}}, x /. NSolve[a x^2 + b x + c == 0, {x}]] f[1., -4., -5.] gives the ...
10
votes
1answer
462 views

Writing compiled functions as fast as Python's Numba

I want to write some code to simulate a damped oscillator that is just as fast as code written using Numba's @njit decorator. I've written the mathematica code and ...
2
votes
1answer
103 views

LeastSquares vs ArgMin

From the documentation, we learn that: LeastSquares[m,b], when b is a vector, is equivalent to ...
17
votes
1answer
441 views

Solver for COVID-19 epidemic model with the Caputo fractional derivatives

As it is known in biological system with memory it would be suitable to use fractional derivatives to describe evolution of the system. In a current version of Mathematica 12.1 there is no special ...
16
votes
2answers
381 views

Improving Performance of an XY Monte Carlo

I normally write my Monte Carlo codes in Fortran for speed, but I was doing some quick and dirty work and wrote one in Mathematica for the XY model on a square lattice (see Kosterlitz-Thouless ...
5
votes
0answers
129 views

Optimize Use of PeakDetect in Mathematica

I am quite new to Mathematica and I am looking for some advice in order to improve and optimize my code. Here is what I am trying to do: Open a stream Read the stream line by line and store it in "...
6
votes
0answers
152 views

Possible Compile bug

Bug introduced in 11.3 or earlier The program: ...
3
votes
0answers
82 views

What are the recommended best practices for and common pitfalls of using Compile? [duplicate]

As evidenced in my last question there is much I do not know about how to write compilable functions. The basics are clear: one must load the appropriate packages ...
1
vote
0answers
110 views

Creating an Executable App

The CreateExecutable and Needs["CCompilerDriver"]` commands can run .exe applications in MMA. I would like to know if it is ...
1
vote
1answer
64 views

Pick inside Compile

I want to compile this function: ...
1
vote
0answers
79 views

Fourier Transform of streched exponential

I need to compute the Fourier Transform of a streched exponential (according to Wikipedia "it must be calculated either by numeric integration, or from a series expansion"; so I go for the first ...

15 30 50 per page
1
2 3 4 5
9