I am trying to make a table out of some formulas which I listed in the code section, however, I am having several issues:
*Alignment of rows (I think it has something to do with scientific notation since those values are the only ones not aligned, but I may be mistaken).
*Headers proper alignment, e.g. $N_B$ should span $q_B$ and $\Omega_B$ only
*Frames on all items (I know why the elements in the column of say, $q_A$ are not framed, it is because I declared the whole column as a "single object" so "Frame -> All" framed the whole column, but I don't know how to modify this).
q1 = Column[Table[i, {i, 0, 20}]];
q2 = Column[Reverse[Table[i, {i, 480, 500}]]];
\[CapitalOmega]1[q1_] := (q1 + 1 - 1)!/(q1! (1 - 1)!)
\[CapitalOmega]2[q2_] := (q2 + 100 - 1)!/(q2! (100 - 1)!)
\[CapitalOmega] = Column[Times[Table[\[CapitalOmega]1[q1], {q1, 0, 20}], Reverse[Table[N[\[CapitalOmega]2[q2]], {q2, 480, 500}]]]];
Ln\[CapitalOmega] = Column[Log[Times[Table[\[CapitalOmega]1[q1], {q1, 0, 20}], Reverse[Table[N[\[CapitalOmega]2[q2]], {q2, 480, 500}]]]]];
m1 = Column[Table[ScientificForm[\[CapitalOmega]1[q1]], {q1, 0, 20}]];
m2 = Column[Reverse[Table[ScientificForm[N[\[CapitalOmega]2[q2]]], {q2, 480, 500}]]];
Grid[{{"Two Einstein Solid", SpanFromLeft}, {"\!\(\*SubscriptBox[\(N\), \(A\)]\)=1", SpanFromLeft, "\!\(\*SubscriptBox[\(N\), \(B\)]\)=100", SpanFromLeft}, {"\!\(\*SubscriptBox[\(q\), \(A\)]\)", "\!\(\*SubscriptBox[\(\[CapitalOmega]\), \(A\)]\)", "\!\(\*SubscriptBox[\(q\), \(B\)]\)", "\!\(\*SubscriptBox[\(\[CapitalOmega]\), \(B\)]\)", "\[CapitalOmega]"}, {q1, m1, q2, m2, \[CapitalOmega]}}, Alignment -> {Center, Center}, ItemSize -> {{Scaled[0.05], Scaled[0.05], Scaled[0.05], Scaled[0.1], Scaled[0.1]}}, Spacings -> {2, 2}, Frame -> All]
*Please be as basic as possible and can someone explain each function clearly.
Join[{{"Two Einstein Solid", SpanFromLeft}, {"\!\(\*SubscriptBox[\(N\), \(A\)]\)=1", SpanFromLeft, "\!\(\*SubscriptBox[\(N\), \(B\)]\)=100", SpanFromLeft, ""}, {"\!\(\*SubscriptBox[\(q\), \(A\)]\)", "\!\(\*SubscriptBox[\(\[CapitalOmega]\), \(A\)]\)", "\!\(\*SubscriptBox[\(q\), \(B\)]\)", "\!\(\*SubscriptBox[\(\[CapitalOmega]\), \(B\)]\)", "\[CapitalOmega]"}}, {q1, m1, q2, m2, \[CapitalOmega]} /. Column -> Identity // Transpose]
as the first argument inGrid
? $\endgroup$""
after the lastSpanFromLeft
to"", SpanFromLeft
. $\endgroup${q1, m1, q2, m2, \[CapitalOmega]} /. Column -> Identity
removes theColumn
so that you end up with a matrix with 5 rows and 21 columns;Transpose
converts that 5X21 matrix into a 21X5 matrix.Join
just appends this matrix to your list of header rows. $\endgroup$