Tagged Questions

Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
0answers
50 views

Find the values of parameters so that the matrix is symmetric positive definite

Good evening , I have a matrix 20x20 in symbolic form. The matrix depends on 5 parameters (a,b,c,d,e). I would like to get the interval of each parameters that ensures that the matrix S is symmetric ...
1
vote
2answers
113 views

How to sort the adjecency matrix of bipartite graph so to have two off-diagonal blocks

In a bipartite graphs there are two class of nodes, say A and B. Each node of class A may interact only with nodes of the class B, and viceversa. The corresponding adjecency matrix is thus composed by ...
4
votes
3answers
309 views

Finding parameters making real part of eigenvalues vanish

I have the following $\;3\times3$ matrix: $\left( \begin{array}{ccc} 0.04 -0.4 b & 0 & 0.04 -0.4 b \\ 0 & -0.08-1.2 b & -0.06-0.9 b \\ 1.04 -0.4 b & 2.08 -0.8 b & 0 ...
5
votes
3answers
253 views

Visualization of matrix transformations

I define the "matrix transformation" here as follows: $\left[ \begin{matrix} x_1' \\ x_2' \\ \end{matrix} \right]=\left[ \begin{matrix} a & b \\ c & d \\ \end{matrix} ...
0
votes
0answers
43 views

How to get integer/rational and real eigenvectors to be the same? [duplicate]

forgive me if I missed this already being answered or too easy. Given a matrix: q = {{1, 3, 5}, {7, 11, 13}, {1/3, 1/7, 1/13}}; Eigenvectors are different here: ...
0
votes
1answer
158 views

How to get more accurate orthonormal eigenvectors?

I have a matrix M with real entries in MachinePrecision. I compute its eigenvectors and construct matrix ...
0
votes
0answers
58 views

How to compute variances from a matrix/table

I have created a matrix/table with an imported dataset. I want to know what the variance is for 3 values at a time but across 68 columns. I would like to do this in an automated way rather than 1 set ...
0
votes
0answers
28 views

Mathematica program for PLUR decomposition of a symbolic matrix using full pivoting

I wanted to ask if there is a Mathematica program for PLUR decomposition of a symbolic matrix M, such that M = P*L*U*R, using FULL (row and column) pivoting, and where R = reduced row echelon form of ...
0
votes
0answers
66 views

Computing residues of matrix valued functions symbolically

I have a somewhat specific application in mind, but I've run into this kind of problem a few times and never found an elegant solution. Is there an efficient way to get Mathematica to recognize that ...
1
vote
1answer
47 views

Formatting All Appropriate Output as Desired Automatically

I want to output in MatrixForm whenever I have a list/vector/matrix, but I do not want to have to type out the command each time. How can I write one command at ...
3
votes
2answers
223 views

Package for representation of groups (group theory)

I wanted to know if there is a package which allows to compute representations of a group like the definition representation, adjoint and so on (for example the Pauli matrix for $SU(2)$ if I specify ...
0
votes
1answer
36 views

Generate array of every $n^{th}$ integer between two bounds [closed]

I want to generate the series {1930, 1934, 1938, ..., 2014} with Mathematica. I found that I can use Sum[2014-m*4, {m, 20}] to ...
1
vote
1answer
91 views

Mathematica does not respect tensor order?

I'm trying to verify an identity involving symmetric traceless tensors over the reals. What I tried was: ...
7
votes
1answer
208 views

Symbolic scalar-by-matrix derivative

Let's say I want to calculate the following scalar-by-matrix derivative $$\frac{\partial}{\partial A} \text{tr} \left[(\vec X^T A)^T (\vec X^T A)\right],$$ with $\vec X$ and $A$ being a $n \times 1$ ...
2
votes
1answer
182 views

Plot 3D boolean Array or matrix in Mathematica

I have been attempting several methods to plot a 3D diagram of a n by n boolean array in Mathematica but none of them produced satisfactory result. I want the $3D$ plot to have a cube when ...
0
votes
1answer
135 views

Determinant of a square matrix with univariate polynomial entries is not a polynom? [closed]

I have a 15x15 Matrix with all polynomial entries. I want to calculate the determinant of the matrix. To my understanding the determinant should be a (albeit high order) polynom, too. And the paper, I ...
0
votes
1answer
187 views

Simplify matrix into an upper triangular matrix

I have a tridiagonal matrix that I am trying to simplify into an upper triangular matrix using Mathematica, so I can use back substitution and solve my linear system. I have found the command ...
2
votes
1answer
96 views

Problem with Eigenvectors when given a matrix containing approximate numbers and symbols

I'm trying to diagonalize a certain 2 x 2 matrix, but Mathematica refuses to find the eigenvectors. In particular, when I input ...
3
votes
3answers
211 views

Finding a better way to define a matrix

I first defined a 171x171 matrix containing only zeros and then replaced 18 specific rows with nonzero entries. The other $153$ rows will be average of $2$ of the existing $18$ rows. Rows $2$ ...
2
votes
1answer
137 views

How to handle a sparse array of lists

I have data in the form of a sparse array of lists. For example: ...
5
votes
1answer
162 views

How to combine matrix with array without cycles?

I am new to Mathematica. And I'm sorry for my English. I have created a matrix ($6 \times 4$) and an array ($1 \times 4$). I want to get another matrix that will have the first element from the array ...
0
votes
0answers
121 views

Eigenvectors for a large symbolic matrix

I'm trying to compute the eigenvectors for a 42x42 symbolic matrix (with one variable) in Mathematica. I get the following error: Eigenvectors::eivec0: Unable to find all eigenvectors. >> and the ...
0
votes
1answer
170 views

Defining a new matrix product of matrix function [closed]

Suppose I have two matrices A, B, whose entries are functions of x. Suppose they are 2*2. In the product, each entry is of the form $\sum_k A_ik B_kj$. There are two summands corresponding to k=1,k=2. ...
14
votes
1answer
320 views

Making Monte Carlo simulation with ParallelTable

I would like to to MonteCarlo simulations of various regressions - basically, doing OLS under various conditions to test approaches. On my macpro 2x 2.8 GHz quad core Xeon, 32 Gb RAM DDR2 @ 667 Mhz, ...
0
votes
0answers
721 views

Fastest way to create a NxNxNxN dimensional matrix

I have a function that outputs a complex number Func[x_,y_]:= blah blah; I have constructed a table of all possible values of this function. ...
1
vote
1answer
108 views

Matrix substitution

I'm newbie in Mathematica and would like to ask one simple question. Let's say I have matrix with some elements == -1 ...
0
votes
1answer
163 views

Specific entry of inverse of large matrix

Given a large (say 10x10) sparse Hermitian matrix with symbolic entries, I need four specific entries of the inverse matrix. It seems wasteful to me to compute 100 entries of which I only need a few ...
0
votes
1answer
92 views

Populating an array with outputs of a function [closed]

I have searched, but didn't find much help on my issue. I have an optical physics problem that I'm working on .. ...
0
votes
1answer
67 views

How to get diagonal matrix D from matrix multiplication of $s^{-1}$, P, and S

I am multiplying three matrices that should give me a diagonal matrix but instead of zeros for the other entries I get very small numbers. Can someone explain what is going on here and how I can fix ...
0
votes
2answers
157 views

Eigenvector Anomaly

I'm trying to compute the eigenvectors for: $$ M = \left( \begin{array}{ccc} 1 & 4 \\ 4 & 100 \end{array} \right) $$ Both myself and Mathematica report the eigenvalues as: $$ \lambda_1 = ...
1
vote
0answers
83 views

What is the fastest way to obtain the eigenvalues of a Wishart matrix?

I would like a fast method of creating a sample of random numbers which corresponds to the eigenvalues of a Wishart matrix: For M>N the eigenvalues \lambda_i are given by the jpd Where $K_N$ is ...
0
votes
1answer
88 views

How do I apply a rule to every element in a matrix? [closed]

I need to apply a set of rules (I used Which) to every element in a matrix, but the rules are dependent on the position [[i, j]] ...
1
vote
2answers
141 views

Manipulating sparse array elements

Suppose I have two sparse arrays ...
0
votes
3answers
161 views

Padding of matrix

I want to do padding of matrix a = {{x,x},{x,u}}; to ...
0
votes
1answer
513 views

How to find the inverse a symbolic matrix that Mathematica thinks might be singular

I have a square matrix depending on a parameter "a". When "a" has a numeric value (eg 2.1 * 10 ^ 8) through the inverse function Inverse[] I can invert the matrix. If I write the matrix as a function ...
3
votes
2answers
123 views

How to convert multidimensional matrix into regular matrix?

I have this multidimensional matrix: {{{{a1, a2}, {a3, a4}}, {{b1, b2}, {b3, b4}}}, {{{c1, c2}, {c3, c4}}, {{d1, d2}, {d3, d4}}}} I would like to convert it into ...
0
votes
0answers
146 views

Speeding up inversion of symbolic matrices by invoking caching

Is it possible to reduce the computation time taken to find inverse of symbolic matrices USING CACHING TECHNIQUES accessible (if any)? I am trying to compute inverse of symbolic matrices of size ...
4
votes
1answer
113 views

Computing Smith Normal form of a matrix with mod p coefficients

I would like to compute the Smith Normal form of a matrix with coefficients in GF(p). In particular, I am interested in GF(2). I have used the Smith normal form packages for integer and polynomial ...
10
votes
1answer
214 views

Drop selection of columns from a ragged array

I have an application where I need to drop some arbitrary list of columns from a ragged array (where of course the shortest array rows have at least all the specified columns). E.g., given a ragged ...
10
votes
1answer
177 views

Sporadic bugs in multidimensional SparseArray objects

Udate This SparseArray[] bug is (apparently) fixed on version 10.0 ...
1
vote
1answer
395 views

How to obtain the orthogonal matrix that diagonalize a symmetric matrix [closed]

I have a real symmetric matrix H which is in symbolic form, I need a matrix P that can diagonalize H; also P is orthogonal and its columns are the eigenvectors of H. How can I doing this in ...
9
votes
8answers
345 views

Fast way to get positions of “boxed” array elements?

Given a 2D array (arbitrary numeric / evaluates to numeric elements, simplified for examples, and can be arbitrary dimensions so long as the operation makes sense, I'm working with 2K X 2K in my ...
1
vote
1answer
94 views

Extracting Imported Information

What I want to do is to compare the relationship between the consumption of say beer and wine using scatter plots where each point designates the particular country (preferably named). I have tried to ...
0
votes
2answers
127 views

Replace matrix with conditions

I want to replace the values of 1. in slot under the condition that the year and month in basevalue and ...
0
votes
0answers
42 views

How do you explicitly define Box Operator (D'Alembert operator)? [duplicate]

I wanted to see how one can define a box operator in mathematica? $$ \Box\phi=(-\frac{\partial^{2}}{\partial t^{2}}+\frac{\partial^{2}}{\partial x^{2}}+\frac{\partial^{2}}{\partial ...
1
vote
0answers
75 views

Define inverse for the custom operator

I want to define simple matrix algebra (inspired by the following posts: Block Matrix Algebra with Mathematica ; How to define custom operators ). I assume the funtion ...
1
vote
1answer
312 views

How can you convert a matrix back into a list of lists?

It is very simple in Mathematica to convert a list of lists into a matrix: all you need to do is apply the //MatrixForm function to it and voila. Is it possible ...
0
votes
3answers
141 views

Implementing nested subtotals

Inserting a nested subtotal in a spreadsheet is a facility that Excel performs very well. But if a subset of this facility can be implemented in MMA for a table which needs it the hassle of its ...
1
vote
3answers
390 views

How to expand the size of the matrix automatically?

I have a matrix in 2x2 a ={{x, y}, {z, u}} I want to expand this matrix 3x3 b ={{x, y, y}, {z, u, x}, {z, x, u}} 4x4 ...
2
votes
1answer
705 views

Contracting with Levi-Civita (totally antisymmetric) tensor

I have an array $v_{ijk}$ which is effectively a rank-$3$ tensor with dimensions $3\times3\times3$, and I need to contract it with $e^{ijk}$, i.e. evaluate $v_{ijk} e^{ijk}$ (see Einstein ...