Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

2
votes
2answers
27 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, ...
1
vote
2answers
38 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
40 views

Simplest use of transpose given a vector and a matrix

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
0answers
24 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
42 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
101 views

MatrixExp of a complex matrix of size about 10000 by 10000 [on hold]

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
43 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$ ...
-3
votes
0answers
59 views

I want a mix matrix [on hold]

I have a matrix with dimensions m x n and elements f[p, q] and another matrix with dimensions i x j and elements g[r, s]. How ...
8
votes
2answers
137 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
168 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
48 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
93 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
45 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
88 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
47 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
42 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
49 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
46 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
43 views

How do I diagonalize a matrix? [closed]

How do I diagonalize the following matrix: ...
1
vote
0answers
44 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
98 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 ...
0
votes
3answers
77 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
187 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
60 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
63 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 ...
0
votes
0answers
11 views

Find new coordinates after rotating a shape centrally [migrated]

i want to find new points of shape in Cartesian coordinate system after applying an angle on shape. What is formula to find these points
0
votes
0answers
32 views

Dot production associated with comparison process of different matrices eigenvectors

With thanks to Guess who in the link module using.. We created functional 5*5 matrices: ...
1
vote
1answer
62 views

Transposition of state space form of a transfer function

How can I transpose the output of state space model in Mathematica? trying the following code would transpose the top right symbol s instead of the matrices. ...
0
votes
2answers
83 views

Matrixform ndsolve for mobile robot dynamic equations

Error is: NDSolve::ndsdtc: The time constraint of 1.` seconds was exceeded trying to solve for derivatives, so the system will be treated as a system of differential-algebraic equations. You ...
1
vote
1answer
78 views

multiplication of 4*4 matrices whose elements are function of x and y [closed]

I have a matrix 4*4 M whose elements are a function of x and y. I would like to multiply this matrix for different values of x and y, say M[1,1].M[2,2]......M[n,n]. How I can do it?
2
votes
1answer
43 views

Problem with NDSolve and Sign

If c1 cnd c2 are zero, the code responds very well; but if one of c1 or ...
2
votes
1answer
38 views

Extract Transfer Matrix from TransferFunctionModel

I have a MIMO transfer function model, and I'd like to know how to perform arithmetic on this model. For instance, to see the difference between two systems' outputs for arbitrary inputs, I'd like to ...
1
vote
1answer
68 views

Handle matrices and vectors with general dimension

I have a matrix of $n \times n$ dimension: $$ K - \omega^2 M = \begin{pmatrix} 2\omega_0^2 - \omega^2 & - \omega_0^2 & 0 & \cdots & 0 \\ - \omega_0^2 & 2\omega_0^2 - \omega^2 ...
5
votes
3answers
241 views

Huge matrices crashes in Mathematica

I have a matrix of data ~(70,000x70,000). I am searching connection between these data points. I use euclidean distance for that purpose. If it is less than my threshold (that means they have ...
1
vote
0answers
35 views

Diagonal times dense matrix, high precision

I have a fixed dense matrix M of high precision numbers, say 40 by 40 and precision 40. Then I have a variable vector v of the ...
6
votes
3answers
177 views

On a strange pattern of triangular numbers in Ulam's spiral

In this MSE post, user GeMir noticed that, where the green dots are the triangular numbers, $$T_n = \frac{n(n+1)}{2} = 1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,\dots$$ in the Ulam spiral ...
15
votes
0answers
193 views

Simple Matrix multiplication takes very long

Bug introduced in 10.1.0 I came across some strange behaviour during a computation involving matrices with symbolic values. It is reproduced below. Multiplying a random 30x30 array with symbolic ...
1
vote
1answer
58 views

Displaying a matrix with integral entries

I have a matrix nxn with coefficients a[i,j] like: a[i,j]=NIntegrate[T[r], {r, -le, le}] - NIntegrate[T[r] Abs[r]/le, {r, -le, le}] I can solve the matrix but I ...
1
vote
0answers
28 views

Function to be used for spectral decompostion of matrix [duplicate]

Can anybody please help in finding out what is best way to do spectral decomposition (or Eigen decomposition) of the matrix. The details of Eigen decomposition can be found in attached link 1. ...
1
vote
0answers
47 views
2
votes
0answers
62 views

MatrixRank of a large but sparse matrix

I want to find the rank of a very sparse, quite rectangular matrix mat, but I'm running out of RAM (I have 16 GB) if I try to use ...
0
votes
0answers
48 views

Compilable function with the functionality of SingularValueList

I'm doing something that involves finding the singular values of a lot of matrices. Basically I need to find singular values of $n$ matrices of dimension $n\times n$, where $n$ is as large as ...
1
vote
1answer
84 views

Matrix multiplication for higher dimensional matrices [duplicate]

I have a matrix like this (myb1): I would like to get the matrix multiplication of each of the submatrix to itself. For example the first 2x2 matrix $\begin{bmatrix}1 & 2\\1 & ...
1
vote
1answer
59 views

Multiplying three matrices does not give expected form [closed]

I'm having lectures on analytic geometry. I've learned that there is an associated matrix multiplication for a quadratic form: $\quad \quad \left( \begin{array}{ccc} x & y & 1 \\ \end{array} ...
3
votes
1answer
80 views

Eigenvalues function not producing expected results?

I'm running into a strange issue when trying to compute eigenvalues of a 2x2 matrix for graphene. If I "manually diagonalise" by multiplying the two off-diagonal terms together and taking the square ...
2
votes
0answers
32 views

How to get simultaneous eigenvectors of commuting matrices? [duplicate]

So let's say there are two square matrices A and B that commute (AB-BA=0). This implies that there must exist some complete set of vectors that are eigenvectors of both A and B. Is there any way to ...
0
votes
2answers
32 views

How to get Complement function working in a For loop? [closed]

I've been working on a piece of code that will delete small components from a nested uneven matrix (n pages, n rows, 3 columns), by deleting the pages with less than ~30 rows. However, I've notice ...
1
vote
1answer
36 views

Can I rely on the ordering of the adjacency matrix? [closed]

Suppose I have created a Graph[{1,2..n}, {1->3, etc}], and I take the adjacency matrix of that graph. Can I rely on the fact that the i-th entry in the graph is the i-th node in the matrix? Or maybe ...
1
vote
0answers
45 views

Does a matrix need to be rationalized when calculating MatrixExp? [closed]

I have a sparse matrix, L, and need to calculate its exponential, MatrixExp[L t], where t is ...