I'm trying to make a program that gives an output in matrix format 2 columns but the rows depends on one of the input numbers. here is a copy of my code and In essence I'm trying to make column 1 my Eprime from 1/27210 until it reaches V1prime and column to the calculations giving real(T). I hope this makes sense if not please let me know. Thanks.
complex<double> m8[2][2] = {{ exp(complex<double>(k5 * (w + a + b) * i)), 0} , {0, exp(complex<double>(k5 * (w + a + b) * -i))}};
int (n);
int (j);
int (k);
complex<double> sum = complex<double>(0.0);
for (n=1; n<3; n++)
for (j=1; j<3; j++)
{
//complex<double> (sum) = complex<double> (0);
sum = 0.0;
for (k=1; k<3; k++)
//complex<double> (sum) = complex<double> (sum) + complex<double> (m1[n][k]*m2[k][j]);
sum = sum + m1[n][k]*m2[k][j];
}
complex<double> C[2][2] = { sum };
for (n=1; n<3; n++)
for (j=1; j<3; j++)
{
complex<double> (sum) = 0;
for (k=1; k<3; k++)
sum = sum + C[n][k]*m3[k][j];
}
complex<double> D[2][2] = { sum };
for (n=1; n<3; n++)
for (j=1; j<3; j++)
{
sum = 0;
for (k=1; k<3; k++)
sum = sum + D[n][k]*m4[k][j];
}
complex<double> E[2][2] = { sum };
for (n=1; n<3; n++)
for (j=1; j<3; j++)
{
sum = 0;
for (k=1; k<3; k++)
sum = sum + E[n][k]*m5[k][j];
}
complex<double> F[2][2] = { sum };
for (n=1; n<3; n++)
for (j=1; j<3; j++)
{
sum = 0;
for (k=1; k<3; k++)
sum = sum + F[n][k]*m6[k][j];
}
complex<double> G[2][2] = { sum };
for (n=1; n<3; n++)
for (j=1; j<3; j++)
{
sum = 0;
for (k=1; k<3; k++)
sum = sum + G[n][k]*m7[k][j];
}
complex<double> H[2][2] = { sum };
for (n=1; n<3; n++)
for (j=1; j<3; j++)
{
sum = 0;
for (k=1; k<3; k++)
sum = sum + H[n][k]*m8[k][j];
}
complex<double> mt[2][2] = { sum };
//cout << "\nTranmission matrix position 1,1 is: " << real(mt[0][0]) << endl;
cout << mt[2][2];
complex<double> T = (k5/k1) * 1/(real(mt[0][0]) * real(mt[0][0]));
You want the output to be a matrix with 2 columns.... and n rows (n \in 1,
You're obviously trying to discretely solve a quantum well with finite barriers... But what matrix is that?? (sorry didn't have time to go through all of your code (which is a lot btw))... What exactly does it describe....