Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

2
votes
1answer
85 views

Eigenvectors of numerical matrix

I have a large numerical matrix whose eigenvalues are all distinct. In the documentation for Eigenvectors it says: For approximate numerical matrices m, the ...
4
votes
3answers
240 views

Constructing Tri-Diagonal Matrices

Fractional Calculus Course, we are instructed to create an $n \times n$ Tri-Diagonal matrix in the form of: \begin{array} a A &= \begin{bmatrix} 2 & -1 & 0 & 0 & ... ...
-1
votes
1answer
34 views

How to create pairwise difference matrix entry?

I have a $16\times 1$ array of integer entries named $H$. How do I create a $16\times 16$ pairwise difference matrix between all entries in array?
0
votes
0answers
27 views

LUDecomposition does not give the expected results [duplicate]

Check this example: ...
1
vote
2answers
45 views

DiscretePlot3D: Part specification is neither a machine-sized integer nor a list of machine-sized integers

I want to plot a 3D histogram of a matrix and I am using this line: DiscretePlot3D[lmat[[x, y]], {x, 1, 3}, {y, 1, 3}, ExtentSize -> Full] where ...
0
votes
0answers
60 views

Is tensor argument passing to module expensive?

I wrote a simple module which is supposed to do recursive computation, however it turns out to be expensive even for 300 points. I am not sure why is it slow, all the computations seem to be ...
-1
votes
2answers
51 views
0
votes
0answers
78 views

Calculating 15 coupled differential equations [on hold]

I have 15 coupled differential equations linear in time that need to be solved. Rewriting the equations in a matrix form, they can be expressed following as a single equation, $\frac{d ...
0
votes
0answers
45 views

How to find multiplication of all elements in a 3d matrix?

Here's my input. It's a 15x4 matrix of 3x3 matrices (In other words a 3d matrix): ...
4
votes
2answers
177 views

Maximization in Mathematica using matrix and vector notation

I am trying to solve a simple maximization problem in Mathematica, using matrix and vector notation. ...
2
votes
1answer
108 views

When are sparse arrays effective?

Sparse arrays are not effective in Mathematica 10. More computational time is needed to perform arithmetic operations on sparse arrays. Their size is also bigger than normal arrays. Here is a simple ...
8
votes
2answers
181 views

Analytic determinant of a sparse 25x25 matrix?

I would like to compute the analytic determinant of the following sparse matrix ...
2
votes
2answers
101 views

The Chart of Matrix Eigenvalues : Energy Levels

There is the possibility that this question may have been asked previously, but as we are unfamiliar with the nature of the chart below, we hope to seek a response to this query. Consider a matrix as ...
11
votes
1answer
122 views

Nearest Kronecker Product

Some people (see The ubiquitous Kronecker product by Van Loan) have worked on finding two matrices $\mathbf A$,$\mathbf B$ of specified size whose tensor product $\mathbf A\otimes\mathbf B$ is closest ...
5
votes
3answers
185 views

How to simplify symbolic expressions with KroneckerProduct

Having $X,Y$ being symbols for matrices, I was wondering if there is a way to simplify expressions like KroneckerProduct[X, X] + KroneckerProduct[-X, X] to ...
0
votes
2answers
57 views

LUDecomposition for non-square matrices

How do we go about finding the LUDecomposition for non-square matrices. When i try to input the standard LUDecomposition ...
0
votes
1answer
45 views

Eigenvalues and Eigenvectors Order [duplicate]

Say I have a list of eigenvalues and eigenvectors produced from a matrix $M$ using the command {eig1,eig2}=Eigensystem[M], which will return the eigenvalues with ...
0
votes
1answer
34 views

Variable Definitions and Random Numbers [closed]

I have currently created the following matrix: m={{RandomReal[{0,1}],RandomReal[{0,1}]},{RandomReal[{0,1}],RandomReal[{0,1}]}} In other words, a $2 \times 2$ ...
0
votes
0answers
20 views

Matrix Multiplication and Product [$f$, {$i$, $i_{min}$, $i_{max}$}] [duplicate]

I tried the command Product[f, {i, i_min, i_max}], where $f$ is a matrix here, as a shorthand for a product of arbitrarily many matrices with elements parametrized ...
3
votes
1answer
71 views

Evaluating the product of a matrix sequence [duplicate]

I want to compute $$ \prod_{i=1}^n A_i = A_1 A_2 \cdots A_n $$ where every $A_i$ is a square matrix. When I execute ...
3
votes
1answer
101 views

updating matrix elements based on a condition

I am (still) fairly new to Mathematica and trying to perform some operation on the matrix elements, say for the matrix ...
11
votes
2answers
190 views

Fastest way to sum the upper triangle

I feel like this is an recurring question: if there's a symmetric matrix whose diagonal is not all 0, how could I get the sum of the part of it that's above the diagonal as fast as possible? Small ...
1
vote
1answer
47 views

Matrix issue with NDSolve

I am solving a differential matrix equation with NDSolve. ...
6
votes
2answers
180 views

improving sequence dot operator for matrix rows and plot of Norm-imaginary

I have written a code to Dot a row (conjugate of that) of mm to the next one: ...
5
votes
2answers
219 views

delete zero rows in a matrix

If there is a matrix with some of its rows equal to zero: (its zero rows are randomly distributed and does not have an ordered arrangement): same as: ...
0
votes
1answer
84 views

Orthogonalization is not commutative!

I get stuck into a problem: I am going to produce orthogonalized eigenvectors of a matrix and in any iteration. I shortened my question in the bellow line: Why do we face to different results of ...
4
votes
2answers
98 views

Reading from a file: complex number with small imaginary part

I'm trying to read a matrix from the next file: 1+1e-18i 24 42 23.43e-23i using u=Import["file.dat","Table"]; and then find, ...
2
votes
3answers
88 views

How to compare and remove x-coordinates (and the associated y-coordinates) that are less than previous x-coordinates?

I am using Mathematica version 9.0 and am trying to compare and remove x-coordinates, and the associated y-coordinate, that are less than previous x-coordinates. Below is an example using sample data. ...
1
vote
0answers
54 views

Simplest use of transpose given a vector and a matrix [closed]

Suppose that I have: x = {1, 1}/Norm[{1, 1}]; A = {{1, 2}, {2, 1}}; What is the simplest way of calculating $x^T A\ x$? And are there symbols on any of the ...
0
votes
1answer
50 views

Issue with Differentiation over a tensor

I am new user in Mathematica. I am working with liquid crystal theory, and one of the notation there is the tensor: $ \Pi_{ij} = \frac {\partial {F_{el}}} { \partial ( \partial {n_i} / \partial { ...
3
votes
1answer
47 views

Saving Dot-ed eigenvectors in a special comparison

We have produced a 4*4 matrix in any iteration containing nx from 0 to 2 by steps of 0.5. and in any iteration we have saved sorted orthogonalized-eigenvectors based on their eigenvalues with this ...
1
vote
0answers
105 views

MatrixExp of a complex matrix of size about 10000 by 10000 [closed]

I want to apply MatrixExp of a numerical, complex matrix of size about 10000 by 10000, and I also need high precision as I need to multiply several such matrices. ...
0
votes
0answers
49 views

Solving matrix optimization

I have the following problem. Let $X_1, X_2, \cdots, X_k$ are $n \times n$ Hermitian matrices (need not be positive) given. Let a $n \times n$ positive matrix $A$ is given such that $Tr(A.X_j)<0$ ...
8
votes
2answers
146 views

Difficulty using LUDecomposition

I'm having trouble using LUDecomposition with pivoting. I read the Mathematica help on this particular command, but I'm still lost. Take a matrix like: ...
7
votes
2answers
176 views

Why is mathematica eating a row from QRDecompostion

I'm attempting to calculate the QRDecomposition of the matrix: a= {{1,3},{0,5},{2,-8}} QRDecomposition [a] The answer mathematica gives me is: - Q which is a ...
1
vote
1answer
57 views

calculate relationship between cause and effect (rows/columns/delta etc.) on tableform

I tried to enter this Excel (on the right of the picture) information to program. following these codes has been used: ...
5
votes
1answer
94 views

Efficient upsampling of multidimensional array

I would like to efficiently upsample a multidimensional array. It's a 5000*5 matrix where each element is a submatrix 12*12 and it is that 12*12 matrix I want upsampled (to 24*24). The upsampling ...
1
vote
1answer
52 views

Pure “Select” function over matrix

I have several lists of tuples in the following shape: l1 = {{1, 134}, {2, 314}, {3, 164}} I do want to select, from each list, list elements fulfilling a ...
4
votes
2answers
90 views

Factor out the scalar multiplier for the dot product of 2x2 matrices

If yy and zz are 2x2 Hermitian matrices, is there a way that I can mark them (with a property?) as Hermitian so that Mathematica can assume that it can factor out and simplify scalar multipliers from ...
1
vote
1answer
53 views

Sort and Save Matrices Eigenvectors to a Larger Matrix

We are going to sort and save all orthoginalized-eigenvectors of 4*4 random matrices (produced in any iteration) to a larger matrix such as storagematrix. Since, produced random matrices are 4*4, ...
2
votes
0answers
50 views

Parallel evaluation of symbolic matrix eigenvalues

I'm trying to find eigenvalues of symbolic hermitian 40x40 block matrix. It is made from 20 2x2 matrices like this: ArrayFlatten[Table[M[m,n],{m,1,20},{n,1,20}]] ...
0
votes
1answer
59 views

Element assignment in matrix function

I have to define a function of two variables that yields a high dimensional matrix, with each entry containing a scalar function, that uses its coordinates in the matrix as input. like this: ...
0
votes
0answers
48 views

Generating this type of Matrix

How I can generate a matrix of order $N$ if $N$ is odd then $$\left[ \begin{array}{cccccc} \frac{1}{0! 0! 2^0} & 0 & \frac{-1}{0! 1! 2^1} & \cdots & ...
1
vote
0answers
45 views

How do I diagonalize a matrix? [closed]

How do I diagonalize the following matrix: ...
1
vote
0answers
47 views

How to remove parts of an expression

I have an expression where terms Transpose[R].R appear. R is a matrix with the property Transpose[R].R=IdentityMatrix[3]. How ...
5
votes
1answer
104 views

Distribute transpose on matrix multiplication

I need to do the following: Transpose[A.(B+C)]=Transpose[B].Transpose[A]+Transpose[C].Transpose[A] How should I do this in mathematica? So far mathematica does ...
1
vote
4answers
117 views

Do not expand matrices in Mathematica calculation

Here is an example of a problem I'm having. Consider that I have defined: omega={{p[t]},{q[t]},{r[t]}} x={{a},{b},{c}} R={{1,2,3},{4,5,6},{7,8,d}} What I would ...
6
votes
2answers
196 views

Can't find the eigenvectors of a simple 2x2 matrix

Bug introduced in 8.0 or earlier and persisting through 10.2.0 Why can't Mathematica find the eigenvectors of this matrix? ...
1
vote
1answer
65 views

Calculating a multiplication of large number of matrices takes a long time [duplicate]

I have a multiplication of matrices, say M1.G1.M2.G2.....Mn.Gn, here n may reach 100. M and G are 4 4 matrices and their elements are function of s. Mathematica takes so long to perform this ...
4
votes
0answers
66 views

How can I force the use of sparse diagonalization methods?

When I evaluate the Eigenvalues function on a very large (e.g. 2^16 x 2^16) sparse matrix, Mathematica says something like: Because finding 65536 out of the ...