2,830 reputation
1628
bio website
location China
age
visits member for 1 year, 8 months
seen 11 mins ago

Feel free to correct the grammar mistakes in my posts.


Jan
23
comment Why I need Evaluate for the Plot of the probability density function of PolyaAeppliDistribution?
Undone. Sorry, I seemed to be a little excited 囧.
Jan
23
comment Why I need Evaluate for the Plot of the probability density function of PolyaAeppliDistribution?
The WorkingPrecision -> 1 method is interesting! And I take the liberty to add some further exploration to your answer, feel free to undo it if you don't like it.
Jan
23
comment Why I need Evaluate for the Plot of the probability density function of PolyaAeppliDistribution?
@rasher Yeah, just enlarge it into an answer :)
Jan
23
comment Why I need Evaluate for the Plot of the probability density function of PolyaAeppliDistribution?
@rasher Oh, I see! Why not give an answer?
Jan
23
comment Add Piecewise functions expanding domains
……Where's your "graph below"?
Jan
21
comment How can I solve my system of differential equations?
@raj You want to use 20/(1 + Exp[2 x/10]) instead of x^2? It's still solvable for DSolve, and there seems to be no root (at least between 0 and 10) in this case!…… :D OK, I actually know you're asking for an approach without DSolve, and the best solution should be this answer together with ParametricNDSolveValue in v9, while I'm still in v8 so I feel unwilling to write an untested example for it. I believe it won't be a hard task, you can have a try. If you still find it difficult, I don't mind adding a v8 approach.
Jan
20
comment How can I solve my system of differential equations?
@raj For the # & part, it's pure function. You can find very detailed explanation in the document by searching Function in it, also, have a look at this post. For the second question, see my edit.
Jan
20
comment How can I solve my system of differential equations?
@raj Glad it helped, and will be more glad if you accept this answer by clicking the tick at the top left corner of my answer :D (If you still feel confused, feel free to continue to ask in the comment :) )
Jan
20
comment Why Min cannot be used as constrains of NMinimize?
@rasher Frankly speaking, warnings of Mathematica are usually discouraging at first sight, but it's really helpful for debugging if we read carefully.
Jan
15
comment solving differential equations
I checked your past question…… you've already asked almost a same question, right? Then you don't need to ask a new one, just go and edit that one is OK! (And to be honest, the format of this question is even worse than the former……)
Jan
15
comment solving differential equations
And when you edit your post in this site, you can select your code and press Ctrl+K to get a better typesetting. BTW, how you choose the xmatch? Always 0.5?
Jan
15
comment solving differential equations
Your new sample contains error… you can press Ctrl+Shift+I in the notebook first to change your code into InputForm before you post it here.
Jan
14
comment solving differential equations
Where's your definition of m? Also, your z5 hasn't been localized, and, I suggest you to make your code sample more concise, what you've posted is the "tried but have failed" code, right? To be honest, I just don't know what you want… for example, why the argument of NDSolve is {x, xmax, xmatch}? I think it would be fine if you add your manual but successful code instead of the elusive description at the beginning of your question to make us understand your intention better.
Jan
14
comment Error in using EventLocator in NDSolve
Er… where's the definition of V and G and saddle?
Jan
11
comment Awkward Two-Point Boundary Value ODE
Where's your L? Are you sure your equation is correct? In fact it can be solved by DSolve, and according to the result, the only solution fitted your BC seems to be $u(x)=0$.
Dec
25
comment Can I return lists with different dimensions from a compiled function?
"perhaps in your actual use case, the cost is not too much." Your guess is right, I tested this method with my new added samples and it's surprising that the external call doesn't cause a significant speed-down. Maybe it's because it just happens at the end of the code in my specific case?
Dec
25
comment Can I return lists with different dimensions from a compiled function?
Can I summarize this as "using variables that haven't been compiled to store those lists"? And for my new added sample, the realization of this method is to change {ez, hy} into something like ez2 = ez; hy2 = hy?
Dec
25
comment Can I return lists with different dimensions from a compiled function?
Er… my case is a little different, my a1 and a2 isn't irrelative (see my added sample above) so I can't take advantage of RuntimeAttributes -> Listable.
Dec
25
comment Can I return lists with different dimensions from a compiled function?
@s0rce But Flatten@{a1, a2} won't…… Oh, I see! This is indeed a possible approach! Why not give an answer?
Dec
23
comment Why does PolynomialQ[x^n, x] return False?
@A.G. I'm sorry that I can't find a robust enough way to solve this, but for your Motivation part, you can use FunctionExpand to expand the two expressions in the same way.