Linked Questions

2
votes
2answers
81 views

`Solve` Performance Tuning

I'm facing a Problem in Mathematica, where I have to solve a large number of equations generated by an AppendTo. ...
5
votes
7answers
312 views

How to use AppendTo in a While loop? [closed]

I am trying to code a while loop that uses AppendTo to append the loop variable to an empty list. ...
5
votes
2answers
227 views

Mathematica taking forever to compute

I want to simulate the fresnel diffraction through circular aperture.But mathematica is taking forever to calculate.Here is my code. ...
6
votes
2answers
161 views

Achieve performance that is competitive with numpy [duplicate]

What are the best practices to ameliorate time performance of Mathematica? As a practical example how we can decrease timing below? ...
3
votes
1answer
103 views

Access to the temporary solution in NDSolve with StepMonitor

I want to step-monitor at each time step of a spatio-temporal NDSolve (using the finite element method) the maximum bending of the function sampled over the curent mesh. For this I first need access ...
14
votes
2answers
1k views

Finite difference method not converging to correct steady state or conserving area?

I am working with the following PDE, which is an advection-diffusion type equation. It describes the movement of a fluid-fluid interface inside an annulus of inner radius $R_1$ and outer $R_2$ under ...
2
votes
3answers
323 views

Random Geometric Graphs, but fast

I am optimising the random geometric graph generation ideas in this post. I need to generate a large number of random geometric graphs with probabilistic connectivity (soft random geometric graphs), ...
533
votes
19answers
133k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
130
votes
8answers
7k views

Can one identify the design patterns of Mathematica?

... or are they unnecessary in such a high-level language? I've been thinking about programming style, coding standards and the like quite a bit lately, the result of my current work on a mixed .Net/...
0
votes
1answer
95 views

How can I improve performance of my simulation code?

1) Generate nNsamples from beta distribution (a, b) and the parameter of wighted c ...
0
votes
0answers
84 views

averaging over large number of random realizations

I want to run following for few hundreds of a random variable set. This calculates: generate normal random variable find gain with squaring calculate performance metric find ...
67
votes
1answer
2k views

Is this the most effective and efficient programming style for prototyping (a ray tracer) in Mathematica?

I am trying out Mathematica as a prototyping tool. As an initial exercise I have put together a brute force ray tracer, with a view to using Mathematica's built in probability distribution functions ...
34
votes
9answers
3k views

How to select minimal subsets?

I am a newbie, so please point me in the right direction if you feel this question has been answered somewhere else before. Here goes: Suppose I have a list like this: ...
8
votes
2answers
583 views

Why won't this compiled function be inlined?

I've been trying to use Compile to get some code to execute more quickly, because I will need to call it millions of times. I've been using the ...
9
votes
2answers
650 views

Optimizing Mathematica Code

I have implemented the whole Baum-Welch Algorithm for training Hidden Markov Models as described in Rabiner's paper Here is my code that calculates the Forward Probabilities` ...

15 30 50 per page