Tag Info

New answers tagged

1

Any square matrix can be put into Jordan normal form via a similarity transformation; and for a matrix in Jordan normal form, the geometric and algebraic multiplicities of the eigenvalues are determined by its block structure. So you could take the following approach: generate a Jordan matrix with the appropriate multiplicities, and then perform a random ...


0

A $2 \times 2$ matrix has at most two eigenvectors, and just one eigenvector if the rows are related by a factor: myEigenVec = {1, 3}; myMatrixMaker[vec_List, n_] := Times @@ Eigensystem[Transpose[{myEigenVec, n myEigenVec}]] myMatrixMaker[myEigenVec, 2] (* {{7, 21}, {0, 0}} *) where the {0,0} eigenvector is degenerate.


1

I'm a bit late coming in here with this, but let there be a different approach anyway. It so happens, that the permutation you describe is simply Cycles[{Range@20}]: Permute[Range@21,Cycles[{Range@20}]] (* {20, 1, 2, ..., 19, 21} *) With mat = Table[p[i,j],{i,0,20},{j,0,20}] You can try this: Transpose@ MapAt[Permute[#, Cycles[{Range@20}]] &, ...


3

Small example on 5x5 matrix: pp = Table[p[i, j], {i, 5}, {j, 5}] One way: pp[[#, #]] &@Insert[Rest@Range[5], 1, -2] Or another: pp[[;; 4, ;; 4]] = RotateLeft[pp[[;; 4, ;; 4]], {1, 1}];


4

One way is shown below. Alternatives include using Simplify with Assumptions, again on testing that the eigenvalues are nonnegative. Resolve[ ForAll[p, 0 <= p <= 2, And @@ Thread[ Eigenvalues[{{1, 0, 0, Sqrt[1 - p]}, {0, 0, 0, 0}, {0, 0, p, 0}, {Sqrt[1 - p], 0, 0, 1 - p}}] >= 0]]] (* Out[9]= True *)


4

Here's a simple way to enumerate all the conditions: fs = {x, y, z, 0}; conds = Table[{Equal @@ fs1, And @@ Table[First@fs1 >= f, {f, Complement[fs, fs1]}]}, {fs1, Subsets[fs, {2}]}] (* {{x == y, x >= 0 && x >= z}, {x == z, x >= 0 && x >= y}, {x == 0, x >= y && x >= z}, {y == ...


0

Assuming every row stands for one variable {a,b,...,f}, than it just means that the variables {a,...,e} all have the value 0, a==b==c==d==e==0 and f can be anything to solve the equation system. You can also use Solve to prove this The following code will transfer your matrix into a system of explicit equations. The outer TableForm is just for a more ...


0

Use Interpolation to construct an interpolating function, in this case InterpolationOrder of 1 is probably best: Plot[Interpolation[{{0, 0}, {2, 0}, {10, 8}, {100, 8}}, InterpolationOrder -> 1][x], {x, 0, 100}, Evaluated -> True]


2

I have toyed with code (notice that I use only first solution for Replace). eqs = {S Mex'[ t] == ω e Mey[t] + λ ω e Mny[ t] - Γ R e Mex[t], S Mey'[t] == -ω e Mex[t] - λ ω e Mnx[ t] - Γ R e Mey[t], Mnx'[t] == λ ω n Mey[t] + ω n Mny[ t] - Γ Rnt Mnx[t], Mny'[t] == -λ ω n Mex[t] - ω n Mnx[ t] - Γ Rnt Mny[t], Mex[0] ...


0

This seems to work. kmat = {{3 - 3 w, -4/3 + a + 2 w, 5/12 + b - w/2, 0}, {-4/3 + a + 2 w, -1 - 6 a - 3 x, 3/4 + 3 a - 3 b + 2 x - y/2, -2/3 - a - x/2 + z/2}, {5/12 + b - w/2, 3/4 + 3 a - 3 b + 2 x - y/2, -1/2 + 6 b, 19/12 - b + y/2 - 2 z}, {0, -2/3 - a - x/2 + z/2, 19/12 - b + y/2 - 2 z, -3 + 3 z}}; vec = Array[t, Length[kmat]]; ...


1

I think LUDecomposition should be able to do this. Using code from help in Mathematica docs: a = {{1, 2, 3}, {2, 3, 4}, {-1, 0, 2}}; {lu, p, c} = LUDecomposition[a] (u = lu SparseArray[{i_, j_} /; j >= i -> 1, {3, 3}]) // MatrixForm If you want all pivots to be +1, this can now be easily done. d = Position[Diagonal[u], -1] (u[[First@#]] = ...



Top 50 recent answers are included