Subspaceprojection¶
- projectOntoSubspace(A, vf, vr, vnet, u, u0, lnx, printLevel, rowBool, colBool)[source]¶
Projects flux, net flux, potential and logarithmic concentration onto their respective subspaces of A using projection matrices generated either derived from SVD, or by using the Moore-Penrose pseudoinverse
Optionally, a subset of the matrix A may be chosen by using A(rowBool,colBool) but then only the true rows of u, u0, lnx, and true columns of vf,vr,vnet are projected and the remaining rows and columns are not affected
Let M denote the Moore-Penrose pseudoinverse of A and the subscripts are the following _R row space, _N nullspace, _C column space, _L left nullspace,
Example for flux of net flux
Let
\[\begin{split}vf &= vf_R + vf_N \\ vf_R &= M A vf = PR vf \\ vf_N &= (I - M A) vf = PN vf\end{split}\]Example for potential or logarithmic concentration
Let
\[\begin{split}u &= u_C + u_L \\ u_C &= A M u = PC u \\ u_L &= (I - A M) u = PL u\end{split}\]- USAGE:
[vfN, vfR, vrN, vrR, vnetN, vnetR, uL, uC, u0L, u0C, lnxL, lnxC] = projectOntoSubspace (A, vf, vr, vnet, u, u0, lnx, printLevel, rowBool, colBool)
- INPUTS:
A – m x n matrix
vf – n x 1 - forward flux
vr – n x 1 - reverse flux
vnet – n x 1 - net flux
u – m x 1 - chemical potential
u0 – m x 1 - standard chemical potential
lnx – m x 1 - logarithmic concentration
- OPTIONAL INPUTS:
printLevel – verbosity level (default 0)
rowBool – m x 1 - boolean indicating the subset of rows of A
colBool – n x 1 - boolean indicating the subset of cols of A
- OUTPUTS:
vfN – forward flux - nullspace
vfR – forward flux - row space
vrN – reverse flux - nullspace
vrR – reverse flux - row space
vnetN – net flux - nullspace
vnetR – net flux - row space
uL – chemical potential - left nullspace
uC – chemical potential - column space
u0L – standard chemical potential - left nullspace
u0C – standard chemical potential - column space
lnxL – logarithmic concentration - left nullspace
lnxC – logarithmic concentration - column space
- projectSVD(U1, u)[source]¶
Assumes that U1 has orthonormal columns so that \(U1 U1^T\) is a projector. It returns the projections
\[\begin{split}u1 &= U1 U1^T u \\ u2 &= (I - U1 U1^T) u\end{split}\]- USAGE:
[u1, u2] = projectSVD (U1, u)
- INPUTS:
U1 – matrix with orthonormal columns, so that U1 U1^T is a projector
u – vector to be projected
- OUTPUTS:
u1 – projection of u onto the range of U1 (U1 U1^T u)
u2 – projection of u onto the orthogonal complement (u - u1)
Example
[U1, D1, V1, r] = subspaceSVD(S); [uC, uL] = projectSVD(U1, u); [vfR, vfN] = projectSVD(V1, vf); [vrR, vrN] = projectSVD(V1, vr);
- subspaceProjector(A, printLevel, sub_space)[source]¶
Returns the matrix for projection onto the subspace of matrix A, specified by sub_space
‘all’
‘R’ row space i.e. range(A’)
‘N’ nullspace i.e. null(A)
‘C’ column space i.e. range(A)
‘L’ left nullspace i.e. null(A’)
Let M denote the Moore-Penrose pseudoinverse of the A and the subscripts are the following _R row space i.e. range(A’) _N nullspace i.e. null(A) _C column space i.e. range(A) _L left nullspace i.e. null(A’)
Let
\[\begin{split}v &= v_R + v_N \\ v_R &= M A v = PR v \\ v_N &= (I - M A) v = PN v\end{split}\]Let
\[\begin{split}u &= u_C + u_L \\ u_C &= A M u = PC u \\ u_L &= (I - A M) u = PL u\end{split}\]Examples:
Given \(A v = b\), then \(v_R = M b\)
Given \(A^Tu = q\), then \(u_C = M^T q\)
- USAGE:
[PR, PN, PC, PL] = subspaceProjector (model, printLevel, sub_space)
- INPUT:
A – m x n matrix
- OPTIONAL INPUTS:
printLevel – {(1), 0}, 1 = print diagnostics, 0 = silent
sub_space – returns projection matrices onto all or one select
sub_space
‘all’
‘R’ row space
‘N’ nullspace
‘C’ column space
‘L’ left nullspace
- OUTPUTS:
PR – matrix for projection onto the row space of A
PN – matrix for projection onto the nullspace of A
PC – matrix for projection onto the column space of A
PL – matrix for projection onto the left nullspace of A
- subspaceSVD(S)[source]¶
Returns quantities satisfying \(S = U1 D1 V1^T\), where U1 and V1 have r orthonormal columns, and D1 is r x r diagonal and has numerical rank r.
The matrix S may be diagonal. Matrices U1 and V1 may be used by projectSVD.m to project given vectors onto certain subspaces.
- USAGE:
[U1, D1, V1, r] = subspaceSVD (S)
- INPUT:
S – matrix
- OUTPUTS:
U1 – matrix with r orthonormal columns
D1 – r x r diagonal matrix of numerical rank r
V1 – matrix with r orthonormal columns
r – numerical rank of D1