Reputation
26,579
Next tag badge:
217/100 score
18/20 answers
Badges
11 86 201
Impact
~389k people reached

1d
comment Empty WhenEvent action crashes kernel
Thanks a lot @Szabolcs, submitting to TechSupport. I've found more bugs in the last month than in the last 10 years of using Mathematica. It's like crossing a threshold after which one cannot really be productive due to seeing bugs everyewhere. They are swarming...
1d
comment NDSolve kernel crash, affected by variable naming
@Simon Could you please specify if your Windows is 32 or 64 bit?
2d
comment NDSolve kernel crash, affected by variable naming
Thanks @bbgodfrey, at least I know that it is not my machine against the whole world. The oscillating, spikey behaviour is expected, but of course the present example has rather extreme numerical values for parameters..
Apr
27
comment How to find local minima of data using PeakDetect
It would be nice to have a method to find local minima and maxima in one go. For large data, this doubles the time, somewhat unnecessarily.
Apr
20
comment How can a function know in which function it was evaluated?
I know these kind of days too well... : ) Thanks anyhow.
Apr
20
comment How can a function know in which function it was evaluated?
Is there any way to get f as output in this case: getCaller[] := Module[{y}, Stack[]]; f[] := getCaller[]; f[], without explicitly passing f to getCaller or wrapping everything in StackComplete? It seems that Stack[] can only look into the rhs of the definition.
Apr
14
comment How to change frame size, while maintaining ImageSize?
Many related: 1337, 4059, 1025, 66350, etc.
Apr
14
comment Find min-max for slope in linear fit
Have you looked at the references for Fit and LinearModelFit?
Mar
29
comment Problem with PlotLabels
Bug is all over the place with PlotLabels, see e.g. LogPlot[{0, 0.1}, {t, 0, 1}, PlotLabels -> Automatic], Plot[0, {t, 0, 1}, PlotRange -> {{0, 1}, {.001, All}}, PlotLabels -> All]. Reported them and TechSupport has filed it internally.
Mar
23
comment How to set focus of a dialog window?
I think this deserves to be the definitive answer. Thanks for the research!
Mar
19
comment Why Unevaluated doesn't work on unheld side of Rule/RuleDelayed?
Oh, I see your point now. Then I guess this behaviour is specific for rules, i.e. entities that specify rewrite processes, necessary for the Replace family. Furthermore, Association behaves similar (while DirectedEdge does not)
Mar
19
comment Why Unevaluated doesn't work on unheld side of Rule/RuleDelayed?
I assume that Unevaluated is only kept until Rule recieves its arguments (as the documentation states), but afterwards arguments are evaluated normally as Rule does not have attribute HoldAll or similar. Compare with f[x_] := x;f[Unevaluated[1 + 1]] which also returns 2.
Mar
19
comment How to find the package file that stores a certain symbol?
@luyuwuli That is right. See my edit in the answer that intends to clarify this point.
Mar
18
comment How would one make units work with a variable of unknown magnitude?
Perhaps you can make use of the available dimensionless unit: Quantity[radius, "DimensionlessUnit"]?
Mar
17
comment How does the undocumented option ScalingFunctions work with Plot versus ListPlot?
Even simpler problematic case: Plot[0, {t, 0, 1}, ScalingFunctions -> {Identity, "Log"}] puts the line at y == 1 when there should be no line.
Mar
16
comment Force WhenEvent to respect default stepsize
@MichaelE2 I am aware of this method but try to collect more than one point this way. The problem is that whenever the test of the WhenEvent becomes true, it won't check that test any more, even if you reset the flag.
Mar
15
comment Force WhenEvent to respect default stepsize
Yes, that is useful. But what I actually want is the other way around: only evaluate a WhenEvent when a step is taken. This seems impossible, unless I specify the step size manually.
Mar
15
comment Force WhenEvent to respect default stepsize
That is the point: specifying a high-resolution event-condition does not (by default) increases the resolution of the adaptive stepsize algorithm. It either should, or there should be a way to only test event conditions when a step is actually taken.
Mar
15
comment Force WhenEvent to respect default stepsize
Unfortunately, restarting only works if the function does not change much afterwards. I've quite a few cases where restart does not work - especially, if I include the whole range for the WhenEvent and not just after t=140.
Mar
15
comment Granular versus terse coding
This about compositional vs holistic code. Both are with pros and cons but ultimately it's a matter of taste. As Kuba mentioned, modular code is easier to distribute, test and reuse, but of course the level of granularity must be kept below the maximum (i.e. one function for each builtin is indeed useless). Reading your code is as complicated as reading Leonid's for one who got used to a different style (again, this is subjective). I'm afraid there is little objectivity in deciding about which one is better without knowing local factors like project size, aim, how exposed it is to others, etc.