xzczd
Reputation
10,460
Next privilege 15,000 Rep.
Protect questions
 Mar 19 comment Why Unevaluated doesn't work on unheld side of Rule/RuleDelayed? @IstvánZachar But for your case f[Unevaluated@Unevaluated[1 + 1]] will return Unevaluated[1 + 1]. Mar 19 comment Why one needs two Unevaluated to show 1+1 correctly in TreeForm? Unevaluated is a function I never truly understand… Mar 19 comment Need help in list manipulations According to wiki: In computer programming, a comment is a programmer-readable annotation in the source code of a computer program. They are added with the purpose of making the source code easier to understand, and are generally ignored by compilers and interpreters. For your purpose, you might need Style or the new-in-v10.4 Highlighted instead. Mar 19 comment Simplifying expressions I'm afraid your result by hand is wrong: Clear[p1, q1, p2, q2, s2, r1, r2]; rule = {(x - 0.5)^2 + y^2 -> r1, (x + 0.5)^2 + y^2 -> r2, 1/r1^3 + \[Lambda]/r2^3 -> p1, 1/2 (1/r1^3 - \[Lambda]/r2^3) -> q1, 1/r1^5 + \[Lambda]/r2^5 -> p2, 1/2 (1/r1^5 - \[Lambda]/r2^5) -> q2, 1/4 (1/r1^5 + \[Lambda]/r2^5) -> s2}; Simplify[ D[\[CapitalOmega], x] == x + (2*x*p1 - q1) + (3*y^2*q2 - 3*x*(x^2 + y^2)*p2) + (6*x^2*q2 - 3*x*s2) //. Reverse /@ rule /. x -> 1 /. y -> 2] Mar 19 comment Simplifying expressions Where's the definition of r10 and r20? Mar 16 comment General solution for a linear ODE set with complicated coefficient Oh, here comes an answer finally, thx for your effort :) . Then can you elaborate a little on the These terms can be obtained by constructing the determinant of the coefficients, converting it to a single ODE, and solving it part? Mar 11 comment Why is ListContourPlot so slow? As to the ticks issue, you can also draw a blank density plot and then show it with the array plot: Show[DensityPlot[False, {x, -\[Pi], \[Pi]}, {y, -\[Pi], \[Pi]}, ImageSize -> 400], (*ArrayPlot[...]*)] Mar 8 comment Compile function - error but correct calculation Guys, I don't think this question is simple or is easily found in the documentation… Mar 8 comment How to discretize a nonlinear PDE fast? Oh, you finally accepted my answer :D Mar 7 comment How to eliminate an independent variable from two coupled differential equations? This is also related:mathematica.stackexchange.com/q/80241/1871 Mar 7 comment Analogue for Maple's dchange - change of variables in differential expressions Here is an example that DChange can't handle very well currently: DChange[0 == r'[t]^2 + r[t]^2 u'[t]^2 - 2 \[Kappa]^2/r[t] - h, {r'[t] == R'[u] u'[t], r[t] == R[u], u'[t] == c/R[u]^2}]. One way I can think out to fix this is to use //. i.e. DChange[expr_, functions : {(_[___] == _) ..}] := expr //. Replace[functions, (f_[vars__] == body_) :> (f -> Function[{vars}, body]), {1}]  Mar 7 comment Compile function - error but correct calculation You're against rule 1, 2, 3 here. Mar 1 comment Improve speed in this tree - memoization won't suffice @JasonB Currently there seems to be no way to compile this type of function. Some related posts: mathematica.stackexchange.com/questions/108121/… Mar 1 comment Compile error with MapThread @AlexeyGolyshev Wow, seems that I'll have a lot of answers to revise soon :D Mar 1 comment How to speed up calculation of this equation (FindRoot) @george2079 That's …very interesting! You should post this as a separate question! Mar 1 comment Compile error with MapThread @syhpphys "we can throw away the Flatten and Transpose and just replace the {n,nd,4} with {n*nd,4}" You are right, I forgot to take the code inside RandomVariate into account, thanks for pointing out, edited. Mar 1 comment Compile error with MapThread @syhpphys I think the 2 key points here are 1. Normalize can not be compiled so one needs to replace it with a compiled equivalent i.e. #/Sqrt@Total[#^2] & . 2. function defined with pattern-matching cannot be compiled (see the 3rd rule here?), so one needs to replace it with a pure function, which can usually be compiled if it's formed by compilable function. Feb 29 comment Manipulating the elements of a list @Vaggelis_Z Just for conciseness and… fun :D . Though For is slow, it's not a big deal in your case. Feb 29 comment Trouble creating a bifurcation diagram of a trajectory Your code is incomplete, how did you define f? And the right bracket of ListPlot is lost and there's a redundant right bracket at the end of the code. (Update: just read your previous question, you should have read the answer and comments more carefully, if you have difficulty in understanding them, simply go on asking in the comment. ) Feb 29 comment Threading over a list of lists of lists and a list of atomic expressions " in this form only the first list is threaded over" this explanation isn't right, in this case nothing is threaded over, the output is the same as that of appendTo[list1, list2]. See this post for more information.