3,626 reputation
1635
bio website
location China
age
visits member for 1 year, 11 months
seen 7 mins ago

Feel free to correct the grammar mistakes in my posts.


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? :)
May
7
comment Parallel computation of NDSolve and a problem
Possible duplicate of mathematica.stackexchange.com/q/14723/1871
May
7
comment Parallel computation of NDSolve and a problem
Where did you put your RHS2=RHS? just behind the definition of RHS or, just in front of the AbsoluteTiming[……]?
May
5
comment Behavior of 1.2 ∈ Rationals changes in v9?
@Szabolcs OK……what about posting this as an answer so I can accept it?
May
5
comment Behavior of 1.2 ∈ Rationals changes in v9?
Hmm……I'm afraid that the second example isn't proper. Consider Element[IntegerPart[Sqrt[2]], Rationals].
May
3
comment Parallel computation of NDSolve and a problem
Where's the definition of sysdim and A and matrix?
Apr
29
comment NDSolve - sampling for result during the computation
@drN OP has chosen method "FixedStep", so the step size can be controlled by StartingStepSize, I think MaxStepFraction and MaxStepSize will also work (haven't tested yet), but I don't know how to control time step size in more general cases (for example PDEs), too.
Apr
25
comment Solving the Helmholtz equation in polar coordinates
DSolve isn't good at solving PDE, and this is just one of the PDEs it can't handle (at least now), see here for details. If your final target is to get a numeric solution, consider NDSolve. Also, you can refer to this answer.
Apr
25
comment NDSolve - sampling for result during the computation
Have you considered doing the simulation piece by piece i.e. first calculate {t, 0, 10^-4}, then {t, 10^-4, 2 10^-4} and so on?