Questions on the linear algebra functionality of Mathematica.

learn more… | top users | synonyms

1
vote
2answers
39 views

Using conditionals to check if LinearSolve found a solution

Is there some way to check if LinearSolve found a solution using conditionals in Mathematica 9? I need to solve a large number of linear equations, but I am only interested in the cases where there ...
0
votes
1answer
49 views

How to tell Eigensystem the type of the elements comprising a matrix I would like to diagonalize

How can I tell Eigensystem that a matrix $M$, which I would like to diagonalize, is a numerical matrix of complex numbers? My idea is that this information could ...
1
vote
0answers
48 views

Request for clarification of Eigensystem::eivn message

What causes the problem of "two eigenvectors associated to one single multiplicity eigenvalue" that I am experiencing? After several transformations to simplify an unwieldy matrix, I end up with the ...
2
votes
1answer
102 views

Sort eigenvectors of a list of matrices

I have a list of matrices and want to obtain a list of eigenvectors and eigenvalues for each matrix, both sorted by the size of the eigenvalue. If I write ...
0
votes
0answers
21 views

Reasoning about Degree of Polynomial [migrated]

How can you show that f is a polynomial of degree ≤ 2 if and only if its Hessian is constant
2
votes
2answers
100 views

What is the best way to write a polynomial in the Bernstein basis?

The Bernstein basis of polynomials of degree $n$ is the set of polynomials of the form $$\binom{n}{k} t^{n-k}(1-t)^k$$ where $0 \leq k \leq n$. What is the best way to transform a given polynomial ...
3
votes
1answer
73 views

Find the NullSpace of a matrix whose determinant is “almost” zero

If $A$ is a matrix such that $\det(A)=0$, it is easy to get a basis of the kernel of $A$ with NullSpace[A]. Now let's consider a matrix $B$, function of a ...
5
votes
0answers
133 views

Is it possible to implement symbolic sub matrices?

The accepted answer in the following link: http://stackoverflow.com/questions/5708208/symbolic-matrices-in-mathematica-with-unknown-dimensions provides a functionality to create symbolic matrices ...
13
votes
1answer
358 views

Morphological Filtering in 3D to produce skeletons

Context As a follow up of this question and that answer, I would like to identify the special lines separating 3D watersheds. These are useful in the context of astronomy to identify the ...
5
votes
3answers
122 views

Assuming reals of unknown variables in a Matrix valued function

I am trying to write a generic matrix valued function in a package, of the form: f[matrix_] := Module[...] My problem is that I want to accept any matrix, but ...
1
vote
1answer
92 views

Solving a System/Matrix of Equations in Matrix Form

Ok, I am trying to solve an equation involving matrices (well, tensors actually), which is of the form: $\mathbf{e}^{T} \cdot \mathbf{M} \cdot \mathbf{e}$ = $\mathbf{N}$, where $\mathbf{e}$ is an ...
0
votes
1answer
110 views

How smart is Solve? Figuring out what tricks I should try

I'm trying to solve a large system (~10000) of linear equations using Solve, but the process keeps failing. As-is, I don't know whether it's failing because it's using too much memory or too much time ...
1
vote
0answers
31 views

Symbolic computation under certain assumptions [duplicate]

Assume that I have a matrix $M$ and I'm doing some operations on it. Is there a way to specify that two variables satisfy an equation say $x=y^2$ and then let Mathematica compute under that ...
1
vote
0answers
41 views

Steps in row reduction? [closed]

I have a fully symbolic matrix that I'm row reducing. Looking at the end result, I see that Mathematica must have divided out some common factors for each row. However, I need to analyze those ...
1
vote
1answer
72 views

Intersection of two vector spaces

Is there a simple way without having to manually compute the matrices and do LinearSolve to do the following? Assume I'm given two lists $l_1$, $l_2$ of vectors of the same dimension. I want a list of ...
4
votes
1answer
137 views

Generating random symmetric matrix

Suppose first that I want to generate a matrix whose elements are i.i.d. with distribution dist. This is easy: ...
3
votes
1answer
96 views

Why does LinearSolve return the transpose of the answer matrix?

I am trying to solve an equation of the form $dv=F\cdot dV$ where $dv$ and $dV$ are matrices derived from the row vectors $dx$, $dy$, $dz$ and $dX$, $dY$, $dZ$ respectively. If it helps, $F$ is the ...
4
votes
2answers
290 views

Should eigenvalues be ordered?

When I run Eigensystem on a symmetric matrix, the list of eigenvalues (and so, the corresponding eigenvectors) is ordered by absolute values, which is quite bizarre (it does make sense if you view the ...
3
votes
0answers
67 views

Fast principal component analysis

I'd like to speed up a principal value value analysis. The data contains a large set of vectors with a large dimension. Both are in the range of 1000. I want to obtain the loadings matrix for further ...
3
votes
1answer
136 views
3
votes
1answer
50 views

How to pick out terms in a linear equation with a positive coefficient?

Basically I have a really large output which looks like a long linear equation $AAA-BAA-CAA+DAA+...-ZZZ$ And I only am concerned about those terms that have a positive coefficient (i.e. a plus in ...
-2
votes
1answer
70 views

$SU(4)$ Structure constants in mathematica

How can I write a mathematica function which will output arbitrary structure constants of SU(4)?
2
votes
0answers
86 views

How to make Eigensystem in version 10 produce the same results as version 9 [duplicate]

The Eigensystem in version 10 seems to give slightly different results as in version 9: ...
0
votes
0answers
43 views

How to solve equations over polynomial rings

sorry if my question is very basic but I don't know what to even search to look it up and the only "obvious" places I thought of had nothing. Some background, for whatever context it might provide. ...
6
votes
2answers
269 views

How to estimate the matrix condition number in the 2-Norm?

The Mathematica documentation say it is possible to estimate the Matrix condition number in norm 1, 2, Infinity. But the 2-Norm raise a message. This is an extract from reference documentation ...
0
votes
1answer
136 views

LinearSolve failing to find solution to system of linear equations of 64 variables

I've got a 64x64 Matrix L for which I want to find the solution to the matrix equation L . x == rho. L is defined as ...
0
votes
1answer
106 views

eigenvector bug also for matrix with numeric value [closed]

I just realize that probably there is a bug also in calculating the eigenvector of a matrix with numeric values (see here for bug in eigenvector calculation with symbolic value). In particular in my ...
2
votes
1answer
97 views

Matrix constructed as a function inside a for-loop [closed]

I am trying to construct a matrix A which depends on variables x and y through iteration. My ...
0
votes
2answers
50 views

Modifying elements of a matrix after construction [closed]

Suppose I have constructed a matrix with all elements as a constant (say 1): N=4; A=ConstantArray[1, {N, N}]; Now I want to make A(2,3)=23 and A(4,3)=43. Can I ...
7
votes
1answer
206 views

How get eigenvectors without phase jump?

I'm using Eigenvectors to get the eigenvectors for some matrixes, but the eigenvectors seems to have some phase jump. Here is an example: Say we have a 2 by 2 ...
0
votes
1answer
59 views

Any command for group products?

Is there any Mathematica command or well known technique to take the direct product between two symmetric/permutation groups?
0
votes
1answer
94 views

How to power-series expand determinants?

Say $g$ is a matrix which is given as, $g = g_0 + xg_2 + x^2 g_4 .. +x^{d/2 -1}g_{d-2}+ x^{d/2}(g_d + h_d(log (x)))$ where $d$ is an even number and each $g_i$ is a matrix (same dimension as $g$) and ...
1
vote
1answer
92 views

how to find iso-cost contours on a 2d plot efficiently

Consider a 2D plot in which dimension 1 and 2 represent quantity 1 and 2 respectively ranging over 0 to 100. Each point in the space corresponding to (x,y) represent cost of choosing quantity 1 as x ...
0
votes
1answer
127 views

Differences between 'Solve' and 'LinearSolve' [closed]

Using the function 'Solve' I can do the following: Solve[a x + y == 7 && b x - y == 1, {x, y}] I get the following output: I want to get the same output using 'LinearSolve' instead. How ...
3
votes
1answer
155 views

Control over the way matrix is displayed

I am wondering how to change the output format in Mathematica. For example, I have $x=\binom{3}{1}$ and $y=\binom{2}{5}$, and I want to find what linear combination of $x$ and $y$ produces ...
2
votes
1answer
253 views

How to Normalise / Normalize eigenvectors? [closed]

I have a matrix and am trying to find the normalised eigenvectors of it. I am using the Eigensystem command and am getting a result. There is a normalize command, but as far as I can see this ...
2
votes
1answer
116 views

Compute symbolic Expectation of a summation

I am required to computed following Expectations : $E[\displaystyle\sum\limits_{i=1}^N \frac{X_{i}}{N}] = \bar{x}_{0}$ & $E[\displaystyle(\sum\limits_{i=1}^N \frac{X_{i}}{N})^2] = ...
1
vote
0answers
73 views

The Jacobi-Davidson method

Does any implementation of the Jacobi-Davidson method for Mathematica exist? A highly parallelized version for sparse matrices would be of special interest.
1
vote
1answer
47 views

Correctly substituting a matrix into a scalar equation [duplicate]

I am having trouble correctly substituting a matrix into an (originally) scalar equation. For example: A = {{3, 1}, {1, 2}} cp = CharacteristicPolynomial[A, x] ...
1
vote
1answer
59 views

Simplification of linear algebra [duplicate]

I have a few vectors defined as V1 = Array[v1,3] V2 = Array[v2,3] V3 = Array[v3,3] And I am trying to solve a very simple equation along the lines of ...
1
vote
0answers
91 views

Diagonalization in parallel

I would like to diagonalize one unitary non-sparse matrix of size 12870 with complex number entries (not symbols, this is really a numerical problem). Is is possible to make eigensystem run in ...
0
votes
1answer
185 views

How to create a 2D array (matrix) [closed]

I am pretty new to Mathematica. I need to create 2d array dynamicly. I got some code in C++(Qt) and it looks like this: ...
1
vote
0answers
71 views

Find eigenvalues without filling the matrix

Is it possible to find eigenvalues of a matrix without filling it? The matrix elements are given by a known function f[p1,p2]. This is relevant for a matrix too ...
2
votes
3answers
233 views

Treat strings as variables?

I have a list of strings, {"x1", "x2", "x3", "x4"} And a list of linear equations: ...
0
votes
0answers
88 views

Is there a way to solve the linear equation, Ax=b, in which A is a “non-constant” sparse matrix that depends on x?

I want to solve the Linear Equation, $Ax=b$ in Mathematica using Kylov subspace solver method preferably BICGSTAB(http://en.wikipedia.org/wiki/Biconjugate_gradient_stabilized_method). Suppose ...
8
votes
1answer
210 views

Is there a built-in procedure for simultaneous diagonalization of a set of commuting matrices?

Given a set $\{A_1,...,A_m\}$ of $m$ commuting $N\times N$ diagonalizable matrices, it is known that there exists a basis of eigenvectors $\Lambda$ that simultaneously diagonalizes all the $A_i$. Is ...
1
vote
1answer
237 views

Traces of products of Pauli matrices

Given a matrix $M$ of shape $2^L*2^L$, I would like to compute all the traces $\text{Tr}( M.(\sigma^{n_1}\otimes\sigma^{n_2}\otimes\ldots\otimes\sigma^{n_L})) $ for $n_1=1...4$, $n_2=1...4$, ..., ...
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: ...
2
votes
1answer
54 views

How to distribute PermutationProduct over the sum

Assuming I have two elements of the permutation group algebra $a_1$, $a_2$ such that $a_i=\sum_{p\in S_n}\alpha_pp$, I want to define a linear product $\odot$ that distributes over the sum and pulls ...
0
votes
1answer
182 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 ...