3,983 reputation
1841
bio website
location China
age
visits member for 2 years, 2 months
seen yesterday

Feel free to correct the grammar mistakes in my posts.


Sep
4
comment How to speed up my Project Euler code
That seems to be the reason, BTW the $MaxMachineInteger in my v8 (Win 64 bit) is the same as that in 32 bit, not sure if it's just the nature of v8…
Sep
3
comment How to speed up my Project Euler code
Which version of Mathematica are you using? It's quite strange that your code generates the CompiledFunction::cfn warning in my v8 (Win 32bit & 64bit) and v9 (Win 32bit), but it does work without warning on Wolfram Cloud!
Sep
2
comment Solving equations with QuantityVariable
@rhermans I myself avoid using the one-argument syntax of Solve for complex tasks, anyway it's undocumented. And according to my test, it's also slower if one doesn't specify the variable in Solve.
Sep
2
comment PDE with Stefan Conditions, a.k.a variable boundary
Ah, I understand! Here's a (relatively) detailed derivation: ReleaseHold[Hold[D[U[x, t], x, x] == D[U[x, t], t]] /. U[x, t] -> u[ξ[x, t], t] /. ξ[x, t] -> x/s[t]] /. x -> ξ s[t] (Alternative: D[U[x, t], x, x] == D[U[x, t], t] /. U -> ({x, t} \[Function] u[ξ[x, t], t]) /. ξ -> ({x, t} \[Function] x/s[t]) /. x -> ξ s[t] )
Sep
2
comment PDE with Stefan Conditions, a.k.a variable boundary
Oh, I made a mistake… In fact, I mean why does u[x/s[t], t] obey the heat equation i.e. D[u[x/s[t], t], t] == D[u[x/s[t], t], x, x] is true?
Sep
2
comment PDE with Stefan Conditions, a.k.a variable boundary
Er… why does u[ξ, t] still obey the heat equation?
Sep
1
comment PDE with Stefan Conditions, a.k.a variable boundary
D[s[t]] should be s'[t]. (Of course this won't solve your problem… )
Sep
1
comment Variable naming changes everything
Another related post
Aug
17
comment A problem about generating `[]` automatically
Well, my last comment is only to the first question i.e. the generation of [], when you thought you pressed Alt + ) you actually pressed Alt + 0, which is another shortcut (that seems to be changed in v10? I'm still in v9 anyway.) And just as what you've noticed, to generate {} and () one needs to press 3 keys, which I personally don't feel it convenient, either.
Aug
17
comment A problem about generating `[]` automatically
@blochwave According to the rest part of OP's question, I think it's a typo and correct it. As to OP's first question, what's your input method editor (IME)? In fact I just found my IME for Chinese character input will break this shortcut and after I turned it off, the shortcut works well.
Aug
11
comment Problem with NDSolve in Mathematica 9 / 10
Your code generates several warnings in v9, Vista 32bit but gives the desired result. No warning in v8 BTW.
Aug
8
comment Strange behaviour of UpSet
Confirmed in v9.0.1, Windows Vista 32bit.
Aug
6
comment Use Runga-Kutta method to solve a system of many ODEs
Do you mean Plot[Evaluate[Sum[I0[k][t] + I1[k][t], {k, 1, 5}] /. n1 /. n2], {t, 0, 80}, PlotRange -> All] ?
Aug
6
comment When I use Rule, why doesn't this work?
@Analysis You need another attribute OneIdentity added. See here for more details.
Aug
6
comment When I use Rule, why doesn't this work?
Well, not quite correct because if you check the FullForm of k.k.k what you'll see is Dot[k, k, k], the true cause lies in the Attributes.
Aug
6
comment the winding number for the circle map (Arnold tongue)
And wraping m with Round as @george2079 suggested is also a valid approach.
Aug
6
comment the winding number for the circle map (Arnold tongue)
@heropup Oh, seems that it's necessary to declare the type of m in this case (I added those declarations habitually in my code so didn't notice this) : f = Compile[{n, {m, _Integer}, a, k}, Mean[Nest[# + a - k Sin[2 Pi #] &, RandomReal[1, m], n]]/n];
Aug
5
comment the winding number for the circle map (Arnold tongue)
If you use RandomReal[1, m] instead of the Table[……], the code'll be about one time faster :)
Aug
4
comment V10's Operator Forms - what are they good for?
Er… is the /* in the last example irreplaceable? // seems to have the same effect.
Jul
31
comment How to get solution from DSolve
@AlexeiBoulbitch Because I'm not sure if this is what OP wants , % is surely not a function :)