Reputation
23,735
Next tag badge:
186/100 score
17/20 answers
Badges
2 62 117
Newest
 Enlightened
Impact
~371k people reached

Sep
12
comment Strange behaviour of MMA in derivatives of some standard functions
Incidentally, Derivative is not protected, so you can easily define your own DownValues: Thus, Abs'[x_] := Sign[x]; Abs'[0.5] produces 1.
Sep
12
comment Strange behaviour of MMA in derivatives of some standard functions
Well, I guess it's not just D but the general fact that symbolic computation assumes symbols are complex. Many computations performed by Mathematica must be fully understood in this context - from Simplify[Abs[x^2]] to the apparent missing branch of the cube root in Plot[x^(1/3), {x,-1,1}]. There are exceptions, particularly the CubeRoot and Surd functions introduced in V9 but, generally, computations are done in the complex numbers and I assure you that this is the context in which you need to explore your question.
Sep
12
comment Solve Laplace equation using NDSolve
@SantiCarmesí The gradient field issue is discussed in great detail here.
Sep
12
comment Strange behaviour of MMA in derivatives of some standard functions
A similar thing happens with Re and Im. While those functions are obviously meant to work in the complex realm, I think an understanding of what is going on there is relevant. This discussion might help in that regard.
Sep
12
comment Strange behaviour of MMA in derivatives of some standard functions
It really doesn't matter if you agree or not - the basic fact is that D works in the complex domain and these functions are not differentiable in that context. That, quite simply, is the explanation of the behavior you see. Now, whether you would prefer different behavior and how you might implement it is a different question.
Sep
12
comment Strange behaviour of MMA in derivatives of some standard functions
The functions you explore are all non-analytic as complex functions, thus the derivative is undefined. You might explore the numerical derivative ND as defined the NumericalCalculus package.
Sep
11
comment Homotopy Visualization
I did something like here to illustrate graph isomorphism. That's much simpler, though, really. Shouldn't be to hard to grab a set of points describing the boundaries of the objects but it might be tricky to maintain the topological integrity throughout the animation.
Sep
11
comment Homotopy Visualization
I guess you mean a homotopy, actually.
Sep
10
comment How do I plot the images of oriented curves under complex transformation?
How about Show[r1, r1 /. Line[pts_] :> Arrow[pts, 2]]?
Sep
9
comment Calculating a potential function using the finite element method
@Hugh There certainly are other ways to make a mesh. In this answer I show how to interface with a free, third party program called triangle that might do what you want. However, I'd think that converting them to the ElementMesh format that you want would be rather involved. Also, V10.0.1 is due out any day and I'm quite certain that bugs in mesh generation have been addressed, though I'm not certain if this specific issue is improved or not. Will definitely be worth checking out, though.
Sep
9
comment Möbius transformations revealed
@YvesKlett Seems like a reasonable expectation. :) I do have an implementation based on simple graphics primitives that I'll post soon.
Sep
9
comment Calculating a potential function using the finite element method
@s.s.o I didn't notice the {0,0} issue - thanks!
Sep
9
comment Calculating a potential function using the finite element method
@s.s.o The value of MaxBoundaryCellMeasure is ignored in your code, which is why it alleviates the problem. Using ToElementMesh directly on reg allows one to at least reduce the value of MaxBoundaryCellMeasure somewhat before the problem starts.
Sep
9
comment Calculating a potential function using the finite element method
@Hugh Essentially, that's correct. Technically, though, it's interpolating, rather than extrapolating. :)
Sep
9
comment Calculating a potential function using the finite element method
The return value of NDSolveValue is an InterpolatingFunction, which describes how to compute values between points on the grid. That answers your question 4 and also indicates what's going on in question 5 - namely the interpolation order is too low to expect to do better. Unfortunately, I don't think it's so easy to increase that on an unstructured grid. Also, I'm not so sure how well MaxBoundaryCellMeasure works and your problem with the mes on the circle seems to be alleviated when you delete it. That option isn't even available to DiscretizeRegion.
Sep
8
comment Should eigenvalues be ordered?
So, what do you think of the output of this: Sort[{1, 2, 4, Sqrt[Pi]}]? I think it's reasonable in a symbolic system.
Sep
8
comment How can Mathematica help me to find a real radical expression for roots of this polynomial?‎
See Casus Irreducibilis and/or this notebook. The roots can be expressed without the imaginary unit, if you are willing to accept trig functions - just hit your output with ComplexExpand.
Sep
3
comment How to speed up my Project Euler code
If you realize that the maximum solution is 10 Floor[Ceiling[Sqrt[1929394959697989990]]/10] and step down by 10 from there, you'll get the solution almost immediately.
Sep
2
comment How to Nest a Function with three Arguments?
I suspect he'd like it to work with arguments other than A, B, and dt. Perhaps, a more general pattern would be appropriate?
Sep
2
comment How to find this limit correctly?
I suppose that Assumptions in Limit might simply be applied to simplify the expression ahead of the computation. That would explain the difference in the results and be dismissed as designed. A genuine domain restriction would be more properly dealt with as a third argument.