Tagged Questions

Questions on the linear algebra functionality of Mathematica.

learn more… | top users | synonyms

10
votes
2answers
227 views
2
votes
3answers
831 views

Finding eigenvalues of a $1500\times1500$ matrix

I need to find the eigenvalues of a $1500\times1500$ real symmetric matrix given by $A_{i,i+1}= A_{i+1,i}=-1$ and also $A_{1,N=1500}=-1$ (this is because of a periodic boundary condition used) and all ...
1
vote
1answer
584 views

Is Mathematica matrix multiplication with its inverse wrong? [duplicate]

Possible Duplicate: Why don't * and ^ work as I expected on matrices? When I enter this ...
1
vote
2answers
569 views

How to Solve or LinearSolve $A = I$ matrix equation?

I'd like to solve this equation for $A = B$ where $B = I$, which represents 3 systems of 3 linear equations, for $a, b, c, d, e, f$, without writing LinearSolve 3 ...
14
votes
3answers
1k views

Mathematica for linear algebra course?

I'm taking a linear algebra / matrix theory course and we are free to use any software we want, and will be "expected to use MATLAB or an equivalent" for homework. The professor and textbook (Applied ...
3
votes
4answers
163 views

Pack Solve results into a vector

I am currently using a really easy function to get the eigenvectors of a corresponding eigenspace: ...
10
votes
3answers
1k views

Correcting a correlation matrix to be positive semidefinite

Does Mathematica have a way to "fix" a correlation matrix that is not positive semi-definite? I looked through the documentation and search the internet but could not find anything.
21
votes
3answers
587 views

Computing polynomial eigenvalues in Mathematica

MATLAB offers a function polyeig for computing polynomial eigenvalues, which appear, for instance in quadratic eigenvalue problems (see here for some applications) such as: \begin{equation} ...
3
votes
0answers
183 views

LeastSquare Solution for the Continuous Time Lyapunov Equation

I have been working with a problem which involves solving the continuous time Lyapunov equation $$A R + R A^\top = G$$ for the symmetric positive definite matrix $R$. Here $A$ is real, invertible ...
7
votes
1answer
453 views

Very fast way to do a coordinate frame transform

I need a function that rotates and translates a huge amount of line segments. For example, I have a set of line segments in the form {{x0,y0,z0},{x1,y1,z1}} ...
2
votes
1answer
1k views

Solve matrix equation A*X=X*B using LeastSquares

I want to solve matrix equation A*X=X*B using LeastSquares method, but it is suited for equation like A*X=B. All matrices are 3x3 ...
3
votes
3answers
489 views

Can RowReduce work in this matrix?

The matrix $Q$ with dimensions $n\times2*n*m$ is structured by $$Q=[B|AB|\cdots|A^{2*n-1}B]$$ where $Q$ is an augmented matrix built from a $3\times3$ matrix, $A$, and a $3\times2$ matrix, $B$. I ...
8
votes
1answer
380 views

Efficiently Constructing Rank One Approximations for a Matrix using SVD

Suppose I have a $m\times n$ matrix $A$ (real for simplicity). Then SingularValueDecomposition[A] yields 3 matrices $U$, $\Sigma$ and $V$ such that $A = U\Sigma ...
5
votes
1answer
533 views

Finding the characteristic polynomial of a matrix modulus n

Given a square matrix, is it possible to calculate its characteristic polynomial modulo n? Unfortunately, this function ...
3
votes
2answers
1k views

Matrix multiplication in Block Form symbolic calculation by Mathematica

I have a problem which requires taking product of two $10\times10$ matrices. I would like to do it by considering both matrices as $5\times5$ matrices such that each entry of both matrices is actually ...
12
votes
4answers
432 views

How do you decompose a polynomial matrix into its matrix coefficients?

Let's say I have a matrix, $\mathbf{M}$, that is polynomially dependent on a single variable, such as M = {{15 + a^2, a + 5 a^2}, {a - 5 a^2, 2}} and I want to ...
10
votes
2answers
1k views

Find Determinant/or Row Reduce parameter dependent matrix

I'm trying to find the determinant of a band diagonal matrix that has a parameter, $\kappa$, in some of the entries. Some entries are just numerical ones, others ($\kappa$ X number), while others are ...
4
votes
1answer
573 views

Computing Slater determinants

I need to compute Slater determinants. I'm wondering if I would benefit from assigning each of my functions to a variable prior to computation. I'm working with Slater determinants, but my question ...
5
votes
1answer
395 views

Tridiagonal symmetric matrix eigenvalue using bisection

I know that Eigenvalues is already quite well implemented in Mathematica, nor am I foolishly trying to improve on it. In order to improve my programming skills, I ...
10
votes
2answers
742 views

Is there any way to obtain an approximate inverse for very large sparse matrices?

I have a very large sparse matrix and I need to obtain its approximate inverse and save it as an sparse matrix too. Any of my efforts as could be seen in what follows fail for large n ...
3
votes
2answers
1k views

How to substitute numeric values in a symbolic Jacobian matrix?

I have a multi-variate function from $\mathbb{R}^n\to\mathbb{R}^n$. Choosing any desired initial vector, we can produce the corresponding function value, which is a vector as follows. The main problem ...
8
votes
3answers
319 views
6
votes
0answers
242 views

How to produce the ILU0 or ILUT as stand-alone procedures on sparse matrices?

Mathematica uses the ILU0 procedures automatically to precondition large sparse linear systems; e.g. ...
11
votes
1answer
523 views

Space-efficient null space of sparse array

I have a roughly 100,000 × 3,000 matrix (as a SparseArray) that I'd like to find the kernel (null space) of. It has about 500,000 nonzero entries, all -1 or 1. ...
9
votes
1answer
301 views

Memory Leak in RowReduce?

Recently I tried to do what I thought was a fairly small (relative to the 6 GB of RAM that I have on my machine) row reduction calculation on a matrix representing an undetermined linear system and ...
11
votes
2answers
547 views

What's the most “functional” way to do Cholesky decomposition?

I can do Cholesky in a procedural style, such as: ...
13
votes
1answer
568 views

Is there a clean way to extract the subspaces invariant under a list of matrices?

Let's say I have some $n \times n$ square matrices $A_1, A_2, \ldots, A_m$ with exact numbers for entries, and I want to find the subspaces of $V = \mathbb{C}^n$ invariant under these matrices. Is ...
5
votes
3answers
835 views

Solution for equation system with piece-wise defined functions

As I could swear this worked just yesterday, I am probably just doing something stupid here and I am sorry to bother you :) I am trying to find the point where a curve crosses a line. In this case, ...
5
votes
2answers
1k views

How do I keep the right ordering of eigenvalues using Eigensystem?

I'm having an issue with the Eigensystem command. I need to diagonalize a bunch of 3 by 3 complex valued matrices, but more importantly, I need to keep the exact ...
11
votes
1answer
643 views

What is the fastest way to find an integer-valued row echelon form for a matrix with integer entries?

Let me begin by saying that this is my first post on StackExchange. I apologize in advance if I unwittingly break any of its unwritten rules of etiquette. Recently, I've been trying to understand an ...
6
votes
0answers
294 views

Inverse of a large sparse Hermitian block matrix

I am looking for a method (if it exists) for the inverse of a large sparse Hermitian block matrix. The off diagonal sparse matrices, named δ are 4x4, and they have ...
0
votes
1answer
505 views

On the parallelization of matrix multiplications in Mathematica 8

I have installed Mathematica 8, but I think the commands for parallelizations do not work! Even when I try to test the example in the Help of Mathematica, I face with ParallelDo::nopar: No ...
3
votes
2answers
560 views

Solving a linear equation in Mathematica

This should be easy but I can't seem to find the right way to do it. I have an equation of the form $a x + b x + c y + a z + d z = 0$, and I'd like to solve for relations between the parameters ...
13
votes
2answers
831 views

Higher order SVD

Does anyone know how to do a higher order SVD in Mathematica ? A good reference seems to be here http://www.sandia.gov/~tgkolda/pubs/pubfiles/SAND2007-6702.pdf but I don't understand their formalism ...
14
votes
3answers
850 views

Constructing a symbolic Hermitian matrix

I need to construct a symbolic Hermitian matrix like m = { { n, a, b, b}, {Conjugate[a], n, b, b}, ... } but I am not able to set ...
2
votes
3answers
981 views

Orthonormalization of non-hermitian matrix eigenvectors

When using Orthogonalize[] one can specify which definition of "inner product" is to be used. For example, ...
8
votes
2answers
713 views

Entering block matrices for an arbitrary matrix size

Background: How to enter matrices in block matrix format? and the following: I want to create $$ f(A,t) = \left [ \begin{matrix} A & t \\ 0 & 1 \end{matrix} \right ] $$ where $A$ ...
1
vote
0answers
260 views

Matrix multiplication involving MatrixForm [duplicate]

Possible Duplicate: Why does MatrixForm affect calculations? I am doing a matrix multiplication, but not getting the desired output. I am doing the matrix multiplication of $A^{-1}B$ from ...
4
votes
2answers
498 views

ordering of functional eigenvalues

Is there any order to the symbolic eigenvalues of a matrix returned by the command Eigenvalues[...]? While numerical eigenvalues are listed in descending order ...
26
votes
3answers
4k views

Can Mathematica do symbolic linear algebra?

For instance, is there some way I can say "let A and B be arbitrary real $m\times n$ and $k\times m$ matrices, Simplify[Transpose[Transpose[A].Transpose[B]]]" and ...
7
votes
3answers
609 views

Composition of functions

I have a number of rotations computed by rot = RotationTransform[theta, point], and I would like to compose them to produce one function that is the composition of ...
5
votes
1answer
337 views

Obtaining a thin/compact SVD

I'm using SingularValueDecomposition for a least-squares regression, the instruction that works fine for what I need is ...
4
votes
3answers
1k views

Trying to simplify Root expressions from the output of Eigenvalues

I am trying to calculate eigenvalues of a sparse matrix with only two distinct non-zero elements, here Alpha and Beta, which are both negative reals. Mathematica returns some complex expressions with ...
5
votes
1answer
2k views

Simpler way of performing Gaussian Elimination?

Is there a simpler way of performing Gaussian Elimination other than using RowReduce? Such as a single built in function? Edit: Look at the example from our simulation class. Not too difficult, but ...
6
votes
5answers
3k views

Computing eigenvectors and eigenvalues

I have a (non-sparse) $9 \times 9$ matrix and I wish to obtain its eigenvalues and eigenvectors. Of course, the eigenvalues can be quite a pain as we will probably not be able to find the zeros of its ...
11
votes
3answers
1k views

Can Eigenvalues[] and Eigenvectors[] be assumed to return the same ordering?

If I do back to back calls of Eigenvalues[] and Eigenvectors[] can these be assumed to order the values and vectors the same, or ...
3
votes
1answer
975 views

Obtaining the square-root of a general positive definite matrix

I have a matrix which I know to be positive definite. The entries of the matrix might be complicated but they are all real. To find an expression for the square root of this matrix (i.e., ...
4
votes
1answer
295 views

How to fix errors in Gram-Schmidt process when using random vectors?

I first make a function to get a random vector on unit sphere in a swath around the equator. That is what the parameter $\gamma$ controls; if $\gamma = 1/2$, the vectors can be chosen anywhere on the ...
11
votes
1answer
341 views

Why is MainEvaluate being used when LinearSolve can be compiled?

According to this question LinearSolve can be Compiled. However, CompilePrint shows a MainEvaluate but no-warning is generated. It appears that LinearSolve is not ...
8
votes
3answers
1k views

Discrete Convolution

Ask to compute the convolution of 2 lists, I managed to do so, with what I feel is rather heavy : Let my 2 lists be : a = {1,2,3,4} b = {1,1,1,1,1,1}; The below function adds 0s on each part of ...