3,676 reputation
1737
bio website
location China
age
visits member for 2 years
seen 3 hours ago

Feel free to correct the grammar mistakes in my posts.


Jul
4
comment How can I solve my system of differential equations?
@raj As I mentioned in the comment above, the best choice here is to use ParametricNDSolveValue in v9, NDSolve approach should also be available, but I can't figure out where the shoe pinched without your specific code.
Jul
3
comment CompilationTarget->“C” crashes the kernel
Same problem with TDM-GCC-4.8.1, Mathematica 8.0.4, Vista 32bit. Well, in fact it's not the first time I found CompilationTarget -> "C" made trouble, but I haven't yet managed to reproduce this kind of problem with a simple enough example for so long.
Jun
25
comment how to solve second order nonlinear coupled differential equations using NDSolve with hyperbolic function
@ameera "StartingInitialConditions" is just a guess, here I just choose it casually. For your equations there're many available "StartingInitialConditions", for example {x[0] == -1, x'[0] == -1, y[0] == 0, y'[0] == 0}, but it's also worth to mention that it can be really hard to choose proper initial conditions for some equations, for example this one.
Jun
18
comment Smooth Peter de Jong attractor
I think it'll be better if you add the compiled code since the existed piece of code can't be compiled directly. Compile isn't easy for everyone :)
Jun
14
comment Can a Symbol own OwnValues that don't evaluate when it's the head of an expression?
Sorry to my late reply. I did intend to wait for an hour after posting this question but was beaten by sandman within 10 minutes 囧. @Rojo Yeah, you're right, thanks for editing the title, also, thanks for m_goldberg's polishing :D
May
26
comment Visualizing vectors
You need to put all your Arrows in one pair of braces i.e. something like Graphics3D[{Orange, {Arrow[{{0, 0, 0}, {1, 1, 1}}]}, Red, Arrow[{{0, 0, 0}, {1, -1, -2}}], Green, Arrow[{{0, 0, 0}, {-1, 1, -1}}], Blue, Arrow[{{0, 0, 0}, {1, -1, -1}}]}, Axes -> True, Boxed -> True, PlotRange -> All].
May
21
comment Complex integrals and residues
Nothing is wrong with the syntax, I think it's because this integration doesn't have a analytic solution (at least Mathematica doesn't know it), consider NIntegrate if a numeric solution is enough for you.
May
21
comment Randomly generated polymer with certain spatial density
@秦紀維 And it's not the end, see my edit.
May
20
comment Loop in solving multiple matrix calculation
@Lawerance Center does have no effect here, I just forgot to remove it 囧, edited. For the second question, Map[evec] doesn't make any sense, the FullForm of MatrixForm /@ evec is Map[MatrixForm, evec]. also, notice what's Threaded here is == i.e. the precedence is Thread[((Subscript[v, #1] & ) /@ Range[4]) == (MatrixForm /@ evec)], you can use Shift+Ctrl+. to check the precedence.
May
19
comment Loop in solving multiple matrix calculation
@Lawerance Glad you like it :)
May
19
comment Loop in solving multiple matrix calculation
Read my answer.
May
19
comment Loop in solving multiple matrix calculation
Module[{i = 1}, Do[Print[aa[i] == (b /. Solve[matrix.b == 0, b] // Transpose // Quiet // MatrixForm)]; i++, {ω, eigenval}]]
May
19
comment Loop in solving multiple matrix calculation
BTW, besides the last line, I believe the entire code can be written in a better way. Maybe you can add some background information for the original problem.
May
19
comment Loop in solving multiple matrix calculation
Yeah, I'll use Table, because its output, which is a list of Rule, is easy to be used in further calculations together with ReplaceAll etc. while there's no way to call those given by Print inside Do.
May
19
comment Loop in solving multiple matrix calculation
I'm not sure what you mean: Do[Solve[matrix.b == 0, b] /. Rule -> Equal // Transpose // MatrixForm // Print // Quiet, {ω, eigenval}]; Do[b /. Solve[matrix.b == 0, b] // Transpose // Quiet // MatrixForm // Print, {ω, eigenval}]
May
19
comment Loop in solving multiple matrix calculation
Why "loop"? I think the output is not "ugly" anymore, and Table is essentially a loop, too. Or you prefer this format?: b /. Table[Solve[matrix.b == 0, b], {ω, eigenval}] // MatrixForm
May
19
comment Loop in solving multiple matrix calculation
You mean something like Table[Solve[matrix.b == 0, b], {ω, eigenval}] /. Rule -> Equal // MatrixForm ?
May
13
comment Do not understand expression returned by FullSimplify
@Kuba I guess OP is suspecting that Simplify has internally Integrateed the expression and then differentiated it.
May
9
comment Parallel computation of NDSolve and a problem
@yashar It's because ParallelTable has the attribute HoldAll, so those Subscripts are passed into it before changing into numeric values. When you use RHS2 to store RHS, evaluation happens, and Subscripts are removed, it's equivalent to use Evaluate@RHS inside ParallelTable.
May
8
comment How to make the code inside Compile conciser without hurting performance?
@OleksandrR. You mean what Leonid Shifrin has done below? :)