Questions tagged [algorithm]
Questions about algorithms used or which might be used to implement a procedure known by name or loosely but not in detail. The subject of the question may be a procedure mentioned in the literature or a Mathematica built-in function
114 questions
93
votes
4
answers
57k
views
How to create a new "person curve"?
Wolfram|Alpha has a whole collection¹ of parametric curves that create images of famous people. To see them, enter WolframAlpha["person curve"] into a Mathematica ...
36
votes
6
answers
8k
views
Finding all elements within a certain range in a sorted list
Suppose we have a sorted list of values. Let's use list = Sort@RandomReal[1, 1000000]; for this example.
I need a fast function ...
29
votes
8
answers
2k
views
Splitting words into specific fragments
I am looking into splitting words into a succession of chemical elements symbols, where possible. For example:
Titanic = Ti Ta Ni C (titanium, tantalum, nickel, carbon)
A word may or may not be ...
55
votes
2
answers
4k
views
Adaptive sampling for slow to compute functions in 2D
EDIT: Although I have posted an answer based on my current progress, this in incomplete. Please see the "open issues" section in the answer.
Most plotting functions in Mathematica adjust the sampling ...
26
votes
2
answers
3k
views
Implementation of Balaban's Line intersection algorithm in Mathematica
I'm trying to implement a Brillouin Zone algorithm within Mathematica, including the generation of Brillouin zones of higher order in 2D and 3D. There is a nice implementation of generating these ...
20
votes
5
answers
4k
views
Implement the Bisection algorithm elegantly and easily
Description:
Rencently, I have finished my course Numerical Analysis, so I'd like to implement many algorithm that I have learned from that course.By this practice, I hope that I can improve my ...
18
votes
2
answers
4k
views
Bresenham's line algorithm
Bresenham's line algorithm is producing discretized line for given two points for purpose of plotting for example.
Like that:
I have to stress that I'm interested in positions, not a plot.
Wikipedia ...
30
votes
3
answers
13k
views
Plotting a set of trajectories (not a vector field) in 3D
Consider a set of trajectories in 3D space, that possibly converge. By visualizing trajectories as arrows the result will look crowded as each arrowhead will be placed where the attractor is. In 2D, ...
13
votes
5
answers
7k
views
How to deal with recursion formula in Mathematica?
In engineering problems, I am always seeing many recursion formula.
For instance, In the book "The NURBS book", I discovered many recursion formula
Fibonacci $$f(n+...
42
votes
4
answers
6k
views
Finding a percolation path
I would like to examine percolation on a random lattice. To be exact, I wish to find the minimum length of a 'bond' needed such that the leftmost site can be connected to the rightmost site.
Here is ...
39
votes
4
answers
3k
views
How to implement the sample-point process like the built-ins of Mathematica?
Consider this:
pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}, {4, -2}, {5, 1}};
f = BSplineFunction[pts]
I can use ParametricPlot to ...
33
votes
3
answers
2k
views
Computing polynomial eigenvalues in Mathematica
MATLAB offers a function polyeig for computing polynomial eigenvalues, which appear, for instance, in quadratic eigenvalue problems (see here for some applications) ...
12
votes
2
answers
1k
views
Determining whether two $k$-chromatic graphs are isomorphic (respecting vertex coloration)
Consider the case where I have two $k$-chromatic graphs $G_1$ and $G_2$, i.e. two graphs where individual vertices can be colored with one of a set of $k$ total colors, and I would like to determine ...
20
votes
1
answer
802
views
Simulating Theatre puzzle
I have been trying to simulate the process of the theatre puzzle from the Joy of X (Strogatz).
The puzzle, and some relevant material are here.
My simplistic coding for this process follows:
...
10
votes
3
answers
751
views
Faster Alternatives to DateDifference
I need a faster implementation of FractionOfYear and FractionOfMonth, which do the following:
Input: A time/date specified by <...