Reputation
7,297
Next privilege 10,000 Rep.
Access moderator tools
Badges
2 14 80
Newest
 Enlightened
Impact
~70k people reached

Aug
21
comment Postprocessing of CFD results in Mathematica
@user11948 Code added, have a look.
Aug
18
comment How to use Compile to generate an $n×n$ array using $n$ tensors with both Real and Integer element
“This issue was [discussed here] in on a different occasion.” You missed a link :)
Aug
17
comment How to implement a more efficient inverse triangular recursion?
@ShutaoTang If the last element needs special treatment, you can use something like searchSpan2[knots_, u0_] := First@Ordering[Sign[u0 - knots], 1] + If[knots[[-1]] == u0, 1, -1]
Aug
17
comment How to implement a more efficient inverse triangular recursion?
@ShutaoTang knots1 doesn't fit the description, right? $u_0 \in [u_i,u_{i+1})$ so $u_i<u_{i+1}$.
Aug
17
comment How to implement a more efficient inverse triangular recursion?
@ShutaoTang Have a look at my edit.
Aug
16
comment How to implement a more efficient inverse triangular recursion?
…OK, I see, but personally I think beginning from $0$ isn't very convenient here, and there's already another $u_0$ in the formula, right?
Aug
16
comment How to implement a more efficient inverse triangular recursion?
3. Why your searchSpan outputs 6 for 5/2? I think it'll be better to make it output 7, so we can implement the definition at the beginning directly. Currently, something like coelist = With[{u = knots, p = deg}, Table[{(u0 - u[[j]])/(u[[j + k]] - u[[j]]), 1 - (u0 - u[[j + 1]])/(u[[j + k + 1]] - u[[j + 1]])}, {k, 1, p}, {j, i - k, i}]] won't give the correct result.
Aug
16
comment How to implement a more efficient inverse triangular recursion?
1. Is knots always a sorted array? 2. Is the exact result necessary i.e. MachinePrecision real number can't be used?
Aug
9
comment Smoothen the curve found by EdgeDetect
Seems that FindMinimum is improved (?) in v10.2, in v9 AccuracyGoal -> 10 only makes things worse, but the result without AccuracyGoal isn't bad anyway.
Aug
9
comment Smoothen the curve found by EdgeDetect
@nikie That sounds interesting, in v9 when Axes->None is set, ImagePadding->All (I think this is the default setting) and ImagePadding->None gives the same result. Maybe it's worth asking another question for this?
Jul
30
comment An recurrence equation that can be solved in version 7 but not in version 8
@Mr.Wizard It's already solved in v9. Well, I remember this has already been mentioned in a comment but it no longer exists, strange…BTW I think it's better to mark this as a "backslide" nowadays :)
Jul
18
comment What will happen if I set ExclusionsStyle for points in 2D plot?
@Mr.Wizard I think this story told me that while it's important to be friendly to the new comers, it's equally important to place answers under appropriate questions :D
Jul
18
comment What will happen if I set ExclusionsStyle for points in 2D plot?
So the behavior of ExclusionsStyle is more subtle than I thought. It's worth mentioning that actually there're 8 red points on the graph.
Jul
18
comment What will happen if I set ExclusionsStyle for points in 2D plot?
@Guesswhoitis. Some more analyses added. (A little busy yesterday :) )
Jul
7
comment Infinite Expression Error NDSolve
Just for curiosity, how is this kind of problem solved in matlab?
Jul
5
comment List of compilable functions
With all due respect, I think the first example given by the engineer is meaningless. Power is in the list of Compile`CompilerFunctions[] !
Jul
5
comment Why Function is compiled?
@Pickett To be honest, I was about to add Function to my answer below that question yesterday, but was confused because I felt it strange that as a frequently used function (I think) inside Compile, no one has ever mentioned Function there hitherto, so I was guessing there might be some deeper reason and asked this question. Well… now that this question gets no answer and 1 downvote, maybe I should delete it and just add Function to the list?
Jun
23
comment How can I get Mathematica to produce better Fortran code?
Come on, not every one can spend another $2,495.00 without hesitation. BTW, the discount of MathCode for students is really stingy compared to Mathematica: Mathematica student version only sells for 140 dollars (50.00 dollars in China, at least when I bought it), while MathCode sells for $1,095.00 even in education store!
Jun
21
comment Smoothing a unit step function
After a second look I think your question is a little unclear. What do you really want? Smoothen n with NDSolve or find a smooth approximation of n which is to be used in NDSolve?
Jun
21
comment How to use NDSolve with discontinuities at internal boundaries?
@Dr.Know To deal with discontinuities of derivatives, you can try changing the independent variable, for example $f′(0+)/f′(0−)=\lambda$ can be "eliminated" by $ζ=c z$ where $c$ is a piecewise coefficient.