Questions tagged [matrix-equations]
This question is about equations where the unknown itself is a matrix such as Sylvester or Riccati equations. For systems of linear equations (where the unknown is a vector), use "linear-system".
54 questions
0
votes
0
answers
65
views
Developing a poisson equation solver for arbitrary input geometry and boundary conditions
I need to develop a Poisson equation solver that can take a input geometry and boundary conditions, produces a FEM mesh, generates the matrices and solve it. Problem is I want a solver that can use ...
1
vote
0
answers
47
views
Boundary Value Problem for an Indeterminate Beam using Finite Difference Method
I hope I am in the right place!
I am trying to solve an indertminate beam using the finite difference method in MATLAB. I am using the fourth order equation to do this:
enter image description here
My ...
1
vote
0
answers
54
views
Linear least squares with selective parameter fitting
Suppose I have a linear model depending on 2 sets of parameters $a,b$
$$
z(t) = \sum_i a_i \Phi_i(t) + \sum_j b_j \Psi_j(t)
$$
Now suppose my data vector $z$ can be naturally divided into 2 sets: $x,y$...
1
vote
0
answers
55
views
Converting an expression into an einsum
I have the following expression that I need to calculate for some matrices:
$$
\sum_{k}c_{t,i,k}\sigma^\prime\left(w_tX_t+b_t\right)_k\left(\sum_\ell w_{t,k,\ell}\tilde{X}_t^{w,\ell}\right)
$$
I could,...
1
vote
0
answers
62
views
SVD decomposition and the update problem of matrix differential equations
For a matrix $Y(t) \in \mathbb{R}^{m \times n}$, its rank-r approximation could be represented in a factorized SVD-like form.
$$
Y(t) = U(t) S(t) V^T(t),
$$
where $U^{T}U = I_m$, $V^{T}V = I_n$ and $S ...
2
votes
2
answers
194
views
Confusion about matrix differentiation in a nonlinear matrix equation
I am trying to solve a matrix equation in the following discrete form:
$$
\frac{K^{n+1}-K^n}{\Delta t} = [(K^{n+1} (V^{n})^T).^3 - K^{n+1} (V^{n})^T]V^n.
$$
where $K^{n+1} \in \mathbb{R}^{m \times r}, ...
3
votes
1
answer
118
views
Solving for $X$ in $\sum_{a,b} b a^T b^T X a = Y$
Suppose I have $k$ pairs of $(a,b)$ where $a$ and $b$ are vectors in $\mathbb{R}^d$, $Y$ is $d\times d$ and I need least squares solution for $X$ in the following
$$\sum_{(a,b)}^k b a^T (b^T X a) = Y$...
3
votes
1
answer
188
views
Solving underdetermined Lyapunov equation?
I'm solving the following for $X$ with $A,B$ singular positive semidefinite matrices.
$$AX + XA = B$$
Because $A$, $B$ are singular, standard Lyapunov solver fails
However, if I heuristically skip ...
0
votes
0
answers
108
views
What is the difference between approximations of mixed derivative and how to implement it
currently I am solving 2D nonlinear second order differential equation containing mixed derivative. I started searching how to descretisize it and found two formulas for 4th order approximation. First ...
2
votes
1
answer
101
views
Solve linear system for only part of the solution vector
I am using the ScaLAPACK PDGESV routine to solve large dense linear systems distributed over many supercomputer nodes, but ultimately I only need a small portion of the solution vector (e.g. the first ...
0
votes
1
answer
99
views
Is it possible to express the solution of a matrix Riccati differential equation as an eigenvalue problem?
This is related to my previous question How can I express the solution to a discrete Lyapunov equation as an eigenvalue problem?.
Given the algebraic Riccati equation (ARE) $$A^T X + XA + XRX + Q = 0$$...
4
votes
5
answers
673
views
Matrix derivative
I am looking to compute the derivative of the following expression:
$$\frac{\partial}{\partial X}\mathrm{tr}\left[A\exp(X)\right]$$
where $A$ is both a symmetrical and positive-definite matrix and $X$ ...
2
votes
2
answers
278
views
How can I express the solution to a discrete Lyapunov equation as an eigenvalue problem?
Given the discrete Lyapunov equation $$AXA^T - X + Q = 0$$ how can I solve for $X$ as a function of the eigenvectors of some matrix $H$?
More precisely, in the case of the continuous Lyapunov equation ...
1
vote
1
answer
189
views
How can I find the eigenvectors of a Hamiltonian matrix to solve a Riccati equation?
Given the Algebratic Riccati Equation (ARE) $$A^T X + XA + XRX + Q = 0$$ where $A,R,Q \in \mathbb R^{n \times n}$, we are interested in the matrix $X$ that solves this equation. If we define the $2n \...
0
votes
1
answer
76
views
Solution $X$ for $X(X^TX)^{-1}=X(Y^TY)^{-1}$
I have a square matrix $Y$ and I would like to find the solution $X$ for the following equation:
$$X(X^TX)^{-1}=X(Y^TY)^{-1}$$
In this equation, we can suppose that $Y^TY$ is invertible. We could also ...
1
vote
2
answers
549
views
Solution to Sylvester-like equation
I have an equation that is a bit similar to a Sylvester equation.
The equations is $AXB^T+X=E$, where all variables are matrices.
I could try to inverse $B$ and rewrite the equation as $AX+XB^{-T}=EB^{...
1
vote
0
answers
40
views
Solution to minimization problem when variables factor in 2 analytical problems
I am asking a follow up question to this question, but I could probably have written it as an answer instead. However, I don't know if what I am doing here makes sense or is too complicated for my ...
2
votes
1
answer
662
views
Matrix regularisation for ill-conditioned problems
I have read that matrix regularisation can improve the stability of LU or Cholesky decomposition of ill conditioned problems. The idea is to add a value to the diagonals of a matrix:
$B=A+cI$
In the ...
2
votes
1
answer
116
views
Iterative solution for a minimization problem involving matrix equations
I have a real valued function $F$ for which I am looking to find its global minimum. The function is well behaved and I can obtain its Jacobian. I could also compute the Hessian but the function ...
3
votes
0
answers
61
views
Finite difference on matrices
This question relates closely to another question I asked earlier this week.
Let's say that I want to find a set of matrices $S_i$, with $0\leq i\leq N$, that minimizes some objective function with ...
5
votes
2
answers
519
views
Recurrence relation for matrices
I have matrices ($S_0$ thought $S_N$) and I have a recurrence relation that link successive matrices together.
$$S_i + S_i(aS_{i-1}^{-1})S_i=C_i+aS_{i+1}$$
We can assume for this problem that $S_0=S_N=...
1
vote
0
answers
94
views
Constrained optimization for non-linear equations in octaveGNU
I have installed Optim1.6.1 package. I would like to solve a system of equations in non linear finite element analysis using constraints as u=1 at certain nodes. u=0 at certain nodes. Typically I find ...
1
vote
1
answer
632
views
MATLAB : find an algorithm to inverse quickly a large matrix of symbolic variables
I have to solve the equality between 2 matrixes 12x12 containing a lot of symbolic variables and with which I perform inversion of matrix. There is only one unknown called "...
0
votes
1
answer
458
views
Implementing Dirichlet BC for the Advection-Diffusion equation using a second-order Upwind Scheme finite difference discretization
i am implementing a Matlab code to solve the following equation numerically :
$$
(\frac{\partial c}{\partial t} =-D_{e} \frac{\partial^2 c}{\partial z^2} +U_{z}\frac{\partial c}{\partial z})
$$
with ...
5
votes
1
answer
133
views
Solving $AX+X^TB=C$?
Is there a name/standard algorithm to solve the following equation for $X$?
$AX+X^TB=C$
Matrices $A$,$B$,$C$ are dense, diagonalizable, nearly singular, about $1000\times 1000$ in size. I've looked ...
1
vote
0
answers
27
views
Multiplying by E[xy'] where only some statistics of xy' are known
(cross-posted on crossvalidated)
For random variable $(x,y)$ in $\mathbb{R}^{d}\times \mathbb{R}^{d}$ and vector $v \in \mathbb{R}^d$, I need to perform the following matrix vector multiplication.
$$T(...
2
votes
1
answer
54
views
Solving MX=N where M is structured as a Gaussian 4th-moment tensor
I'm looking to solve numerically the following equation for $(d,d)$ variable $X$, in Einstein summation notation
$$M_{ijkl}X_{kl}=N_{ij}$$
Where $M$ is a $(d,d,d,d)$ 4th-moment tensor of random ...
1
vote
0
answers
59
views
Assume $AX = C$. How to determine which entry of $BX - D$ is non-negative?
Let $A,B$ be $n \times n$ matrices and $C,D$ be $n \times 1$ matrices. Moreover, all entries of $A,B,C,D$ are non-negative. Assume that there is a unique matrix $X$ that solves $AX = C$.
My goal is ...
-1
votes
1
answer
169
views
Finding derivative of Matrix at different grid points using Finite difference methods/ Cholesky Factorization
I want to code this problem in MATLAB. It would be a huge help if someone can suggest to me how I can approach it.
I need to solve the below-highlighted equation, I need ...
1
vote
0
answers
278
views
implementation for coppersmith matrix multiplication
Is there any online implementation for the coppersmith matrix multiplication I have searched alot but can not find any? and if there is not any why is that Isn't this algotithm much faster than ...
5
votes
1
answer
246
views
Solving $AXB + X\odot C = D$ matrix equation
Can anyone see a way to solve this equation efficiently?
$$AXB + X\odot C = D$$
I tried a straightforward solution that involved vectorizing $X$ but that turned out too expensive for my application -...
5
votes
3
answers
799
views
Maximize a function of an orthogonal matrix
I'm trying to write up a small code that, given a set of normal vibrational modes for a molecule, will convert them to localized vibrational modes. To do this I'm following the procedure from J. Chem. ...
8
votes
1
answer
200
views
Eigenvalue-like problem with coupled ODEs
I am looking at the following system of ODEs:
\begin{array}{r}{\left[c_{2}(k)-\partial_{\tau}^{2}\right] \varphi_{2}\left(\tau \right)=f_{21}(\tau) \varphi_{1}\left(\tau \right)} \\
{\left[c_{1}(k)-...
4
votes
1
answer
909
views
Mass Matrix and how to handle it (ODEs) - References
I'm interested in a good reference/paper about how to handle numerically a mass-matrix system as
\begin{align}
\mathbf{M}(t,y)\dot{y} =F(y,t)
\end{align}
I know that such a problem can be solved by ...
1
vote
1
answer
365
views
Solving linear system with matrix multiplication
When solving a linear system $Ax=b$ where $A=B^TCB$ do I need to form $A$ explicitly by two matrix-matrix multiplications or is there another more simple way?
$C$ is a NxN matrix and not always ...
2
votes
1
answer
341
views
Finding probability vectors from an implicit equation
I have $q$ $n$-dimensional vectors $\vec y_i$ and a matrix $\hat B$ of shape $n\times m$. I'm looking for $q$ $m$-dimensional vectors $\vec x_i$ such that:
$\vec y_i=\hat B \vec x_i$
each vector $\...
6
votes
1
answer
183
views
Generate approximately semi-orthogonal tall matrix approximately satisfying constraints
I have a set of matrices $\{(A_i,D_i)\}$ for $i\in\{1,\ldots,n\}$, where:
Each $D_j\in\mathbb{R}^{S\times S}$ is diagonal, and every entry on the main diagonal is non-negative.
Each $A_j\in\mathbb{R}^...
7
votes
1
answer
393
views
Least Squares with Dense-Block Diagonal Structure
I need to solve a least squares problem that takes the following form:
$$p = \arg \min_{x}\Vert J V x - y \Vert_2, $$
where $J \in \mathbb{R}^{N \times N}$ is a general dense matrix, and $V \in \...
4
votes
1
answer
543
views
How to solve the following Frobenius norm-minimization problem?
Background
We know how to solve the following minimization problem
$$
\min_{X} \lVert AX - B \rVert_F^2
$$
But what about the extended version?
$$
\min_{X} \lVert A
\begin{bmatrix}
X & X^2
\...
-1
votes
1
answer
500
views
Gauss-Seidel method convergence
I am currently programming a code to find the equilibrium function that satisfies the poisson equation in 2D. In order to do this I use finite difference methods and the discrete equation I want to ...
1
vote
1
answer
121
views
Invert a matrix only on a subset of variables / Compute the "equivalent circuit"
Suppose I have a complicatedly shaped conductor with inhomogeneous conductivity. The conductor is modeled using the Finite Element Method. The conductor has electrical contacts on both ends. Those ...
5
votes
2
answers
672
views
Compute $x = B^{-1}(2A+I)(C^{-1}+A)b$ without calculating matrix inverses
If $A, B, C$ are $n \times n$ matrices, where both $B$ and $C$ are nonsingular, and $b$ is a vector of length $n$, how would you compute the following without computing any inverses?
$$x = B^{-1}(2A+...
3
votes
0
answers
135
views
Computing Algebraic Riccati inequality
In my Robust model control, I have got a couple of quadratic Riccati inequalities which need to be solved numerically on MATLAB. My question, Is there function on MATLAB can solve quadratic Riccati ...
9
votes
1
answer
920
views
Matrix Balancing Algorithm
I have been writing a control system toolbox from scratch and purely in Python3 (shameless plug : harold ). From my past research, I have always complaints about ...
2
votes
1
answer
139
views
Solving system of related equations without completely recomputing LU decomposition for each equation
Let $\Sigma$ be positive definite and the $D_i$ positive diagonal. Let the $X_i$ be unknown square matrices. Consider the system of equations:
$$(I+\Sigma D_i)X_i=\Sigma\hspace{5mm}\text{for}\...
2
votes
3
answers
323
views
Eigenvectors of Black-box matrix
$\DeclareMathOperator{\diag}{diag}$
Consider the generalized eigenproblem $A\mathbf{x}=\lambda B\mathbf{x}$. When solving PDEs numerically (specifically, I am interested on finding the Dirichlet ...
3
votes
1
answer
432
views
Convergence conditions of a stationary iteration method for linear systems
Recently, I obtain a linear system, $Ax = b$, where $A$ is a nonsingular, strictly diagonally dominant $M$-matrix. Then I also got a matrix splitting $A = S - T$, where $S$ is also a nonsingular, ...
10
votes
1
answer
1k
views
The fast, and The Backward-Stable (left) $3\times 3$ matrix inverse
I need to compute a lot of $3\times3$ matrix inverses (for Newton iteration polar decomposition), with very small number of degenerate cases ($<0.1\%$).
Explicit inverse (via matrix minors divided ...
2
votes
2
answers
715
views
Solve $AX=B$ where $A$ is a skyline matrix
Solve a matrix equation of the type $AX=B$, where $A$ is an $n \times n$ symmetric matrix stored in the form of symmetric skyline matrix.
With the solution given by Bill and some more research on ...
3
votes
0
answers
480
views
On solution of a class of discrete-time Lyapunov equation for systems with multiplicaitve noise
Let's consider the following equation
$$X=F_{1}XF_{1}^{T}+...+F_{p}XF_{p}^{T}+C$$
where $p$ is an positive integer and $C$ is a known positive semidefinite matrix. If we augment $F=[F_{1}...F_{p}]$ ...