4,879 reputation
2954
bio website
location China
age
visits member for 2 years, 4 months
seen 14 hours ago

Feel free to correct the grammar mistakes in my posts.


1d
comment What is the difference between Array and Table?
There's almost always "more than one way to do the same thing in MMA." :D
1d
answered How to ensure efficient order of operations for rules, slots, substitutions?
1d
comment How to use slots and patterns to reduce repetitive calculation?
@JerryGuern According to my test, Expand will speed up the code only if the option "SymbolicProcessing" -> False isn't added.
1d
revised How to use slots and patterns to reduce repetitive calculation?
typo fixed
Dec
15
comment Fast export of large numerical data
For the first question, you need revived = Import["matrix.h5", "Data"].
Dec
15
answered Summand is not numerical at some point
Dec
15
comment Monte Carlo Volume Calculation and Speed Up
If you add RuntimeAttributes -> Listable inside Compile, then you can use f[RandomReal[{0, 1}, n], RandomReal[{10, 13}, n]] instead of f@@@Transpose@…… and get a 7X speed up. (Parallelization -> True may also help a little. )
Dec
15
comment Water Hammer - Numerically solving system of PDEs
@Ivan To be honest, I'm not able to… the only thing I know is that "Pseudospectral" seems to be quite effective on certain kind of PDEs (specifically speaking, PDEs related to fluid dynamics and quantum mechanics, according to the examples appearing in this site so far), but I never studied why. Maybe you can consider asking it in scicomp.stackexchange.com ?
Dec
15
comment How to use slots and patterns to reduce repetitive calculation?
Oh, sorry, I should have read more carefully. See my answer.
Dec
15
answered How to use slots and patterns to reduce repetitive calculation?
Dec
13
awarded  differential-equations
Dec
11
comment Compilation of a function that needs to call Subsets
BTW, what creates the unpacked array is actually Outer, so I'm afraid unpacked array is also unavoidable.
Dec
11
comment Compilation of a function that needs to call Subsets
Subsets isn't in this list, so Compile isn't likely to speed up your code. In fact, according to my personal experience, though usually not slowing down, even those compilable list-manipulating functions won't benefit from Compile, the reason might be that as an important part of Mathematica core language, most list-manipulating functions have been highly optimized that they can hardly benefit from Compilation. (Join and Complement is compilable, you can try to Compile them and see if the code speeds up.)
Dec
11
comment How to use a C compiler without having SystemModeler
Personally I recommend TDM-GCC, which is free and small and easy to install, you may need to set it manually though. (It's said that Visual Studio can be automatically detected. ) The way to set it is included in the link given by @Lou.
Dec
11
comment Order of evaluation when using Solve and Minimize
You'd better include a concrete code sample, with its currently form it's hard to give advice.
Dec
11
comment How to use slots and patterns to reduce repetitive calculation?
Well, you'd better give a concrete example, or it'll be hard to give advice.
Dec
11
revised Water Hammer - Numerically solving system of PDEs
Typo fixed
Dec
11
comment What does f_[whoCalled]^:=f really mean?
The only thing I know is that the attribute isn't the reason, try Attributes@plus = Attributes@Plus; plus@whoCalled. BTW, this special upvalue is really interesting, it even breaks UpValues and Unset and Break!
Dec
11
revised What does f_[whoCalled]^:=f really mean?
deleted 130 characters in body
Dec
11
revised What does f_[whoCalled]^:=f really mean?
added 14 characters in body