J. M. is back.
Reputation
146/100 score
 Sep 1 comment Using Plot and Piecewise to graph a roller coaster @bel, in fact, if OP wants a smooth "ride" in his coaster, he should be matching up to the second derivative (i.e. a $C^2$ curve)… Sep 1 comment Using Plot and Piecewise to graph a roller coaster "below the x-axis" - then you're supposed to shift the $y$-component downward, no? Sep 1 comment Automatically detect higher slope in numerical data (within a certain range) I wonder if GradientFilter[] might be more suitable here… Sep 1 comment How to do multi-dimensional principal value integration? @luyuwuli, I don't believe those PV-specialized versions have ever been implemented anywhere; I might consider taking a crack at it over the weekend. At least according to my own tests, the current Mathematica implementations of DE and IMT are not equipped for PV use; the convergence rate is markedly poor. Sep 1 comment DensityPlot: giving the same color to a range of values @rcollyer, forgot that option! Thanks for putting up an answer; what I had in mind was ColorFunction -> ColorData[{"Rainbow", {-1, 1}}, Clip[(* stuff *)]], and yours is certainly more idiomatic. Sep 1 revised Can I customize the shell command line prompt? edited tags Sep 1 comment DensityPlot: giving the same color to a range of values Look up Clip[] and the option setting ColorFunctionScaling. Sep 1 comment How to do multi-dimensional principal value integration? Your new example looks like it can be dealt with by a hyperspherical coordinate substitution, suitably shifted. Sep 1 comment How to do multi-dimensional principal value integration? @luyuwuli, IMT and DE are in fact variable substitutions intended to squash endpoint singularities, so that the trapezoidal rule can efficiently deal with them. There are actually DE-type and IMT-type methods in the literature that are intended for principal value integrals, but AFAICT Mathematica has no implementation of these. Sep 1 revised What is the fastest way to get the nth distinct permutation of a list? edited tags Sep 1 comment Change size of a saved plot or image (post-processing) I'd say Show[] is more idiomatic tho; it's precisely the function intended for post hoc changes of graphics settings. Sep 1 comment How to implement the sample-point process like the built-ins of Mathematica? Yes, @Shutao, those two are the basis of the nonrecursive implementation I gave here. Sep 1 comment Modifying the content of a list Thread[list -> groups] is what I usually do. Sep 1 revised ParametricPlot and Piecewise function edited tags Sep 1 comment LUDecomposition does not give the expected results The (partial) pivoting (and thus the permutation matrix) is necessary, since without it, there are a lot of nonsingular matrices that won't have a triangular decomposition. Consider this simple example: {{0, 1}, {1, 0}}… Sep 1 comment LUDecomposition does not give the expected results A permutation matrix is orthogonal. How are orthogonal matrices inverted? ;) Sep 1 comment Modifying the content of a list Do you want the output to be a list of replacement rules list -> label or a list of just labels (strings)? Sep 1 comment ParametricPlot and Piecewise function Let me get this straight: you are plotting a trochoid, and you only want a few pieces of it, yes? Then you don't need the complication of Piecewise[]. Sep 1 comment My evaluation is taking a lot of time Good analysis. That plot of s45[[4]] was frightening, tho. :) Sep 1 revised How to generate a closed B-spline curve? edited tags