Tag Info

Hot answers tagged

4

A latin square generator(source): ls[perm_] := Module[{n = Length[perm], mat}, mat = Transpose[Join[{perm}, ConstantArray[1, {n - 1, n}]]]; (Mod[Accumulate@# - 1, n] 1 & /@ mat) + 1 ] Generating candidates: cand = ls /@ Permutations[Range[5]]; Criteria: crit[mt_] := And[mt[[1, 1]] < mt[[1, 2]] < mt[[1, 3]], mt[[1, 2]] == 2, mt[[2, ...


3

The result is the same. V10 presentation is just went wrong somewhere, but it is the same value as v9. I copied v9 result to v10 and compared the real and the imaginary parts. Clear[t]; expr = {{0, 1/2, 0, 0, 1/2}, {1/2, 0, 1/2, 0, 0}, {0, 1/2, 0, 1/2, 0}, {0, 0, 1/2, 0, 1/2}, {1/2, 0, 0, 1/2, 0}}; v10 = MatrixExp[-I t expr]; v9 = (*copied from v9 ...


3

This was done in verion 10.02, but it should work in V 9 a = {{1, 2, 3, 4, 5}, {5, 3, 1, 2, 4}, {2, 4, 5, 3, 1}, {3, 1, 4, 5, 2}, {4, 5, 2, 1, 3}};


2

I first build the matrix with the "1 to 5 exactly once" condition. This is done row by row, each row from the list of permutations having no slot in common with the previous. Then check the given conditions: a = Table[0, {5}, {5}]; cond := a[[1, 2]] == 2 && a[[5, 1]] == 4 && a[[1, 1]] == 1 && a[[1, 1]] < a[[1, 2]] < ...


1

You should use ArrayFlatten to build block matrices, for example {{K11e[1], K12e[1]}, {K21e[1], K22e[1]}} // ArrayFlatten



Only top voted, non community-wiki answers of a minimum length are eligible