-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmat.tex
168 lines (158 loc) · 4.23 KB
/
tmat.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
\documentclass[12pt,a4paper]{article}
\usepackage{fullpage}
\usepackage{tmat}
\usepackage{subfig}
\newlength{\pwidth}
\setlength{\pwidth}{8cm}
\begin{document}
\title{tmat.sty -- tensor matrix-representations}
\author{Einar Halvorrsen}
\maketitle
This package helps visualizing the structure of matrices representing tensors. It requires the tikz package. The package provides an environment \textit{tmat} which takes two parameters, the dimensions of the matrix. The environment requires math mode. Inside the environment a sequence of commands can be given. The available commands are listed in table \ref{tab:elements}. They either define a symbol to appear at the location specified by the parameter of the command or a link between two elements. If no symbol is defined for an element, the default, a small dot, is shown. This would define a zero value in the usual use of the notation.
\begin{table}[hbt]
\centering
\caption{Elements available, notation and usual interpretation}
\label{tab:elements}
\begin{tabular}{cll}
\hline\hline
Symbol & Command & Interpretation \\
\hline
\begin{tikzpicture}
\node [tkz] (0,0) {};
\end{tikzpicture}
& & a component that is zero
\\
\begin{tikzpicture}
\tmatpv{0}{0}
\end{tikzpicture}
& \verb|\tmatpv{M}{N}| & element (M,N) that is nonzero
\\
\begin{tikzpicture}
\tmatpn{0}{0}
\end{tikzpicture}
& \verb|\tmatpn{M}{N}|&
\parbox[t]{\pwidth}{
element (M,N) has sign opposite to the one it is connected to}
\\
\begin{tikzpicture}
\tmatpdv{0}{0}
\end{tikzpicture}
&\verb|\tmatpdv{M}{N}| &
\parbox[t]{\pwidth}{
element (M,N) has twice the value of the solid-circle component it is connected to}
\\
\begin{tikzpicture}
\tmatpdn{0}{0}
\end{tikzpicture}
& \verb|\tmatpdn{M}{N}| &
\parbox[t]{\pwidth}{
element (M,N) has minus twice the value of the solid-circle component it is connected to}
\\
\begin{tikzpicture}
\tmatpx{0}{0}
\end{tikzpicture}
& \verb|\tmatpx{M}{N}| &
\parbox[t]{\pwidth}{
element (M,N) is given by other elements}
\\
\begin{tikzpicture}
\draw[line width=1pt,line cap=round,fill=black] (-0.5\tmatds,.5\tmatds) -- (0.5\tmatds,0);
\end{tikzpicture}
& \verb|\tmatlink{M N}{P Q}| &
\parbox[t]{\pwidth}{connection between elements (M,N) and (P,Q) with related values}
\\ \vspace{-1.5ex}\\ \hline
\end{tabular}
\end{table}
Examples of typical use are provided by the matrices given in figure \ref{fig:matex}.
\begin{figure}[h]
\centering
\subfloat[]{
\label{fig:matexa}
$\begin{tmat}{6}{6}
\tmatpv{1}{1}
\tmatpv{1}{2}
\tmatpv{1}{3}
\tmatpv{1}{4}
\tmatpv{2}{1}
\tmatpv{2}{2}
\tmatpv{2}{3}
\tmatpn{2}{4}
\tmatpv{3}{1}
\tmatpv{3}{2}
\tmatpv{3}{3}
\tmatpv{4}{1}
\tmatpn{4}{2}
\tmatpv{4}{4}
\tmatpv{5}{5}
\tmatpx{6}{6}
\tmatpdv{6}{5}
\tmatpdv{5}{6}
\tmatlink{1 1}{2 2}
\tmatlink{1 3}{2 3}
\tmatlink{1 4}{2 4}
\tmatlink{2 4}{5 6}
\tmatlink{3 1}{3 2}
\tmatlink{4 1}{4 2}
\tmatlink{4 2}{6 5}
\tmatlink{4 4}{5 5}
\end{tmat}$
}
\hspace{2cm}
\subfloat[]{
$\begin{tmat}{3}{3}
\tmatpv{1}{1}
\tmatpv{2}{2}
\tmatpv{3}{3}
\tmatlink{1 1}{2 2}
\end{tmat}$
}
\hspace{2cm}
\subfloat[]{
$\begin{tmat}{3}{6}
\tmatpv{1}{1}
\tmatpn{1}{2}
\tmatpv{1}{4}
\tmatpn{2}{5}
\tmatpdn{2}{6}
\tmatlink{1 1}{1 2}
\tmatlink{1 2}{2 6}
\tmatlink{1 4}{2 5}
\end{tmat}$
}
\caption{Matrices for a material of with class-32 symmetry. (a) $S^E$, $S^D$. (b) $\kappa^\epsilon$, $\kappa^\sigma$, $\beta^\epsilon$, $\beta^\sigma$. (c) $d$.}
\label{fig:matex}
\end{figure}
\newpage
As an example of use, the code producing the matrix in figure \ref{fig:matexa}
is:
\begin{verbatim}
\begin{tmat}{6}{6}
\tmatpv{1}{1}
\tmatpv{1}{2}
\tmatpv{1}{3}
\tmatpv{1}{4}
\tmatpv{2}{1}
\tmatpv{2}{2}
\tmatpv{2}{3}
\tmatpn{2}{4}
\tmatpv{3}{1}
\tmatpv{3}{2}
\tmatpv{3}{3}
\tmatpv{4}{1}
\tmatpn{4}{2}
\tmatpv{4}{4}
\tmatpv{5}{5}
\tmatpx{6}{6}
\tmatpdv{6}{5}
\tmatpdv{5}{6}
\tmatlink{1 1}{2 2}
\tmatlink{1 3}{2 3}
\tmatlink{1 4}{2 4}
\tmatlink{2 4}{5 6}
\tmatlink{3 1}{3 2}
\tmatlink{4 1}{4 2}
\tmatlink{4 2}{6 5}
\tmatlink{4 4}{5 5}
\end{tmat}
\end{verbatim}
\end{document}