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
-2
votes
0answers
23 views

Implement statistics for the length of continued fractions of a result on MATHEMATICA [duplicate]

After successfully generating the reduced fraction of two coprime in interval (0,1] with the following; ...
3
votes
1answer
65 views

Implementing solution of a system of recurrence relations

Let us consider a system of recurrence relations such as $ a_{n-1} = ( \lambda_1 + n \lambda_2 ) a_n + \lambda_3 b_n $ $ b_{n-1} = ( \lambda_4 + n \lambda_2 ) b_n + \lambda_5 a_n $ subject to the ...
1
vote
1answer
73 views

How to write a matrix in a different basis by using Mathematica

I have these two 4x4 matrix ...
7
votes
1answer
109 views

Kronecker Square Roots

I'm interested in computing the 'Kronecker Square Root' $\mathbf{A}_{n\times n}$ of a matrix $\mathbf{M}_{n^2\times n^2}=\mathbf{A}\otimes\mathbf{A}$. In case it doesn't exist, I'd like to find the ...
4
votes
0answers
37 views

Finding matrix in Krylov subspace (Lanczos method)

The Lanczos method for finding the smallest eigenvalue of a hermiteian matrix $H$ is based on the construction of a vector subspace (Krylov space) where one can build a matrix $H_{Krylov}$ which is ...
1
vote
1answer
62 views

Quadratic form derivative in Mathematica

How to correctly differentiate quadratic form by vector in Mathematica, i.e.: $Q=\omega^T I_{p} \omega$ $\frac{dQ}{d\omega}= ??? $ ...
0
votes
0answers
41 views

On the diagonalization of matrices and strange results [duplicate]

I'm trying to implement the following calculation in mathematica $$U^{(0)}(\mu,m) = V\left(\left[\frac{\alpha_S(m)}{\alpha_S(\mu)}\right]^{\frac{\gamma^{(0)}}{2\beta_0}}\right)_DV^{-1}$$ where $\gamma^...
2
votes
1answer
79 views

A function that modifies functions - well-defined operation?

Here's my basic setup: Say I have a list of specific symbols and a function noSymbol, which accepts a mathematica expression and checks whether any symbol from my ...
4
votes
1answer
121 views

Eigenvalue and SparseArray

This the code of Hofstadter spectrum for square lattice using Mathematica ...
1
vote
2answers
96 views

Given A and B, how to find C if A = CBC?

Given A={{0,1,1,0},{1,0,0,-1},{-1,0,0,1},{0,1,1,0}} and B={{0,1,0,0},{0,0,0,0},{0,0,0,1},{0,0,0,0}} and ...
1
vote
0answers
31 views

Question about a restricted rewrite rule [closed]

I just started learning Mathematica and I'm not sure why a function I defined doesn't work. So I'm trying to write a function that takes a list of vectors and eliminates all zero vectors (with respect ...
7
votes
1answer
188 views

What is the best source to learn how to use tensor operations (exterior algebra) in Mathematica?

I'm specifically interested in the TensorProduct,TensorWedge, HodgeDual and certain build in functions to do tensor arithmetic like TensorReduce, TensorExpand. I would like to do exterior algebra ...
2
votes
3answers
111 views

How to collect a polynomial with a specific power

Suppose I have got this polynomial u=x^12-3x^8-x^4+3 Now, I am trying to collect this polynomial with x^4 terms. I need to write it like this: (-1+x^4) (-3 + x^4) (1 + x^4) To evaluate it, I used ...
0
votes
0answers
46 views

Use Root object as a function in NonlinearModelFit or similar

I have a matrix and its eigenvalues are returned by Mathematica as a Root Object. ...
0
votes
1answer
33 views

How to make first component of eigenvectors on grid real and normalize using Map and Normalize? [closed]

I am trying to use the following approach: How get eigenvectors without phase jump? to apply the same conditions to an array of complex-valued Mathematica eigenvectors. The matrix solved for is a <...
1
vote
0answers
58 views

unable to verify this Gaussian elimination output

I was trying the following code to obtain the Gaussian elimination matrix. (the Echelon form, not the reduce echelon form). Since Mathematica does not have a build in function for it, but I used this ...
1
vote
1answer
58 views

LinearOptimization duality

I'm solving a linear program using LinearOptimization. I'm curious why "DualityGap" does not return zero (as described in the docs). Here's the code: ...
1
vote
1answer
43 views

Nominal variables in LinearModelFit must be specified before continuous variables

I am applying the LinearModelFit to a 90 x 5 matrix, in which the 4th variable is a nominal variable (i.e., x4 is a categorical ...
1
vote
1answer
31 views

Use result of function without repeatedly evaluating [closed]

I have a function which takes the determinant of a matrix whose values depend on two parameters: f[x_,y_]:= Det[M[x,y]]; where M is a predetermined matrix which is ...
2
votes
1answer
107 views

Solving simultaneous differential equations using eigen value method

I wish to solve the following set of ODE. $$i\frac{d}{dt}B_{n}\left(t\right) =f\sqrt{\left(P-n\right)\left(n+1\right)}B_{n+1}\left(t\right)+f\sqrt{n\left(P-n+1\right)}B_{n-1}\left(t\right) + Y\left[...
3
votes
0answers
78 views

Symbolic matrix multiplication?

I'm dealing with infinite dimensional matrices $M$, who's elements $M_{nm}$ can be expressed as a sum of terms with kronecker deltas $a_{nk}\delta_{n+k,m}$, with some coefficient $a_{nk}$ for each ...
0
votes
0answers
20 views

Creating a matrix with values used to solve a system of linear equations

I have a system of linear equations that are to be solved in order to create a square matrix C3sol. I then take this and try to put it into matrix form to show as a ...
2
votes
0answers
95 views

How would I use Mathematica to solve this question?

Given the following matrix, A, that corresponds to a particular subset of the world wide web: ...
0
votes
1answer
121 views

Lanczos algorithm [closed]

How can I implement this method ,,Lanczos algorithm " through Mathematica? This method solves eigenvalues and eigenvectors of a symmetric matrix.
0
votes
0answers
28 views

How to operate every element of a matrix to get a new matrix

If we give a upper triangular matrix $\boldsymbol{B}$ with non-zero diagonal elements, how can we get a new square matrix $\boldsymbol{A}$? For instance, the order of upper triangular matrix is 5, ...
0
votes
0answers
24 views

Mathematica doesn't evaluate LinearSolve Function properly [duplicate]

Maybe this could be a stupid question, but I can't solve this problem. I'm trying to evaluate an expression with LinearSolve Function but it doesn't work. I have pre-evaluated the matrix ...
0
votes
1answer
33 views

Random point in a line in n-dimensional space [closed]

Suppose we have a line in N-dimensional space (or 3-dimensional space for simplicity) and we know its parameters. Is there any way to find the coordinates of a random point in that line systematically?...
0
votes
0answers
41 views

Automation procces of a sparse matrix

I have his set of equations obtained by the finite difference method. The variables represent the grid points of a rectangular grid. The size of the rectangular grid is 3*3. ...
0
votes
0answers
28 views

Error with SemidefiniteOptimization

I have the following semidefinite problem $$\min_{\textbf{Y}\geq 0} Tr[\textbf{F}_0\textbf{Y}]$$ with constraint given by $$Tr[\textbf{F}_j\textbf{Y}] = c_j$$ and in which $\textbf{Y} $ is Hermitian. ...
0
votes
1answer
52 views

Complex Conjugate of matrix

I have written the following code ...
0
votes
1answer
53 views

Complex Conjugate Transpose of a vector

Suppose that the vector is Psi={{a},{b}}; and a and b are imaginary numbers in general. I want to calculate in Mathematica the tensor product and define a1,b2 as ...
2
votes
1answer
39 views

Inverse of the matrix with several indices

Suppose I have a square matrix $A_{mn}$ where $m=(i,j)$ and $n=(k,l)$. For example, if $i,j,k,l=1..N$ the matrix is $N^2\times N^2$. For simplicity, let me generate it by ...
0
votes
0answers
42 views

Checking Membership of Conic Hull for Multiple Inputs

Suppose I have a given $10 \times 12$ matrix T, a $12 \times 1$ vector Subscript[\[Xi], 0], a $4 \times 12$ matrix ...
2
votes
4answers
148 views

Coordinate transformation can this be done with AffineTransform?

Looking for alternatives or improvements for accomplishing the following: Given the position of points A, B, and C in both the x-y and u-v planes, determine transformation functions to map values ...
0
votes
1answer
32 views

testing linear independence for an unknown number of matrices

I would like to test if 16 matrices (4X4) that I created are linearly independent. The straight-forward solution would be to check if the equation $\sum_{k=1}^N \alpha_k A_k = 0$ (1) (N=16 in the ...
2
votes
0answers
35 views

DivisionFreeRowReduction Method for RowReduce

My overall goal is to use a division free algorithm to compute the nullspace of a matrix containing multivariate polynomials. For doing so, I believe, there is the method ...
2
votes
0answers
40 views

Product and limit of many (>2) matrices [closed]

So I have a matrix like this $$ \begin{bmatrix} 1+iA & iAe^{-2ian/N} \\ -iAe^{2ian/N} & 1-iA \end{bmatrix} $$ in mathematica form is like this ...
2
votes
1answer
88 views

Derivative of a norm

I learned not use the Norm[] function when computing vector derivative, so I use the dot product instead: In: D[x.x, x] Out: 1.x + x.1 What does the result mean? ...
-3
votes
1answer
338 views

Need help to convert a Matlab script into a Mathematica script?

I would like to convert a small script but a little technical in Mathematica language. Here is the Matlab script : ...
1
vote
0answers
31 views

How to find the condition number of a matrix using Mathematica v9.0? [duplicate]

I'm new to Mathematica and therefore I apologize for my easy question below. I would like to determine the condition number of a matrix and searched the net and found a command which is as: ...
1
vote
1answer
35 views

Difficulty in evaluating the constants of simultaneous equations

How to find the constants A1, A2, B1, B2 using linear solve or null space function in Mathematica. ...
2
votes
1answer
43 views

In NMinimize, how to incorporate constraints on positive semidefiniteness of a matrix which is not the matrix variable being optimised?

The problem I want to solve the following problem for symmetric matrix $X$: $$ \begin{aligned} \min_{X\succ 0} \; & -\log(\det(X)) & \\ \text{subject to} \; & \begin{pmatrix} X &...
0
votes
1answer
83 views

Step-by-step GramSchmidt [closed]

Is there a way where Mathematica gives a step-by-step process for orthonormalization of vectors? I have the final result, but I would like to see the process of GramSchmidt to obtain the normalized ...
0
votes
1answer
59 views

Number of elements in a list [closed]

I have written the following program in mathematica. ...
3
votes
1answer
243 views

Laplace's problem in Mathematica

I am computing the Laplace's eigenvalue problem on the region $\Omega$ formed by the four vertices $(1,1),(1,2),(−1,2),(−1,1)$. Consider the Laplace problem, $$-L u = \lambda u$$ where $$L = y^2 \Big( ...
1
vote
1answer
64 views

Solving an eigenvalue problem

I am computing the eigenvalues of Laplacian-type operator on the unit square $\Omega = [0, 1]^2$ Consider the eigenvalue problem on the unit square $\Omega$, $$-L u = \lambda u$$ where $$L = e^{2y} \...
0
votes
0answers
33 views

List of eigenvalues not exceeding a given number

I am interested in computing the eigenvalues of Laplacian numerically. Consider the $\textbf{LAPLACE'S BOUNDARY VALUE PROBLEM ON A UNIT SQUARE:}$ Let $\Omega = [0 , 1]^2$. Now the eigenvalue problem ...
0
votes
1answer
47 views

How can I solve a linear equation with many input variables symbolically without taking forever

Background: I have a linear equation whereas T2 and T3 are transformation matrices, Rp is ...
9
votes
1answer
158 views

Efficiently populate a Sparsearray for a set of rules for a constrained basis

I want to populate quite a large SparseArray(10^6 x10^6) efficiently. It is basically a spin system Hamiltonian with a constrained Hilbert space. Unlike the examples I have looked at in this forum ...
4
votes
2answers
150 views

Asymptotic law in Laplace's problem

$\textbf{Eigenvalue problem on a unit square $\Omega = [0,1]^2$ :}$ Consider the eigenvalue problem with the Dirichlet boundary condition that is, $$-Lu = \lambda u$$ where $$L = \frac{\partial^2}{\...

1
2 3 4 5
27