Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [linear-algebra]

Questions about Mathematica functionality related to manipulating vector spaces and linear mappings between such spaces. This includes determination of matrix properties, matrix transformations, decompositions, and factoring.

1
vote
0answers
23 views

Normal form for Hopf bifurcation

I'm trying to obtain the normal form for the Hopf bifurcation using mathematica. I was looking at the following article: downloads.hindawi.com/journals/sv/1995/581272.pdf and I´ve tried to solve (25)...
1
vote
1answer
44 views

Partial trace and Partial Transposition of a matrix easily?

Could someone help me to understand as to how to compute the partial trace and partial-transposition of an arbitrary matrix? I mean, is there any code to carry out these operations in Mathematica? ...
0
votes
0answers
18 views

Find value of expression based on variable equality instead of assignment

I have certain relations or equalities which determine how different variables are related to each other. These relations are meant to be used to further calculate the value of some other expression. ...
0
votes
0answers
11 views

How to transform a real matrix with complex eigenvalues into a positive definite real matrix?

If the matrix had real eigenvalues, I would substitute the negative eigenvalues by a small positive number. However, I have complex eigenvalues... How should I proceed to transform the original ...
0
votes
0answers
31 views

Find a matrix that are unitarily equal to the given matrix

I have four $5\times 5$ matrices, $P_i, Q_i$ ($i=1, 2$) as follows: $P_1=\begin{pmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & -...
4
votes
1answer
50 views

Populate matrix from linear system

What is the strategy to populate a matrix from a linear system of equations? As a toy example, I have some scary, complicated math, that generates eq1 and ...
1
vote
1answer
51 views

What is the best way to compute the set of vectors normal to a given one?

For 2D vectors, computing the vector orthogonal to a given $v$ is straightforwardly done using Cross, as for example shown here. However, ...
2
votes
1answer
22 views

Checking range of values of a symbol for which a matrix is positive definite

Very much related to this question: Checking if a symbolic matrix is positive semi-definite Is there a way to tell for which values of symbols a matrix is positive definite? For instance if ...
29
votes
1answer
1k views

Wrong eigenvalues from a sparse matrix: eigenvalues are nonreal

Bug introduced in 9.0 or earlier and persisting through 11.3. I notice in the following example that wrong complex eigenvalues are resulted if calculating from a Hermitian sparse matrix, which should ...
2
votes
0answers
47 views

How to construct a time-dependent matrix quickly?

In the process of discretization of a 4D PDE, I need to construct a final sparse matrix $B$, which is very large (I denoted by $\text{size}$ here) and time-dependent, viz, some of its entries change ...
3
votes
1answer
49 views

Solving $\det{(A+\epsilon B)}=0$ for large, symmetric and dense $A$ and $B$

In an algorithm I am writing, I need to solve the equation $$ \det{(A+\epsilon B)} = 0, $$ for the smallest value of $\epsilon$, given large ($n$x$n$ ideally up to 150x150), dense and symmetric A ...
0
votes
1answer
35 views

Is there one or more solutions to this system of stiff linear equations?

it is a question of hydrodynamics,and i have evaluated all the known Physical quantity,so there are only 6 unknown, I use the default of the solve function, but it can't get a solution, ...
0
votes
1answer
67 views

I have two lists that are the same, yet I get a FALSE when i try to show they are equivalent

I have tried changing the variables, reevaluating the cells, but it just keeps giving me false. The weird part is that it was originally true and it changed to false, randomly.I did not want to post ...
4
votes
3answers
120 views

Eliminating linear combinations from lists

Suppose I have a list of simple expressions, something like: list = {{a-b-2c-d+e+2f},{-a-2b-c+d+2e+f},{-2a-b+c+2d+e-f},{x-y-z},{-x+y-z},{-x-y+z}}; These ...
3
votes
2answers
53 views

Find the base vectors of a point set

I have a list of coordinates that fits into a 2D periodic lattice, with some error ( $\vec{R}=n\vec{i}+m\vec{j}+\vec{\varepsilon}$). Is there a way to find the base vectors of the lattice? I guess the ...
1
vote
1answer
75 views

Save and use results of LinearSolve for symbolic large system (28 equations)

I need to solve system of 28 linear equations, for 28 variables, symbolicly. The coefficient matrix is sparse, and is composed from 8 parameters (symbols). After that I need to use 6 of the variables ...
4
votes
1answer
135 views

Summation of Kronecker deltas should give the dimension

I have a really simple problem but I don't know how to solve it. Basically, I am doing vecor manipulation and I am summing a lot of Kronecker delta here and there. How can I teach Mathematica that for ...
1
vote
1answer
45 views

An error of unequal length when using Transpose[y]? [closed]

Why do I get this error? I just clicked shift+enter in the y and it appeared. https://i.stack.imgur.com/IAKs8.png This is the data ...
0
votes
0answers
18 views

Matrix multiplication Q.W not working - Result=matrix Q . matrix W [duplicate]

When I write the code to do the dot product between two matrices, Mathematica does not compute it: How can I get the right matrix? EDIT Thank you for your willingness.
0
votes
1answer
72 views

How to find clusters with same cluster sizes?

I have a set of 71 data points. Each data point is represented by its latitude and longitude. I want to divide them into 12 clusters. The first 11 cluster will have exactly 6 points each and 12th ...
0
votes
1answer
59 views

How to solve a matrix $ Ax=0 $, where matrix $ A $ is a function of $ ω^2 $ [closed]

I have a matrix $ A $ which depends on $ ω^2 $. I wanted to solve for $ ω $. The usual procedure is taking the Det[A] and equate to zero and solve for it. How can I ...
1
vote
0answers
34 views

Find value of variable for unique, infinite and no solutions in equation system

How do i find which values of a variable in a equations system that gives unique, infinite and no solutions? My example: \begin{align*} ax + y + az &= 2 \\ x + ay + z &= 2 \\ x + ...
2
votes
1answer
74 views

Getting least norm solution

Noob question -- how should I get least norm solution in Mathematica for an under-constrained problem? Matrix is not full rank. I could use pseudo-inverse, but inverting a matrix to get a single ...
0
votes
2answers
45 views

Calculate value of expressions based on solution of given linear equations

I have these three equations: 1/X + 1/Y == 1/15; 1/Y + 1/Z == 1/20; 1/Z + 1/X == 1/25; I want to calculate the value of expression: ...
0
votes
0answers
25 views

Matrix equivalence over the integers

Is there any efficient way to tell whether two matrices $a,b$ are equivalent over the integers? That is, whether there exists some integer-valued matrix $c$ such that $$ a=c^Tbc,\qquad |\det(c)|=1 $$ ...
1
vote
0answers
27 views

How do I maximise the first real root of a multi-variable polynomial in x?

I have a polynomial in x, that also depends on {y1,y2,y3,y4,y5}. It always has 10 (not necessarily distinct) real roots. It's top coefficient is (1*x^10) I aim to find the y's that maximize the ...
2
votes
2answers
53 views

How to return multiplicity of each eigenvalue?

I could not find the information so maybe someone know if it possible. I have a matrix which has several degenerated eigenvalues and I would like Mathematica to return the multiplicity of each ...
2
votes
1answer
81 views

LieArt — 8 dimensional Irreducible representation of $\mathrm{SO}(8)$ and their decompositions - No.2

This is the followed up question of LieArt --- 3 different 8 dimensional Irreducible representation of SO(8) and their decompositions, Since $$ \mathrm{SO}(8) \supset \mathrm{SU}(2) \times \mathrm{...
1
vote
0answers
47 views

LieArt — 3 different 8 dimensional irreducible representation of $\mathrm{SO}(8)$ and their decompositions

I am using the LieArt which you can download freely online https://arxiv.org/pdf/1206.6379.pdf There are three different 8 dimensional $\mathrm{SO}(8)$ irreducible representations, formally it is ...
3
votes
0answers
55 views

Antisymmetric Matrix Eigenvector Normalization

So, I have a complex $4n \times 4n$ antisymmetric matrix, $A$ and it has a non-degenerate spectrum. The matrix $A$ then has eigenvalues given by $$ \beta_{1}, -\beta_{1}, \beta_{2}, -\beta_{2}, ... , ...
0
votes
1answer
83 views

Working with Dirac Gamma Matrices using FeynCalc - A simple problem

I need to obtain this using package FeynCalc: $$ \begin{align} [\gamma_{0},\gamma_{i}]=& 2 \gamma_{0}\gamma_{i}, \\ [\gamma_{i},\gamma_{0}]=& 2 \gamma_{i}\gamma_{0} , \\ [\gamma_{0},\gamma_{...
0
votes
0answers
42 views

Defining commutations rules over arbitrary matrix

I'm working with spin connections with Dirac gamma matrix commutator (I know, mathematica has specific ways to work with it), and I need to define the following rules; $[\gamma_{0},\gamma_{i}]= 2 \...
1
vote
1answer
40 views

How to collect eigenvectors corresponding to only positive eigenvalues?

Let us consider a matrix of order $n \times n$ with $n/2$ positive and $n/2$ negative eigenvalues. How to collect $n/2$ eigenvectors corresponding to positive eigenvalues in a matrix of order $n \...
5
votes
1answer
96 views

Eigensystem returns vectors which are not eigenvectors

Short synopsis: for a specific family of sparse matrices, the eigensolver seems to be unstable (kernel quitting) for certain examples, and when it works it seems to consistently return vectors which ...
3
votes
0answers
59 views

Arbitrary Precision, Nearly-Singular Matrices, and LinearSolve

I have been trying to solve a nonlinear eigenvalue problem, $\mathbf{M}(\lambda) \mathbf{v} = 0$, in Mathematica using Newton's method. The core of the algorithm relies upon an inverse iteration, ...
5
votes
1answer
87 views

Finding the orthogonal diagonalizing similarity of a symmetric matrix

I'm aware that there are some questions similar to this here, but none that could solve my problem. So, I have to diagonalize a symmetric symbolic matrix $m$ (to be seen below) and obtain the ...
-1
votes
1answer
33 views

column space having non-linear combinations of basis vectors [closed]

I have a matrix $A_{3x3}$ whose basis for the column space are $a_{1}=(2,2,5)$, $a_{2}=(9,5,3)$ and $a_{3}=(3,6,1)$. If these are the basis for the column space, then column space can always be ...
6
votes
1answer
106 views

Inconsistency in eigenvalues of matrices in a specific form (sparse & non-Hermitian)

Suppose one has a non-Hermitian sparse matrix defined as below ...
5
votes
1answer
88 views

Can a certain pair of expressions be compressed into one?

I've been employing this pair of statements ...
1
vote
0answers
49 views

Find parameter which solves a 9-by-9 homogeneous system of linear equations, NSolve gives some incorrect answers

I have a set of 9 linear homogeneous simultaneous equations which depend on 2 parameters, p and x. For a chosen value of p, I aim to calculate the smallest 3 values of x which satisfy the simultaneous ...
0
votes
2answers
57 views

Why do I get a Partition::pdep error?

I've been running an iterative job (j=1,2.,3,.....300,000,000). The vast majority of steps proceed smoothly. Every several million or so steps, I get a "General::inf: Input matrix contains an infinite ...
3
votes
1answer
46 views

Basis for unstable manifold of a matrix

Given a square matrix A, how can I generate a basis for the generalized eigenspace corresponding to all eigenvectors $\lambda_i$ such that $\vert \lambda_i \vert &...
-1
votes
2answers
144 views

Why the NullSpace can not find solution when the Det[t]==0

This question contained the problem of NullSpace, but previous ones not. This is a problem seems like my previous one, but there is some details different. I find that perhaps one method can not ...
1
vote
2answers
162 views

The solutions of Det[t]==0 do not satisfy the equation

t is a generated matrix with a parameter kz. Through solving Det[t]==0, the solutions, i.e. kz, are obtained. When I substitute any one solution in Det[t], the result is a large number, why? How to ...
4
votes
2answers
205 views

LinearSolve on a singular matrix

I have some singular transition rate matrices $m$ (columns add to zero). They have exactly one zero eigenvalue that I want to find the corresponding eigenvector of (the rest of the eigenvalues are ...
1
vote
2answers
87 views
1
vote
1answer
52 views

Increasing accuracy of solving overdetermined linear system

I am given $48 \times 48$ matrix $A$ and a vector $b$ and I would like to solve system $Ax = b$. I know that $A$ is underdetermined, i.e. there exist many solutions for $x$. Due to some considerations,...
1
vote
1answer
55 views

Implementation of discrete Fourier Transform in Matrix Form

I am trying to gain an in depth understanding of how discrete fourier transforms work, and consequently I am trying to implement the discrete fourier transform myself in the form of a matrix. First ...