Questions on the linear algebra functionality of Mathematica.
2
votes
1answer
97 views
Evaluating a function on permutations of its arguments
Say I have a function "temp" of $n+1$ variables, $y,z1,z2,z3,...,zn$. I want to test if my function has certain symmetries like swapping $y$ with square of any $z$, swapping any two of the zs, ...
1
vote
1answer
112 views
RowReduce Problem
Here are two examples:
RowReduce[{{3, 1, a}, {2, 1, b}}]
evaluates to
{{1, 0, a - b}, {0, 1, -2 a + 3 b}}
but
...
3
votes
2answers
475 views
Linear equation with complex numbers
I have to solve an equation of the type $$a z+b \overline{z}=c$$ with $a,b,c\in\mathbb{C}$.
My approach is to set $F(z)=a z+b \overline{z}-c$ transform $z$ to $x+i y$ and then get a real linear ...
1
vote
1answer
130 views
Functions that operate on symbolic matrices?
I'd like to write functions that operate on symbolic matrices, and do nothing when fed anything else.
...
8
votes
1answer
163 views
Verifying and deriving basic (block) matrix identities
How can I use the new symbolic matrix/tensor capabilities to verify matrix identities, such as
(1)
or
(2)
Even better, how can I ask Mathematica to derive expressions for X, Y, Z, and U like ...
1
vote
0answers
171 views
Matrix algebra vs. PrincipalComponents and Varimax/Oblimin
Using matrix algebra I can calculate loadings and scores from the covariance matrix (data matrix is column centered):
...
1
vote
0answers
139 views
Parallel linear algebra with arbitrary precision
Is it possible to do parallel linear algebra with arbitrary precision within Mathematica (in a simple manner, as is done for the machine precision)?
2
votes
1answer
214 views
2
votes
2answers
304 views
Eigensystem, Eigenvalue doesn't output nonreal eigenvalues
Basically I have a matrix and when I used either Eigenvalue or Eigensystem, it doesn't output nonreal eigenvalues, instead it ...
9
votes
4answers
361 views
Dual-Grid Graph Paper With Mathematica?
Is there a slick way to generate the dual-grid graphs such as you can see on pages 7, 9, and 10 of this article, or this one?
I've searched, but found nothing. Thanks in advance...
0
votes
1answer
134 views
Rearranging a biclustered matrix
I currently have a $77\times 38$ matrix, and I have used a clustering algorithm to cluster the row data and column data. The rows and columns of my matrix correspond to a list of country codes (not in ...
2
votes
3answers
168 views
Adding elements in the sublists
How can I add the elements in the sublists?
For example, if I have the list which is
m={{1,3},{2,3},{4,1}}
then, the output that I want is ...
3
votes
2answers
153 views
Deleting a row or column of an adjacency matrix while maintaining the associated label
I am currently working with a weighted adjacency matrix for a directed graph, and it contains several 0 columns and rows. With the unaltered matrix, I am able to monitor the relations between vertices ...
4
votes
2answers
264 views
Can the CholeskyDecomposition function in Mathematica be made to work on non-symmetric matrices?
The CholeskyDecomposition[m] function in Mathematica requires a symmetric and positive definite matrix m.
For instance, the ...
1
vote
1answer
188 views
Using singular value decomposition for graph clustering
I have a fairly large graph (50-60 vertices) with directed, weighted edges, and I am attempting to cluster the vertices. Prior to this, I have only worked with undirected graphs having symmetric ...
6
votes
1answer
110 views
LinearSolveFunction unusable if stored to disk?
I encounter a problem when saving a LinearSolveFunction to disk, where the LinearSolveFunction is obtained with LinearSolve for ...
3
votes
3answers
221 views
Proving a recurrence in Mathematica
I have
$$j_n=\int_0^1 x^{2n} \sin(\pi x)dx.$$
How do I show that $$j_{n+1}= \frac{1}{\pi^2}(\pi- (2n+1)(2n+2)j_n)\, ?$$
I keep getting a recurring integration by parts and I can't simplify it.
...
1
vote
1answer
307 views
Calculating an exact orthogonal modal matrix in Mathematica
I can calculate the modal matrix of a matrix A using the command JordanDecomposition[A][[1]], and a decimal approximation of the orthogonal (or normalised) modal ...
4
votes
2answers
316 views
How to solve an eigensystem faster?
I have a module that I need to call 1-10 million times in my program. Currently, it is taking several hours to run so I am hoping that I can cut down some runtime with your help.
...
3
votes
2answers
315 views
Subspaces in Mathematica
I'm working on a research project and I need to learn how to use Mathematica to calculate subspaces. Specifically I plan to solve the following operations and I would greatly appreciate if you could ...
2
votes
2answers
299 views
Generating a vector of dummy variables
So I'm the situation of needing analytical solutions to a family of equations of the form Ax=b, where A is an nxn matrix. I've written a function that does what I want, but I'm currently using a bit ...
5
votes
2answers
826 views
Eigenvalue / Eigenvector Calculation
I'm currently trying to compute the three smallest eigenvectors for a 34 by 34 matrix. While I was expecting this to take some time, Mathematica has been running for the past 3 hours, which seems ...
1
vote
1answer
347 views
Linear Solve with Modular Arithmetic
I am interested in using LinearSolve[m,b] which will find a solution to the equation $m.x=b$, where I am in mod 2 arithmetic. Is there any way to perform this ...
4
votes
1answer
458 views
Mathematica won't give eigenvectors but Wolfram Alpha will? What am I doing wrong?
If I ask Mathematica to find the eigenvectors and eigenvalues of the matrix:
...
7
votes
3answers
369 views
Determine if solution to linear system exists
I'm trying to determine only if a solution to a linear system of equations exists. I have been using LinearSolve, which works fine, but it solves the system as ...
9
votes
3answers
214 views
Toggle visibility of elements in a plot
I have three simple graphs in one Plot. Now I am trying to make a button for each graph so you can hide or show it in the plot. Until now I was just able to make a checkbox with the Manipulate ...
10
votes
2answers
189 views
How can I compute the representation matrices of a point group under given basis functions?
Take the $C_{3v}$ point group for example:
...
2
votes
3answers
417 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
326 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
297 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
663 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
124 views
Pack Solve results into a vector
I am currently using a really easy function to get the eigenvectors of a corresponding eigenspace:
...
9
votes
3answers
525 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
382 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
127 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
252 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}}
...
0
votes
1answer
557 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
...
0
votes
1answer
268 views
If I know the steady state vector of a stochastic matrix, can i recover the matrix? [closed]
By steady state vector I mean the eigenvector which has an eigenvalue of 1. So is there a way to at least iteratively approximate the entries of the stochastic matrix?
Thanks.
3
votes
2answers
386 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 ...
7
votes
1answer
232 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 ...
6
votes
1answer
348 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 ...
2
votes
2answers
553 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
316 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 ...
9
votes
2answers
623 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
358 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 ...
6
votes
1answer
282 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
283 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
596 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 ...
9
votes
2answers
221 views
How to extract and compute on the diagonal entities of a sparse matrix very fast?
As could be seen in the following code:
...
7
votes
0answers
170 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.
...
