PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Untermatrix farblich kennzeichen !?



fünfhaus
09-04-2014, 16:45
Hallo,

wie kann man in einem Eigenwertproblem Untermatrizen kennzeichnen? Unten ein Minimalbsp.. Der rote Block in der unteren Matrix soll in den beide oberen Matrizen entsprechend eingebaut werden:



\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{arrows,matrix,positioning}
\begin{document}
%
%
\begin{align*}
\label{eq:zeitlicheStabiBlasiusEigenwerte}
\left[
\left(
\begin{array}{ccccc}
a_{11} & a_{12} & \cdots & a_{1N} \\
a_{21} & a^2_{22} & \cdots & a^2_{2N} \\
a_{31} & a^3_{32} & \cdots & a^3_{3N} \\
\vdots & \vdots & \ddots & \vdots \\
a_{N1} & a_{N2} & \cdots & a_{NN} \\
\end{array}
\right)
%
- \omega
\left(
\begin{array}{cccc}
b_{11} & b_{12} & \cdots & b_{1N} \\
b_{21} & b_{22} & \cdots & b_{2N} \\
b^2_{31}& b^2_{32} & \cdots & b^2_{3N} \\
\vdots & \ddot & & \vdots \\
b_{N1} & b_{N2} & \cdots & b_{NN} \\
\end{array}
\right)
\right]
\begin{pmatrix}
x_1 \\
\vdots \\
x_N
\end{pmatrix}
&=
\begin{pmatrix}
0 \\
\vdots \\
0
\end{pmatrix}
\end{align*}
%
%
\begin{tikzpicture}
\matrix [matrix of math nodes,left delimiter=(,right delimiter=)](m){
a^2_{11} & a_{12} & \cdots & a^2_{1N} \\
a_{21} & a^2_{22} & \cdots & a^3_{2N} \\
\vdots & \vdots & \ddots & \vdots \\
a_{N1} & a_{N2} & \cdots & a_{NN} \\
};
\draw[color=red]
(m-2-2.north west) -- (m-2-4.north east) --
(m-4-4.south east) -- (m-4-2.south west) --
(m-2-2.north west);
\end{tikzpicture}
%
%
\end{document}


Vielleicht hab ich was an den Augen, aber der rote Block ist doch ein Trapez, oder? Also das Ding ist doch total schief :confused: Oder macht man das mit einem ganz andern Paket?

Gruß, fünfhaus

hakaze
09-04-2014, 17:42
Vielleicht hab ich was an den Augen, aber der rote Block ist doch ein Trapez, oder? Also das Ding ist doch total schief :confused: Oder macht man das mit einem ganz andern Paket?

Du schaust nicht schief ;), die nodes sind lediglich unterschiedlich groß. Das kannst du vermeiden, indem du ein feste Breite vorgibst:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}

\begin{document}

\begin{tikzpicture}
\matrix [matrix of math nodes,nodes={text width=6mm},%
left delimiter=(,right delimiter=)](m){
a^2_{11} & a_{12} & \cdots & a^2_{1N} \\
a_{21} & a^2_{22} & \cdots & a^3_{2N} \\
\vdots & \vdots & \ddots & \vdots \\
a_{N1} & a_{N2} & \cdots & a_{NN} \\
};
\draw[color=red]
(m-2-2.north west) -- (m-2-4.north east) --
(m-4-4.south east) -- (m-4-2.south west) --
(m-2-2.north west);
\end{tikzpicture}

\end{document}

fünfhaus
10-04-2014, 09:31
Ok, danke erstmal. Hier nochmal ein Minimalbsp.:



\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{arrows,matrix,positioning}
\begin{document}
%
%
\begin{tikzpicture}
\matrix [matrix of math nodes,,nodes={text width=6mm},left delimiter=(,right delimiter=)](m){
a^2_{11} & a_{12} & \cdots & a^2_{1N} \\
a_{21} & a^2_{22} & \cdots & a^3_{2N} \\
\vdots & \vdots & \ddots & \vdots \\
a_{N1} & a_{N2} & \cdots & a_{NN} \\
};
\draw[color=red]
(m-2-2.north west) -- (m-2-4.north east) --
(m-4-4.south east) -- (m-4-2.south west) --
(m-2-2.north west);
\end{tikzpicture}
%
%
-$\omega$
\begin{tikzpicture}
\matrix [matrix of math nodes,,nodes={text width=6mm},left delimiter=(,right delimiter=)](m){
b^2_{11} & b_{12} & \cdots & b^2_{1N} \\
b_{21} & b^2_{22} & \cdots & b^3_{2N} \\
\vdots & \vdots & \ddots & \vdots \\
b_{N1} & b_{N2} & \cdots & b_{NN} \\
};
\draw[color=red]
(m-2-2.north west) -- (m-2-4.north east) --
(m-4-4.south east) -- (m-4-2.south west) --
(m-2-2.north west);
\end{tikzpicture}
%
%
\end{document}


Wie könnte man die ganze Gleichung darstellen? Ich komm leider mit google nicht weiter. Im Minimalbsp. sind die \vdots nicht zentral und unter der zweiten Zeile ist zuviel weiß. Da stimmen irgendwie die Abstände nicht. Vielleicht sollte ich es einfach so belassen:



\begin{align}
\setlength\extrarowheight{3pt}
\left[
\left(
\begin{array}{c|cccc}
a_{11} & a_{12} & \cdots & a_{1N} \\
\hline
a^2_{11} & a^2_{12} & \cdots & a^1_{1N} \\
a_{31} & a_{32} & \cdots & a_{3N} \\
\vdots & \vdots & \ddots & \vdots \\
a_{N1} & a_{N2} & \cdots & a_{NN} \\
\end{array}
\right)
%
- \omega
\left(
\begin{array}{c|ccc}
b_{11} & b_{12} & \cdots & b_{1N} \\
\hline
b^2_{11} & b^2_{12} & \cdots & b^2_{1N} \\
b_{31} & b_{32} & \cdots & b_{3N} \\
\vdots & \vdots & \ddots & \vdots \\
b_{N1} & b_{N2} & \cdots & b_{NN} \\
\end{array}
\right)
\right]
\begin{pmatrix}
x_1 \\
\vdots \\
x_N
\end{pmatrix}
=
\begin{pmatrix}
0 \\
\vdots \\
0
\end{pmatrix}
\end{align}


Frage: Ist das \setlength\extrarowheight{3pt} die einzige Möglichkeit, den Abstand der hline und den Matrixeinträgen der zweiten Zeile hinzukriegen?

Gruß, fünfhaus