8,366 reputation
11950
bio website
location
age
visits member for 2 years, 10 months
seen 37 mins ago

4h
comment Random real numbers that sum up to specific value
See also Random numbers that add to 100, which has some nice plots that illustrate how the different strategies behave. Also an equivalent question on the statistics site: Generate uniformly distributed weights that sum to unity?
4h
comment Random real numbers that sum up to specific value
One can simply verify that PDF[DirichletDistribution[{1, 1, 1, 1, 1}], {a, b, c, d}] is constant inside the simplex.
6h
comment Random real numbers that sum up to specific value
+1. Using DirichletDistribution[{1, 1, 1, 1, 1}] gives the same distribution as the method described by Vynce, i.e. uniformly distributed on the simplex $\sum x_i=1, x_i\ge 0$.
2d
comment Generate nonoverlapping random circles
Previously: mathematica.stackexchange.com/q/11940/484
Dec
24
comment Sinusoidal Wave over a Circle
PolarPlot[r + Sin[n theta], {theta, 0, 2 Pi}]
Dec
24
comment How does NSolve return?
Use alpha2[fc_] := Clip[1 - 0.003 fc, {0.67, 0.85}] instead.
Dec
23
comment Intelligent vertex placement in large tree graphs
You could use the first part of this answer to find all the linear chains in the graph. I haven't thought yet about how to collapse them.
Dec
23
comment How to cut a thick curve in half lengthwise?
@Kim By "filled with white" I meant colouring the interior of the cardioid with white, not the perimeter. In the road metaphor this covers the inside lane as well as the traffic island in the middle. I believe that's what the first part of Algohi's answer does.
Dec
23
comment How to cut a thick curve in half lengthwise?
If you don't need the inside to be transparent, what I do is to draw the curve again filled with white, leaving only the outer half showing.
Dec
23
comment How to make a graph of this function?
In general, one needs to evaluate a function in order to plot it. If your function cannot be evaluated, you need to fix it so that it can.
Dec
22
comment Find Unconnected Subregions
@David: I just typed Connected into a notebook hoping something related to connected components would show up, and there it was.
Dec
22
comment Finding periodicity of multidimensional data?
Look at the peaks of Total /@ ListCorrelate[data, data, 1]?
Dec
21
comment How can I improve ContourPlot to get smooth curve?
The data file is fairly large and I'm on a slow connection, so forgive me for asking, but does the file contain the original data array or just the InterpolatingFunction? As bbgodfrey's answer shows, the oscillations are inherent in the InterpolatingFunction, and it's quite possible that adjusting the parameters of Interpolation could solve the problem, but to do that we would need the original data.
Dec
20
comment Plot of Implicit Equations
I think you've misunderstood the plot. As your first plot shows, $f$ has a very large number of zero crossings in the solid region. Therefore, ideally a very large number of contours should be drawn there. If you draw a very large number of contours in a small area, it looks like a solid region, as the red plot correctly shows. It's the Mathematica plot which incorrectly suggests that, for example, there are no zero crossings in the neighbourhood of $(4,2)$.
Dec
19
comment How can I use ContourPlot to creat streamline for a free surface domian: proper arrow orientation and correct domain?
Anyway, I do think that this is a misfeature of Mathematica. Contour lines of a scalar function can be assigned a consistent orientation based on which side of the line has the larger function value, and it would be nice if Mathematica automatically respected that orientation. In the meantime, I hope someone posts a nice workaround.
Dec
19
comment How can I use ContourPlot to creat streamline for a free surface domian: proper arrow orientation and correct domain?
Here's a nice fake example for y'all: sl = ContourPlot[Cos[x] + 1/2 y^2, {x, -2 π, 2 π}, {y, -π, π}, Contours -> 5, AspectRatio -> Automatic, ContourStyle -> Directive[Black, Opacity[1]], ContourShading -> None]
Dec
16
comment How can I create a minimal surface with trefoil knot as inner edge and circle as outer edge?
Although for the latter, "Visualizing Minimal Surfaces" from The Mathematica Journal seems relevant.
Dec
16
comment How can I create a minimal surface with trefoil knot as inner edge and circle as outer edge?
Topologically, this is the Seifert surface of the union of a trefoil knot and an unknot (a circle). Seifert gave an algorithm for obtaining such a surface, but converting it to Mathematica code is another matter. As is making it a minimal surface...
Dec
15
comment Processing a circular rainbow in an image
Is this answer really enhancing the colours and structure that exist in the original image, or is it simply imposing the colours and structure of a different image on it?
Dec
14
comment Sampling phase space uniformly for a given energy
...This sounds like a hard research problem. Even in your 1D example, if you don't have $\frac1{2m}=\frac{m\omega^2}2$ you're trying to sample uniformly from the boundary of an ellipse, and that's not easy.