Mathematica Asked on January 28, 2021
I have a $300times300$ symbolic matrix and I want to calculate its inverse matrix. It has been two days and Mathematica is still executing Inverse[T]. $T$ is the name of that matrix.
Why am I calculating inverse?
Actually, $G=Inverse[T]$ is a Green’s function. After calculating this Green’s function I want to use $NIntegrate[ Tr[G.(some:other:matrices)] ]$ function to calculate a 3D integral.
In MATLAB, taking an inverse was not a problem because MATLAB’s $integral3()$ function does not need to calculate the inverse of the symbolic matrix.
My question is, is there any way to use $NIntegrate[]$ such that I don’t have to calculate the inverse of the symbolic matrix (the way MATLAB’s integral3() works). Or is there any other way to solve the integration that I am trying to solve?
EDIT:
Here is my full code: $k1$ is the parameter over which I want to integrate.
N2 = 100; (* a parameter that controls the size of the final symbolic matrix that I want to inverse*)
(* set-up for writing the symbolic matrix. DbyJ,omega, eta, T and delta are parameters that I wish to change while integration*)
Q = 1 + DbyJ*1 I;
fk1 = 1 + Exp[1 I*k1];
Cfk1 = 1 + Exp[-1 I*k1];
Hch = {{4*delta, -Q*Cfk1, -Conjugate[Q]}, {-Conjugate[Q]*fk1,
4*delta, -Q}, {-Q, -Conjugate[Q], 4*delta}};
tau = {{0, 0, -Conjugate[Q]}, {0, 0, -Q*Exp[-1 I*k1]}, {0, 0, 0}};
CTtau = {{0, 0, 0}, {0, 0, 0}, {-Q, -Conjugate[Q]*Exp[1 I*k1], 0}};
(*300x300 matrix:*)
H0 = KroneckerProduct[IdentityMatrix[N2], Hch] +
KroneckerProduct[DiagonalMatrix[ConstantArray[1, N2 - 1], 1],
tau] + KroneckerProduct[
DiagonalMatrix[ConstantArray[1, N2 - 1], -1], CTtau];
H0[[1, 1]] = H0[[1, 1]] - delta;
H0[[3*N2, 3*N2]] = H0[[3*N2, 3*N2]] - delta;
vx = D[H0, k1];
I3N2 = IdentityMatrix[3*N2];
ToInv = FullSimplify[(omega - 1I*eta)*I3N2 - H0];
(*taking inverse*)
GR = Inverse[ToInv]; (*Please note that I refered ToInv matrix as T in my question above.*)
GA = Conjugate[GR];
G = GR - GA;
(*---------------------Integration----------------------*)
(*parameters*)
DbyJ = 2/Sqrt[3];
delta = 2;
eta = 1*10^-2;
T = 10;
omega = 9.5;
Nchain = 1; (* nth chain *)
(* some other terms in integrant *)
OO1 = ConstantArray[0, {3*N2, 3*N2}];
tt = 3*(Nchain - 1) + 1;
OO1[[tt, tt]] = 0;
OO1[[tt + 1, tt + 1]] = 0;
OO1[[tt + 2, tt + 2]] = 1;
const = 1/T;
b = 1/(kB*T);
omegadn = -(b*(omega)/4)/(Sinh[b*(omega)/2]^2);
Term1 = OO1.G.vx.G;
trc1 = Tr[Term1];
out1 = const*trc1*omegadn;
answer1 = NIntegrate[out1, {k1, -Pi, Pi}, Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> MaxItr}]
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP