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.

Filter by
Sorted by
Tagged with
1
vote
0answers
66 views

Integrating wavefunctions over a sphere

I am attempting to numerically solve the inner product of two particles and an electric dipole interaction potential. I am incredibly limited in my skills, and need to know how I can begin setting the ...
4
votes
1answer
59 views

Is it possible to solve for a matrix $ m $ satisfying $ m\cdot x=b $, given the vectors $ x $ and $ b $?

At first I thought it should be LinearSolve, which however turns out aiming at x, given m ...
2
votes
1answer
122 views

What am I doing wrong when trying to plot this function?

I'm trying to reproduce the computations of this paper and I'm running into some troubles because I'm rather new to Mathematica. In the paper's page 4, in figure 2 the authors show a plot of a ...
6
votes
0answers
66 views

Where is the mistake in computing the particular eigenvector of the following DFT Matrix?

I have the following matrix (the DFT Matrix for N = 3) $$W = \frac{1}{\sqrt{3}}\begin{pmatrix} 1 & 1 & 1 \\ 1 & e^{-\frac{i 2 \pi}{3} } & e^{\frac{i 2 \pi}{3} } \\ 1 & e^{\frac{...
4
votes
1answer
171 views

Numerically computing the eigenvalues of an infinite-dimensional tridiagonal matrix

I have one infinite dimensional tridiagonal matrix whose eigenvalues I have to compute. How can that be done numerically using Mathematica? Let me expose the concrete case I want to do it. I shall ...
3
votes
1answer
54 views

Why doesn't this Kronecker Product work with columns, but with rows?

Using the formula given in this math.stackexchange answer by the user greg $$\eqalign{ vec(M\otimes dK) &= \left(\pmatrix{I_T\otimes (M \cdot e_1)\cr I_T\otimes (M \cdot e_2)\cr \vdots \cr I_T \...
0
votes
2answers
96 views

Verifying equality $ (\vec a \times \vec b)^2 = \left| \vec a \times \vec b \right| ^2 $

I'm trying to verify the equality $ (\vec a \times \vec b)^2 = \left| \vec a \times \vec b \right| ^2 $ in Mathematica. How can I do it? Thank you for your time.
4
votes
1answer
106 views

Fastest, and numerically stable way to compute $CA^{-1}B$ and $CA^{-1}x$?

I have to compute $CA^{-1}B$ and $CA^{-1}x$, where $A,B,C$ are conformable matrices and $x$ is a vector. I'm not sure if it helps, but $A$ is symmetric and positive definite. The $A$ matrix will be ...
9
votes
0answers
167 views

Matrix-free Arnoldi method for eigensystems

I am solving a generalized eigenvalue problem $$\mathbf S\,\mathbf x = \lambda\,\mathbf M\,\mathbf x$$ w/ $\mathbf S := \mathbf B\,\mathbf A^{-1}\,\mathbf B^{T}$, and $\mathbf A$ is a sparse ...
0
votes
1answer
69 views

What is going wrong when I try to solve a simple linear equation? [closed]

I'm trying to understand how does the LinearSolve function works. I'm trying it out like this: A' ...
6
votes
2answers
208 views

Catastrophic loss of accuracy in Orthogonalize

Context In connection to this question I am interested in orthogonalizing known matrices. As a test case, let us consider the definite positive $15 \times 15$ matrix ...
1
vote
1answer
55 views

The Equation for solving Matrix is stiffnessmatrix.d == F

The Equation for solving Matrix is stiffnessmatrix.d == F. Where I know the Matrix {d} and [F] but [ stiffnessmatrix] is an 18x18 matrix contain 8 variable i need to solve for. Can anyone provide code ...
0
votes
1answer
522 views

Solve a system by Cramer's rule using loop

Consider the linear system AX=B,where A={{3, 0, 2}, {-3, 2, 2}, {2, -3, 3}},B={{3}, {-1}, {4}} and x=...
0
votes
1answer
95 views

Solving system of equations for coordinates

This is my first time here, so let me know if there's something I need to add to the post etc. Anyway, I need some help with Mathematica and linear algebra, and I got some tips that this would be the ...
1
vote
2answers
696 views

Orthogonal Projection of vector onto plane

I'm currently trying to learn Mathematica, and I've got some linear algebra tasks to solve with it. I've gotten quite far but now I'm stuck on this one exercise. The instructions are: With the help ...
1
vote
0answers
73 views

L1-norm optimization algorithm crashes kernel on large datasets

I have an A.X-B linear system which I have transformed into A.x-b to be solvable as a linear program using the code below: ...
2
votes
1answer
852 views

Change of basis in Mathematica

I'm trying to set up a change of basis matrix from the base V -> W with the RowReduce function that's built into Mathematica. I am then supposed to verify the result by taking the product of the ...
-1
votes
1answer
57 views

Plotting Base-vectors not working properly [closed]

I'm stuck on a issue that I can't seem to solve. After defining values for V, W and x, I'm supposed to Plot two base-vectors in the base V and with the vector x in the same picture. I'm supposed to ...
1
vote
1answer
44 views

Find Transformation Matrix for Vectors of Functions, and Restrict Results of Solve Function

I have two vectors v,w which have a rather simple linear transformation A.v=w. My goal is to obtain ...
0
votes
1answer
133 views

Solve integer linear system [closed]

I want to find a solution of the system $$A x = 0,\quad x>0,\ x\in\mathbb{Z}^d$$ where the matrix $A$ has integer entries. With a single solution I am happy. There is a way to do this? If not, can ...
-1
votes
1answer
373 views

How to compute eigenvalues of a large symbolic matrix?

I am trying to find eigenvalues for a big matrix having symbolic elements. Basically I am trying to find values of lambda for which matrix $(A-\lambda)$ is singular. For small matrices, we generally ...
1
vote
0answers
124 views

Tensor Contraction Speed Up (Matrix Product States)

I'm recently trying to implement some tensor contractions in Mathematica for use in Matrix Product State algorithms. Here's the operation I want to perform $$ M^{\sigma_{i}\sigma_{i}'[i]}_{(b_{i-1},...
2
votes
2answers
80 views

How to reduce the determinant of a matrix to its simplest form

I have a $ 12\times 12 $ matrix, of which I have taken the determinant. And I get a very big expression with three unknowns K1, ...
1
vote
0answers
75 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)...
2
votes
0answers
111 views

How can I perform the modified Cholesky factorization/Decomposition in Mathematica? [duplicate]

How to "Modified" Cholesky Decomposition in Mathematica? what I mean: V = L . D . Transpose[L] V is p*p(row is p,columns is p) non-negative definite matrix, D is diag[$d\small1$,$d\small2$,$d\...
0
votes
1answer
270 views

Partial trace and Partial Transposition of a matrix easily? [closed]

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
22 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
42 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
67 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
67 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
49 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 ...
33
votes
1answer
2k views

Complex eigenvalues from a sparse Hermitian matrix

Bug introduced in 9.0 or earlier and persisting through 12.0. I notice in the following example that wrong complex eigenvalues are resulted if calculating from a Hermitian sparse matrix, which should ...
2
votes
0answers
86 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
90 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 ...
-1
votes
1answer
46 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, ...
1
vote
2answers
124 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
188 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 ...
11
votes
2answers
467 views

Making an interactive visualization of the eigenvectors of two-dimensional matrices

I've recently stumbled upon this very nice interactive visualization of eigenvectors of two-dimensional matrices, and how powers $A^k$ act on various vectors. How can this sort of visualization be ...
2
votes
1answer
66 views

Eigensystem for simple equi-correlation matrix

I'm trying to get a set of eigenvectors for a correlation matrix, but getting stuck, maybe because I do not properly normalize them. For example, the following code works, in the sense that I get back ...
3
votes
2answers
136 views

Programming with Mathematica Syntax - Dunford decomposition

I am always amazed while I am reading some solutions of problems in mathematical problems of this site with Mathematica. For instance, look at the problem 48. Whereas I am writing 100 lines of code ...
5
votes
2answers
80 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
214 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
167 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
61 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
118 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
78 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 ...
0
votes
1answer
140 views

Det, MatrixRank and Eigenvalues

I consider myself to be an inexperienced Mathematica user so maybe someone could point out what am I doing wrong. In short, here is what I want to get: suppose that there is a matrix of dimension $ N ...
2
votes
2answers
362 views
1
vote
0answers
129 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 + ...

1
3 4
5
6 7
23