4,904 reputation
2954
bio website
location China
age
visits member for 2 years, 4 months
seen yesterday

Feel free to correct the grammar mistakes in my posts.


Sep
17
comment How to overwrite a private symbol value temporarily?
@qazwsx You can type " \` " instead of " ` " to make it display correctly inside the code block :)
Sep
17
revised How to overwrite a private symbol value temporarily?
add another way to protect the symbol
Sep
17
comment How to overwrite a private symbol value temporarily?
@qazwsx I think there's no attribute named Unprotected, to clear the attribute Protected you can use Unprotect[Foo`Bar`Private`tmp] or ClearAttributes[Foo`Bar`Private`tmp, Protected] :)
Sep
16
answered How to overwrite a private symbol value temporarily?
Sep
16
comment How to overwrite a private symbol value temporarily?
What's the context of tmp? Suppose it's Global`, then how about tmp = 3; SetAttributes[tmp, Protected]; Get["mypackage.m"]? And tmp in a different context can be modified in a similar way.
Sep
16
comment Second order differential equation
BTW, as far as I can see, nonlinear boundary value ODEs has plagued this community for a long time. I just posted a question in scicomp.stackexchange, you can have a look.
Sep
16
comment Second order differential equation
Not easy, I should say. Here's an example. Depending on the nature of your equation, it's even impossible, I guess, because it's so sensible around w'[1]==0. Try this code: s = ParametricNDSolveValue[{w''[x] w'[x] + 3 w[x]^2 - 2 w[x] w'[x] == 0, w[1] == 0.8, w'[1] == a}, w, {x, 0, 1}, a]; Plot[s[a][0], {a, -1, 1}].
Sep
16
comment Second order differential equation
@AlbertRetey I think the v10 result isn't quite reliable. The same code can produce different result. For example, make the code fail by setting eps = 0.35 etc. and try eps = 0.75567 again, this time the code will fail. In some conditions I can even make it success but give different plots!
Sep
16
comment Second order differential equation
@Marco I think Albert is in v10. Just tested the code on the wolfram cloud and it does work.
Sep
15
comment Second order differential equation
Seems to be a task for shooting method, then you'll have a hard time looking for a proper initial guess…
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
3
answered How to speed up my Project Euler code
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
18
reviewed Approve How to execute JavaScipt on a webpage and then import the result on OSX?