Reputation
6,534
Next privilege 10,000 Rep.
Access moderator tools
Badges
2 11 74
Newest
 Revival
Impact
~63k people reached

Apr
3
comment Backslide of Limit
@MichaelE2 I added a step-by-step proof, have a look.
Apr
3
comment Backslide of Limit
I'm sorry but the answer given by v8 is undoubtedly correct. See my edit for the step-by step proof. @blochwave
Apr
3
comment Poisson PDE over a irregular region with FDM
@wlkyr It's just because I didn't use the original coordinate. Map it back if you like.
Apr
2
comment NIntegrate over a list of functions
I think it'll be better if you can add some screenshots etc. to illustrate the speed difference.
Apr
2
comment Backslide of Limit
BTW the Hold-ReleaseHold approach also works in v8.0.4, I feel it really surprising: In this case Limit[Hold[Sum[Sin[Pi*k/n]/(n + 1/k), {k, 1, n}]], n -> Infinity] returns Hold[2/π] i.e. Hold doesn't hold the expression! Quite unusual!
Apr
2
comment Backslide of Limit
@2012rcampion V8 can handle the finite summation: i.stack.imgur.com/urNrR.png
Apr
1
comment Compile, “global variables” and recursion
Quite interesting! BTW, the code can be simplified to LevelsNeeded = Compile[{{b, _Integer}, {M, _Integer}, {x, _Integer}}, If[M <= (x*b + Quotient[x (x - 1), 2]), x, LevelsNeeded[b, M, x + 1]], {{_LevelsNeeded, _Integer}}, CompilationOptions -> {"InlineExternalDefinitions" -> True}, CompilationTarget -> C];.
Apr
1
comment Compile, “global variables” and recursion
As far as I know, so far it's not possible to define a recursive compiled function. (This question is slightly related.) I hope I'm wrong.
Apr
1
comment 4th-order Runge-Kutta method to solve a system of coupled ODEs
@Prasanta If I correctly understood those material I found, RK4 i.e. classical RK doesn't have an error estimator. Notice the document also gives a example for a fourth order RK called Fehlberg method, which owns an error estimator and can find the singularity at 0.9576.
Apr
1
comment Poisson PDE in a rectangular domain
"I would like it for any geometry" - 如果这就是你的终级目标的话,那么,我在你的第一个问题里给出的代码本来就是适用于任何二维直角坐标系下的泊松方程的,你只需要把开头用于指定区域的部分稍微改改就行——‌​‌​‌​你要是看不懂我的答案那你完全可以在下面追问。Translation: If this is your ultimate goal, then the code in my answer for your first question is completely suited for the task, you just need to modify the part defining the region i.e. rulei and ruleo. If you have any difficulty in understanding, feel free to continue to ask in the comment under my answer.
Mar
29
comment 4th-order Runge-Kutta method to solve a system of coupled ODEs
@Prasanta NDSolve does stop at 0.9576, but have you noticed that it begins from 1 because your initial condition is given at η = 1? BTW, what's your first language?
Mar
29
comment 4th-order Runge-Kutta method to solve a system of coupled ODEs
@Prasanta Since I'm the author of this post, you don't need to add "@xzczd" to remind me. In my view the most vital part of your problem is, you haven't even find a way to solve your nonlinear ODE. It's easy to create nonlinear ODE, but solving it can be really hard. I suggest you to first make sure if your equations are correct (incorrect translation for the real problem isn't rare!), and consider carefully if you really need your equations to be so complicated. Simplify your model if possible. Diving into the hell of looking for proper combination of options of NDSolve is the last choice.
Mar
28
comment 4th-order Runge-Kutta method to solve a system of coupled ODEs
If RunnyKine doesn't appear in the comment under this question, then the "@" won't work. And why are you still adding whitespace between "@" and the name?
Mar
28
comment 4th-order Runge-Kutta method to solve a system of coupled ODEs
(Sigh…) Just found your code in the edit history. This time I've done the edit for you, please check what I've done carefully.
Mar
28
comment 4th-order Runge-Kutta method to solve a system of coupled ODEs
After pasting your code here, select them and press Ctrl+K, or add four whitespaces before each line of code. Things like \[Eta] isn't unreadable for Mathematica user, when pasting back to the notebook, it'll get back to the normal greek letters, and if you want to make your code look better in this site (of course it's encouraged), use the link I gave above to convert those "unreadable" symbol to greek letters!
Mar
28
comment 4th-order Runge-Kutta method to solve a system of coupled ODEs
Just copy and paste (Ctrl+C and Ctrl+V under Windows), as you copy and paste any thing. BTW, if you add a white space before "@" and "xzczd", the reminder won't work. It should be "@xzczd".
Mar
28
comment 4th-order Runge-Kutta method to solve a system of coupled ODEs
Select your code and press Ctrl+Shift+I before copying. And you can also use this to convert your code to make it look better.
Mar
26
comment How to modify a PDE inside NDSolve according to an if condition
Well, I still suggest you to add the missing b.c.s, though NDSolve gives an answer currently, it's not that clear what boundary is added.
Mar
26
comment Delete duplicates by a criterion
And your syntax for DeleteDuplicates is even incorrect.
Mar
26
comment How to modify a PDE inside NDSolve according to an if condition
Is the function f[t, y, x] or f[t, x] or f[y, x]? And you still miss 2 boundary conditions. (A rule of thumb for the necessary number of i.c. or b.c. is that it should be usually equal to the highest order of the corresponding derivative.)