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.

learn more… | top users | synonyms

2
votes
0answers
68 views

Unexpected behavior from applying ToRadicals to eigenvalues [closed]

I am trying to get the symbolic form of a $10 \times 10$ matrix (I know, that is generally too large). ...
1
vote
1answer
93 views

Sum to Zero Constraint in GeneralizedLinearModelFit

Is there a way to impose a constraint on a generalized linear model fit in Mathematica? In R, when using the glm() function, you can set options(contrasts=c('YY.sum', 'ZZ.sum')). Is there something ...
0
votes
1answer
103 views

Find partial solution for underdetermined system of Boolean equations (Minesweeper)

In this article about creating a Minesweeper solver, the author talks about using matrices to solve given portions of a Minesweeper board. While reading that, I thought of a different way to limit the ...
3
votes
1answer
84 views

Plotting eigenvalues smoothly

I am trying to plot how the eigenvalues of a matrix change by changing a given a parameter t. Of course the ordering of the eigenvalues does not matter mathematically but it does when I want to make ...
0
votes
0answers
58 views

Strange sharp spikes causing overflow while doing gradient descent

I am trying to find a function h(r) that minimises a functional H(h) by gradient descent. The result of H(h) is a single number. (Basically, I have a field configuration in space and I am trying to ...
1
vote
1answer
78 views

Creating a transformation matrix with respect to given bases? [closed]

Let's say I have a linear transformation $T:V\to W$, along with some bases $\{v_1,v_2\}$ and $\{w_1,w_2,w_3\}$ of each respectively. Let's say all the information I have about the transformation and ...
2
votes
1answer
63 views

Efficiently Invert a Square, Block Diagonal Matrix

I am generating an n x n matrix where n is specified by DIM: ...
2
votes
2answers
72 views

Symbolic calculation of the rank of jacobian matrix

I would like to symbolically determine the rank of a jacobian matrix. In the help, I have seen that the MatrixRank function can be used for this purpose. However, when I use this function, the ...
-1
votes
2answers
103 views

linear system equation ( trying to solve ) [closed]

I am trying to solve this system 3.7 x1+51.5 x10+71.3 x11-84. x2-16. x3-57.7 x4+89.7 x5-54.9 x6-85.8 x7+57.8 x8-51.3 x9==-36.8 -86.3 x1+5.7 x10-0.2 x11-39.9 x2+52.6 x3-45.6 x4+78. x5+90.7 x6-86.2 x7-...
0
votes
1answer
54 views

Extract solutions of linear system to variables

I need to output the answers from solve into the variables named just as they were named in the solve equations. I have checked out this thread Assign the results from a Solve to variable(s) but ...
1
vote
2answers
64 views

Trouble implementing logarithmic matrix norm

I wanted to write a quick function that calculates the logarithmic matrix norm with respect to the spectral norm. The formula is $$ \mu_2(A) = \lambda_\mathrm{max}\left(\frac{A + A^T}2\right). $$ So ...
1
vote
1answer
57 views

Only get the lowest Eingenvalue? [duplicate]

I have a huge sparse matrix and I want to have the smallest eigenvalue and its corresponding eingenvector. I use this code (a used a smaller matrix for the example): ...
6
votes
1answer
471 views

What does it mean when Mathematica returns a zero “eigenvector”? [closed]

For example, I ask Mathematica to compute the eigenvectors of $\left(\begin{array}{cccc} 1 & 1 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 5 & -4 \\ 0 & 0 & 4 & ...
6
votes
1answer
137 views

Issue in Det[…] when computing determinants of polynomials?

When I form a matrix of at least size $12 \times 12$ of second order polynomials in $w$ and I calculate the determinant of that, I get something that is a rational expression in $w$. Since the ...
5
votes
3answers
320 views

Bilinear Dot Function

In mathematics the matrix product is a bilinear operation $$ \alpha A \cdot(\beta B + \gamma C) = \alpha\beta ( A \cdot B )+ \alpha \gamma (A\cdot C ), $$ where capital letters denote matrices and ...
3
votes
0answers
77 views

Change of basis of polynomials

Suppose I have a favourite basis for polynomials in $x_1,\dotsc,x_n$, say non-symmetric Macdonald polynomials to be specific. I can easily compute these, and thus the change-of-basis matrix that takes ...
0
votes
1answer
147 views

Solving linear system with constraints

I need to come up with a solution for a rather, odd situation. Let's say I have an $M \times N$ matrix called ${\bf A}$, and I would like to solve it for ${\bf x}$ where $b_1 \le {\bf A} {\bf x} \le ...
3
votes
0answers
98 views

Writing a function to set up and solve the least squares problem

I have setup the explicit line equation for a given set of points using least-squares approximation and the knots computed below. I have tried extending the same code for use with an arbitrary degree, ...
2
votes
1answer
113 views

Solving large linear systems of equations efficiently?

I need to solve linear systems of equations of approximate size $(n!)\times(n!)$ as efficiently as possible for as high parameter n as possible. All the entries ...
5
votes
3answers
121 views

Finding most general matrices $A$ and $B$ such that $A\cdot B=1$

I would like to find the most general shape of matrices $A$ and $B$ such that $A\cdot B=1_{4\times4}$. Naively, I just define for example ...
0
votes
1answer
62 views

Varying constant in Matrix calculation to generate 3D plot

As suggested, I rewrite my code to make it simpler and directly showing the problem. Here is a short example. I'd like to generate 3D plot where x,y,z (= a,b,answer) while I am varying a (0 ...
4
votes
1answer
63 views

Transform set of linear equations into matrix and two vectors

Consider a list L containing entries dependent on variables x[i] (the i are integer, yet not ...
2
votes
2answers
149 views

Repeated multiplication of a square matrix and a column vector in Mathematica

I am very new to Mathematica and StackExchange, so pardon me if I am repeating a question that has already been answered. I am trying to use Mathematica to do the following: u[n+1] = A.u[n] where A is ...
11
votes
2answers
402 views

Expressing the n-th power of a matrix [duplicate]

My matrix is $\qquad A= \begin{pmatrix} {1} & {2} & {3}\\ {4} & {1} & {0}\\ {0} & {5} & {4} \end{pmatrix} $ I need $\qquad A^n$ I tried ...
3
votes
0answers
194 views

Mathematica's Singular Value Decomposition different from another math engine [closed]

I’ve been working with SVD – singular value decomposition. Things weren’t working as expected. Thus, I looked over to Matlab and executed the following code: ...
3
votes
2answers
764 views

How do I get the inverse of a homogeneous transformation matrix?

I want to get the inverse of this homogeneous transformation matrix: iab = { {1, 0, 0, 0}, {0, 0, -1, 0}, {0, 1, 0, 3}, {0, 0, 0, 1} } ...
9
votes
1answer
115 views

UnitaryMatrixQ function not returning true for a unitary matrix

So I know this matrix is unitary. It's a well proven fact in quantum mechanics and you can even check for yourself on pen and paper, Heres a quick proof: Assume $H$ is hermitian (i.e. $H^\dagger=H$) ...
0
votes
0answers
59 views

Is this problem parametrically solvable or it can just be solved for specific $\sigma$ and $\theta$?

In order to solve This problem: What is the maximum value of coefficient fv with the constraint that the matrix is positive semi-definite?, I have used the following code (Determinant is computed by ...
1
vote
1answer
48 views

Array Flattening arrays of matrices given by rules

Fix an $n$ and an $m$ positive integers.I have some set of four $n\times n$ matrices $A$,$B$,$Y$,$Z$ (where $Z$ is the zero matrix). I'd like to input the $nm\times nm$ matrix of block matrices given ...
3
votes
0answers
51 views

Generation of Space Representation of non-crystallographic Point Groups

In Mathematica the command FiniteGroupData[{"CrystallographicPointGroup",<group number>}, "SpaceRepresentation"] yields the space representation (...
7
votes
1answer
203 views

Incorrect Left and Right Eigenvectors in Mathematica

I'm trying to find the Left and Right Eigenvectors of a pretty straightforward matrix, but Mathematica doesn't seem to be able to do it for even a 200 dimensional matrix. Background: Given an ...
4
votes
1answer
153 views

How do I disable that Mathematica orders terms in lexicographic order?

I have matrices with entries where the order of the entries is important. Unfortunately Mathematica resorts terms in products in a lexicographic order. For example, ...
4
votes
0answers
180 views

Finding eigenvalues in Mathematica: why so slow?

I am trying to find the eigensystem of a large sparse real symmetric matrix, and I only need the lowest 40 or so eigenstates. The relevant code is as follows: ...
0
votes
0answers
22 views

Rewriting List of Matrix Equation in Terms of Individual Equations? [duplicate]

I have a list of matrix equations M1={{a1,b1},{c1,d1}}; A1={{x1,y1},{z1,w1}}; M2={{a2,b2},{c2,d2}}; A2={{x2,y2},{z2,w2}}; sys={M1==A1,M2==A2}; which I would like ...
1
vote
1answer
98 views

diagonalization function

If we have a matrix m which is n*n, how can I do mm=U^dagger m U which is a transformation ...
4
votes
1answer
62 views

Computing the logarithmic spectral norm rapidly

I wish to compute the logarithmic spectral norm of a square matrix $A$, which is defined by \begin{equation} \mu_2[A]=\lim_{t\downarrow0}\frac{\|I+tA\|_2-1}{t}. \end{equation} Hence, I simply code ...
0
votes
1answer
50 views

Solving simultaneous and determinant given constant value and variable T (temperature) [closed]

How to solve this two simultaneous equations? these two equations got from this free energy equation ...
8
votes
0answers
138 views

Why has Version 10.3 precision reduced?

In version 7.0.1.0 and versions 10.0 and 10.1 the following is produced: ...
1
vote
1answer
46 views

How to find selected elements of inverse of a banded matrix without inverting it?

Is it possible to find some selected elements of the inverse of a large sparse matrix without inverting it? For example consider this Hermitian matrix (as a general case). ...
0
votes
1answer
69 views

LinearSolve on non-square matrices?

I just came across a strange behaviour for LinearSolve (on Mathematica 8.0.0.0). Consider the following definitions: ...
1
vote
1answer
80 views

What's is the restrictions for the function MatrixExp?

When I use the MatrixExp on a general $2\times2$ matrix, Mathematica gives me this result: MatrixExp[{{a,b},{c,d}}] // TraditionalForm $\frac{1}{2\triangle}\left(...
7
votes
1answer
189 views

What kind of Arnoldi method is used in Mathematica?

Can someone give me a bit more information about what mathematical method Mathematica is using, (preconditioner, filtering-restarting, deflation) in the Lanczos implementation when I input something ...
3
votes
0answers
87 views

Real Canonical Form of Arbitrary Size Matrices

I have been searching the site and the Mathematica documentation, but have not found anything regarding this. If we find the Jordan Form of the following matrix, we get complex values, but I would ...
5
votes
0answers
165 views

VERY slow to solve a nonlinear equation involving matrix eigenvalues

I am trying to solve a problem similar to the following: ...
3
votes
2answers
55 views

How to avoid 0 OverVector[F] to be evaluated as 0?

I am fairly new in Mathematica and I am trying to work with scalars and vectors. I decided to denote vectors using OverVector (as example, ...
1
vote
0answers
82 views

Deriving ordinary least squares (OLS) in matrix form

How can I instruct Mathematica to derive the OLS in matrix form with respect to $\beta$ and obtain the result ${-2X}^{T}(y-X\beta)$? The matrices have the following dimensions: $y_{n \times 1}$, $X_{...
3
votes
1answer
34 views

TensorContract with KroneckerProduct instead of ordinary Times

Is it possible somehow to contract two tensors, say A={{a1,a2,a3},{a4,a5,a6}} and B={b1,b2,b3}, where the elements ...
4
votes
3answers
154 views

Write Sum of Matrices Explicitly

I have sum of lots of matrices A+B+C+D+E+... and I want that Mathematica shows me this as explicit matrix sum, i.e. Explicit Matrix A + Explicit Matrix B + Explicit Matrix C + .... and not just ...
2
votes
1answer
125 views

Explicit Contraction of Tensor Indices [duplicate]

Is there any easy way to explicitly contract indices of several given tensors. For example, ...
2
votes
1answer
89 views

Eigenvectors choose intuitive ordering/sorting

Starting from some symmetric $L\times L$ matrices $M$(see below), I want to compute the eigenvectors in Mathematica, in order to construct an ...