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

Matrix Integro-differential equation

I'm trying to solve this integro-differential equation to obtain the density matrix elements $\rho$. $ \frac{d\rho}{dt}=-i[H_{0}(t),\rho(t)]-A^{2}\Big[H_{1},\int_{t1}^{t}e^{-B(t-s)}\Big(e^{-i\int_{s}^{...
user avatar
4 votes
1 answer
136 views

Nonnegative Least Squares Algorithm (NNLS) [closed]

Can anyone optimize the code below which is developed in an old version of Mathematica (2003) both in terms of efficiency and adaption to the latest versions of Mathematica? Description of the code: ...
user avatar
1 vote
0 answers
80 views

Solve 2x2 complex unitary matrix with constains using Solve does not work

I have a 2x2 complex-valued matrix, $U=\pmatrix{U_{1,1}e^{i\theta_{1,1}}&U_{1,2}e^{i\theta_{1,2}}\\ U_{2,1}e^{i\theta_{2,1}}&U_{2,2}e^{i\theta_{2,2}}}$ which I must impose two ...
user avatar
2 votes
2 answers
87 views

Solution to a linear equation with minimum rank

Suppose I have a linear equation, $X.M=A$, for given matrices $M$ and $A$. I can use FindInstance to produce a solution $X$. How can I add the constraint that $X$ has the least rank? Indeed, I could ...
user avatar
3 votes
2 answers
199 views

How to obtain independent variables from a set of linear constraints

I have a question, how to obtain independent variables from a set of linear constraints. Let me illuminate this by a simple example, we have 5 variables and 3 linear constraints, $x1+x2+2*(x3+x4)+x5=...
user avatar
1 vote
0 answers
51 views

Controlling accuracy for code

So I have a lot of trouble controlling precision and or accuracy with Mathematica. I have tried reading up for it but in the end I get even more confused. Here is my code, it is a little long but it ...
user avatar
  • 635
1 vote
2 answers
76 views

How can I generate a tridiagonal block matrix? [duplicate]

$$\begin{pmatrix}C&D&&&&\\D&C&D&&&\\&\ddots&\ddots&\ddots&&\\&&&D&C&D\\&&&&D&C\end{pmatrix}$$ I want ...
user avatar
0 votes
0 answers
32 views

Generate a random matrix with a condition on its eigenvalues

I can generate Radom matrices using mat = RandomReal[{-1, 1}, {2, 2}]; But how can I generate the mat matrix so that the ...
user avatar
  • 577
1 vote
0 answers
43 views

Solving a badly conditioned set of linear equations

I have a numerical high-precision badly conditioned over-constrained set of linear equations that I want to solve. I start out with m=616 equations and ...
user avatar
  • 3,603
14 votes
1 answer
341 views

Is it possible to use the DGEEV and DSYEV LAPACK subroutines in Mathematica?

Here is my problem: I'm diagonalizing some matrices using Eigensystem[] to obtain eigenvalues and eigenvectors and I'm diagonalizing the same matrices using a ...
user avatar
  • 151
0 votes
0 answers
39 views

Detailed properties of `FindInstance`

Does anybody know where to read about how FindInstance works? Specifically I want to use it in such a way that when it returns {}...
user avatar
-1 votes
1 answer
64 views

Matrix basis using `Orthogonalize`

I have four matrices, ...
user avatar
  • 268
0 votes
0 answers
60 views

Eigenvalues aren't given to be imaginary

So I have this matrix I am working with that looks like $$S=\begin{pmatrix}0 & -a & b\\ a & 0 & -c\\ -b & c& 0 \end{pmatrix} $$ and upon asking mathematica for the eigenvalues ...
user avatar
  • 101
1 vote
1 answer
72 views

How to get a rational solution of the linear system efficiently?

I got a large linear system ...
user avatar
  • 71
4 votes
0 answers
105 views

Algorithm for the resolvent of a matrix, and LUBackSubstitution

Suppose A is a complex n x n matrix where n is quite big, given as a numeric array. For many ...
user avatar
2 votes
1 answer
75 views

Check Eigenvalues and Eigenvectors are correct [closed]

I have a matrix: J = {{0, -λ (1 + φ)/τ}, {-(1 + φ)/τ, δ}}; And I compute the Eigenvalues and Eigenvectors as follows: ...
user avatar
  • 77
1 vote
1 answer
83 views

Inverse of a matrix with symbolic variables

I want to evaluate the inverse of the following colossal matrix ...
user avatar
  • 393
0 votes
1 answer
44 views

How to solve this equation of n-order matrix?

Question: Let i be an n-level identity matrix and j be an n-level matrix with all elements of 1. Let n-order matrix m be $M=\left(\begin{array}{ccccc}k & \lambda & \lambda & \cdots & \...
user avatar
  • 1,365
1 vote
0 answers
90 views

Discrepancy in eigenvalues [closed]

I need to calculate the eigenvalues of a matrix and the parameters are such that there is a large difference (several orders of magnitude) between the entries. Theoretically, the matrix has only one ...
user avatar
8 votes
1 answer
267 views

Working around Memory Leak from HermiteDecomposition

I am running into an issue where HermiteDecomposition seems to leak memory, but only from certain matrices ...
user avatar
3 votes
1 answer
1k views

Is there a faster way to solve this linear programming problem?

I need to get a rational solution of the linear constraints ...
user avatar
  • 71
4 votes
2 answers
74 views

Looking for a efficient way of solving a matrix which is function of some variable

What is the efficient way to solve the matrix having a dependency on some varaible f. I have a simple matrix g which is ...
user avatar
8 votes
3 answers
501 views

Condition number of a matrix

I am finding it difficult to compute the condition number of a matrix using Mathematica. There is no built-in function, it seems, for this task. MatLab and Numpy have it. All stack searches point to ...
user avatar
2 votes
1 answer
80 views

Invert a generic n x n matrix

I want to invert a generic n x n matrix. Is it possible to do this with Mathematica? Consider, as a minimal example, the $n\times n$ matrix: \begin{bmatrix}1n&0&...&0\\0&2n& ... &...
user avatar
  • 175
-1 votes
1 answer
62 views

Help with equation within adjacency matrix

(Value R seen within desired matrix equation) resistance = 0.5; (L = ???) identitymat = IdentityMatrix[30]; fullmatrix = ((AdjacencyMatrix[plot])) + identitymat // MatrixForm p.s. I believe I have ...
user avatar
0 votes
0 answers
57 views

Unitary matrix with UnitaryMatrixQ

In the Mathematica help, the following example for a symbolic 2$\times$2 matrix $\left( \begin{array}{cc} a & b \\ c & d \\ \end{array} \right)$, with constraints, $c=b^{*}$ and $d=-a^{*}$ ...
user avatar
2 votes
2 answers
137 views

Find the maximum value of the minimum eigenvalue of the matrix

There is a $4×4$ matrix $Q$ where $c,d,e,m,n$ are variables. How to get the maximum value of the minimum eigenvalue of $Q$? $Q=$ $$\\\left( \begin{array}{cccc} \frac{12058305}{23104}-304 c & -849 ...
user avatar
  • 71
4 votes
0 answers
55 views

Calculate an n-order determinant by FindSequenceFunction

Calculate an n-order determinant: $\left|\begin{array}{cccccc}1 & 2 & 3 & \cdots & n-1 & n \\ n & 1 & 2 & \cdots & n-2 & n-1 \\ n-1 & n & 1 & \cdots ...
user avatar
  • 1,365
11 votes
11 answers
2k views

How can I construct this matrix?

How can I construct this matrix by MMA? $\left(\begin{array}{cccccc}1 & 2 & 3 & \cdots & n-1 & n \\ n & 1 & 2 & \cdots & n-2 & n-1 \\ n-1 & n & 1 & \...
user avatar
  • 1,365
4 votes
2 answers
238 views

Error in calculating determinant

Calculate n-order determinant (n>1): $\left|\begin{array}{cccccccc}a & b & 0 & 0 & \cdots & 0 & 0 & 0 \\ 0 & a & b & 0 & \cdots & 0 & 0 & 0 \\...
user avatar
  • 1,365
3 votes
1 answer
218 views

Calculate n-order determinant

Calculate n-order determinant (n>=2): $\left|\begin{array}{ccccc}x_{1}-a_{1} & x_{2} & x_{3} & \cdots & x_{n} \\ x_{1} & x_{2}-a_{2} & x_{3} & \cdots & x_{n} \\ x_{1}...
user avatar
  • 1,365
2 votes
1 answer
49 views

LinearSolve linear equations [duplicate]

I am new in Wolfram and dont understand how to solve equations with LinearSolve. I have used simple Solve, but what do I need to do with LinearSolve? ...
user avatar
  • 23
2 votes
2 answers
233 views

Three equation solving analytically in Mathematica

Im doing coding in iterative schemes but I do not know to solve three equations analytically in Mathematica step by step. For example I given thre equations in the attached figure. I want to solve ...
user avatar
  • 169
3 votes
2 answers
101 views

Set of quadratic forms and linear algebra

I have a set of quadratic forms. $L_{1}=u_1^TJ_{1}u_1$ $L_{2}=u_2^TJ_{2}u_2$ $L_{3}=u_3^TJ_{3}u_3$ where $u_{i=1,2,3}$ - 3$\times$1 vector; where $J_{i=1,2,3}$ - 3$\times$3 matrix; I need to pack ...
user avatar
  • 1,721
0 votes
0 answers
76 views

While loop to solve a diffusion problem

Crossposted at Wolfram Community: https://community.wolfram.com/groups/-/m/t/2506329 I am trying to use a While loop to solve for a diffusion problem using the power iteration method. The code is ...
user avatar
  • 1
0 votes
1 answer
48 views

Finding solutions linear system that contain only nonzero coordinates [closed]

I use the following code to output a list of k solutions of a linear system, solns = FindInstance[A.x == zeros, x, Reals, k] here ...
user avatar
  • 155
1 vote
0 answers
48 views

Simplifying RegionUnion call after CylindricalDecomposition

I want to simplify unions of output from CylindricalDecomposition calls. Consider: ...
user avatar
4 votes
1 answer
136 views

Tensorial calculus: A question about free and summed indices

I have to start with a full disclosure that I'm new to Mathematica, so this might be easy to resolve in a way that I don't know. I have to implement a triple contraction of an order three tensor $$d^{...
user avatar
  • 199
0 votes
1 answer
62 views

Working with matrices problem with MatrixForm [closed]

I'm just trying to set up a Matrix 24 by 24 with indices that start from 0 to 23 ...
user avatar
  • 199
5 votes
1 answer
80 views

How to prove that a list of algebraic numbers with the same symbolic expression is a number field?

Definition of number field (K): (1) $0,1 \in K$ (2) $\alpha, \beta \in K \Longrightarrow \alpha \pm \beta \ and\ \alpha \beta \in K$ (3) $\alpha, \beta \in K$, and $\beta \neq 0 \Longrightarrow \...
user avatar
  • 1,365
5 votes
2 answers
122 views

Finding polynomial relations between power series and sequences

In my research I often need to find polynomial relations between power series and number sequences. For example, in my essay "A Multisection of q-Series", I trisect a specific power series $\...
user avatar
  • 4,203
8 votes
2 answers
122 views

Efficient algorithm for calculating polynomial that has roots of a certain form

I have looked into this specific question on Math.SE concerning a more "mechanical" approach to finding a polynomial $p \in \mathbb{Q}[x]$ satisfying $p(\sqrt{2}+\sqrt{3}) = 0$. The user MJD ...
user avatar
  • 183
4 votes
1 answer
78 views

How can I get the intersect points of lines connecting different points?

How can I get the numeric points {x,y} where the lines below intersect, please? ...
user avatar
0 votes
1 answer
71 views

What kind of method does Solve use to solve a system of overdetermined linear equations?

I have a singular homogeneous linear system of equations, which easily can be solved by applying Solve: ...
user avatar
4 votes
3 answers
270 views

How can I rotate a 2D shape with respect to another?

...
user avatar
2 votes
1 answer
134 views

How to get the list of constant terms of linear equations? [closed]

A system of linear equations: $\left\{\begin{aligned} x_{1}+3 x_{2}+x_{3} &=2 \\ 3 x_{1}+4 x_{2}+2 x_{3} &=9 \\-x_{1}-5 x_{2}+4 x_{3} &=10 \\ 2 x_{1}+7 x_{2}+x_{3} &=1 \end{aligned}\...
user avatar
  • 1,365
0 votes
1 answer
62 views

Solving complicated linear system [closed]

I have this system and I would solve it with mathematica, I try with the instruction Solve but I have an error Please help me.
user avatar
  • 1
1 vote
0 answers
29 views

Solve the current equation with respect to one of the coefficients and substitute it into each equation of the system

Good day to all! In this question about recurrence relations, I had a simple case when the k + 1th variable is represented in terms of ...
user avatar
0 votes
0 answers
66 views

Solve coupled differential equation using Matrix

I am a complete beginner to Mathematica. I am trying to solve the following equation: $\frac{d}{dt}\rho_t = -0.5* \eta* \Gamma[\rho_t]$, where $\Gamma[\rho_t]$ is a 4x4 matrix whose coefficients are ...
user avatar
3 votes
1 answer
73 views

Replace previous equations into the current one in a recurrence relation

I have a recurrence relation given as follows: f[k + 1] == 1/a[k, k + 1] Sum[a[k, k - k1] f[k - k1], {k1,0,k-1}] Evaluating it for ...
user avatar

1
2 3 4 5
29