Reputation
Next tag badge:
143/100 score
19/20 answers
Badges
8 119 217
Impact
~996k people reached

20h
comment Constructing Tri-Diagonal Matrices
Your second snippet is what was usually done before SparseArray[] came along.
20h
revised NSolve doesn't work on an equation containing a numerical integral and constraints
edited tags
21h
comment Eigenvectors of numerical matrix
Until your observations have been reproduced, please do not add the bugs tag to your question.
21h
revised Eigenvectors of numerical matrix
edited tags
1d
comment Finding planetary conjunctions with Mathematica (project-level)
It's a bit complicated, yes. But I can offer a tiny tip now: considering the degree of the polynomials you're dealing with, I would suggest looking into the Clenshaw recurrence to evaluate your Chebyshev series.
1d
comment Using Plot and Piecewise to graph a roller coaster
@bel, yes, the customers will be complaining of sore bottoms after the ride… :D
1d
comment Using Plot and Piecewise to graph a roller coaster
What we are saying is that the first and second derivatives also have to be (made of) continuous functions, in addition to the curve itself. These are the sorts of things actual roller coaster builders worry about.
1d
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)…
1d
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?
1d
comment Automatically detect higher slope in numerical data (within a certain range)
I wonder if GradientFilter[] might be more suitable here…
1d
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.
1d
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.
1d
revised Can I customize the shell command line prompt?
edited tags
1d
comment DensityPlot: giving the same color to a range of values
Look up Clip[] and the option setting ColorFunctionScaling.
1d
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.
1d
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.
1d
revised What is the fastest way to get the nth distinct permutation of a list?
edited tags
1d
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.
1d
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.
1d
comment Modifying the content of a list
Thread[list -> groups] is what I usually do.