Continous Mechanics: add HW1

Change-Id: Iacb207a35af24127402cb2afa08faa61a18c9ef5
diff --git a/.gitignore b/.gitignore
index e43b0f9..cb3bd63 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,16 @@
+# Tex files
+*.aux
+*.fdb_latexmk
+*.fls
+*.log
+*.out
+*.synctex.gz
+*.bbl
+*.blg
+
+# Bibtex-specific files
+*.bcf
+*.run.xml
+
+# Irrelvevant Mac files
 .DS_Store
diff --git a/quad8/continuummechanics/homework/hw1/main.pdf b/quad8/continuummechanics/homework/hw1/main.pdf
new file mode 100644
index 0000000..9d82cd6
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw1/main.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw1/main.tex b/quad8/continuummechanics/homework/hw1/main.tex
new file mode 100644
index 0000000..f8df2db
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw1/main.tex
@@ -0,0 +1,287 @@
+\documentclass[11pt,a4paper,dvipsnames]{article}
+\usepackage[utf8]{inputenc}
+\usepackage{lmodern}
+\usepackage{amsmath}
+\usepackage{amsfonts}
+\usepackage{amssymb}
+\usepackage{mathtools}
+\usepackage{parskip}
+\usepackage{xcolor}
+\usepackage{tcolorbox}
+\usepackage{hyperref}
+\usepackage{geometry}
+\usepackage{physics}
+\usepackage{systeme,mathtools}
+\usepackage[usestackEOL]{stackengine}
+\usepackage{scalerel}
+\usepackage{graphicx}
+\usepackage{enumerate}
+\usepackage{tikz}
+\usepackage[labelfont=bf]{caption}
+\usepackage{siunitx}
+\usepackage{cancel}
+\usepackage{fbox}
+\usepackage{multicol}
+\usepackage{amsthm}
+\usepackage[shortlabels]{enumitem}
+\usetikzlibrary{positioning}
+\geometry{top=25mm}
+
+% Plantilla per l'interior d'un conjunt
+\newcommand{\interior}[1]{%
+  {\kern0pt#1}^{\mathrm{o}}%
+}
+
+% Plantilles del notate
+\def\myupbracefill#1{\rotatebox{90}{\stretchto{\{}{#1}}}
+\def\rlwd{.5pt}
+\newcommand\notate[4][B]{%
+  \if B#1\else\def\myupbracefill##1{}\fi%
+  \def\useanchorwidth{T}%
+  \setbox0=\hbox{$\displaystyle#2$}%
+  \def\stackalignment{c}\stackunder[-6pt]{%
+    \def\stackalignment{c}\stackunder[-1.5pt]{%
+      \stackunder[2pt]{\strut $\displaystyle#2$}{\myupbracefill{\wd0}}}{%
+    \rule{\rlwd}{#3\baselineskip}}}{%
+  \strut\kern9pt$\rightarrow$\smash{\rlap{$~#4$}}}%
+}
+
+% Plantilles dels boxes
+%%%% START DEFINING LBOXED, RBOXED %%%%
+\newcommand{\lboxed}[1]{\fbox[blt]{\mathsurround=0pt$\displaystyle#1$}}
+\newcommand{\rboxed}[1]{\fbox[brt]{\mathsurround=0pt$\displaystyle#1$}}
+
+% Plantilles pels problemes
+\newcounter{problem}
+\newcounter{solution}
+
+\newcommand{\green}[1]{\textbf{\color{ForestGreen} #1}}
+
+\newcommand{\separator}{\noindent\hfil\rule{0.75\textwidth}{0.4pt}\hfil}
+
+\newenvironment{Problem}{%
+    \stepcounter{problem}%
+    \begin{tcolorbox}[colback=cyan!10!white,parbox=false]
+        \textbf{Problem \theproblem.}~%
+        \setcounter{solution}{0}}{%
+    \end{tcolorbox}
+}
+
+\newenvironment{FreeProblem}{%
+    \begin{tcolorbox}[colback=cyan!10!white,parbox=false]
+        \setcounter{solution}{0}}{%
+    \end{tcolorbox}
+}
+
+\newcommand\Solution{%
+    \textbf{Solution:}\\%
+}
+
+\newcommand\Context{%
+    \textbf{Context:}\\%
+}
+
+\newcommand\Lema{%
+    \textbf{Lema:} %
+}
+
+\newcommand\Proposition{%
+    \textbf{Proposition:} %
+}
+
+\newcommand\Theorem{%
+    \textbf{Theorem:} %
+}
+
+\newcommand\Proof{%
+    \textbf{Proof:}\\%
+}
+
+\newcommand\QED{\square}
+
+\newcommand\ASolution{%
+    \stepcounter{solution}%
+    \textbf{Solution \thesolution:}\\%
+}
+
+
+\newcommand{\asection}[2]{
+\setcounter{section}{#1}
+\addtocounter{section}{-1}
+\section{#2}
+}
+
+% Tensor commands:
+\newcommand*{\TT}[1]{\bar{\bar{#1}}}
+
+\usepackage{biblatex}
+\addbibresource{references.bib}
+
+\title{Homework 1\\Continuum Mechanics}
+\author{Adrià Vilanova Martínez}
+\date{March 20, 2021}
+
+\begin{document}
+
+\maketitle
+
+\begin{Problem}
+  Consider a passive rotation in 2D -a rotation of rectangular axis with common origin.
+
+  \begin{enumerate}[a)]
+      \item Show that the components of vector $A$ transform according to: \[ \begin{pmatrix}
+      a_1 \\
+      a_2
+    \end{pmatrix} = \begin{pmatrix}
+      \cos \theta & - \sin \theta \\
+      \sin \theta & \cos \theta
+    \end{pmatrix} \begin{pmatrix}
+      a_1' \\
+      a_2'
+    \end{pmatrix} = \TT{B} \begin{pmatrix}
+      a_1' \\
+      a_2'
+    \end{pmatrix} \] where $(a_1, a_2)$ are the components of $A$ in orthonormal basis $\{\hat{e}_1, \hat{e}_2\}$ and $(a_1', a_2')$ are the components of $A$ in orthonormal basis $\{\hat{e}_1', \hat{e}_2'\}$, which is rotated an angle $\theta$ relative to the unprimed basis.
+
+    \item Confirm matrix $\TT{B}$ is orthonormal, that is, that its inverse is equal to its transpose. We could have anticipated that since $\TT{B}$ maps an orthonormal basis into an orthonormal basis, which implies the transformation and thus $\TT{B}$ is orthogonal.
+
+    \item Confirm also that the columns and rows of matrix $\TT{B}$ form an orthonormal basis of $\mathbb{R}_2(\mathbb{R})$.
+
+    This is general: a real $n \cross n$ matrix is orthonormal if and only if its rows and columns each form an orthonormal basis of $\mathbb{R}_n(\mathbb{R})$.
+
+    \item Realize that $\det \TT{B} = 1$, as expected for an orthogonal matrix representing a rotation. In fact, any $2 \cross 2$ orthogonal matrix with determinant 1 corresponds to a rotation (the same applies to 3D). Additionally, any $2 \cross 2$ orthogonal matrix with determinant -1 corresponds to a reflection through a line (in 3D, the statement affirms that a reflection is involder -an orthogonal $3 \cross 3$ matrix with determinant -1 thus corresponds to an improper rotation).
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):}
+
+Since we know from affine geometry courses that rotations are linear transformations, in order to check that matrix \[ A := \begin{pmatrix}
+  \cos \theta & - \sin \theta \\
+  \sin \theta & \cos \theta
+\end{pmatrix} \] is the transformation matrix which transforms the representation of vectors in orthonormal basis $E' = \{\hat{e}_1', \hat{e}_2'\}$ to their representation in orthonormal basis $E = \{\hat{e}_1, \hat{e}_2\}$, we know from linear algebra courses that it suffices to show that it correctly maps the vectors which form basis $E'$ to their corresponding images.
+
+We know that $\hat{e}_1' = (0, 1)_{E'}$ is the vector $\hat{e}_1 = (0, 1)_E$ rotated by angle $\theta$. Therefore, \[ \hat{e}_1' = (\cos \theta, \sin \theta)_E \] by using the polar coordinates parametrization of $e_1'$.
+
+Also, we know that $\hat{e}_2'$ is the vector $\hat{e}_2$ rotated by angle $\theta$, and also that since $E$ is a direct orthonormal basis of $\mathbb{R}^2$, vector $\hat{e}_2$ is vector $\hat{e}_1$ rotated by $\frac{\pi}{2}$ radians. Therefore, by the same argument used above, \[ \hat{e}_2' = \left(\cos (\theta + \frac{\pi}{2}), \sin (\theta + \frac{\pi}{2})\right)_E = (- \sin \theta, \cos \theta)_E \] where we've used the trigonometric identities $\cos (x + \frac{\pi}{2}) = - \sin x$ and $\sin (x + \frac{\pi}{2}) = \cos x$.
+
+By calculating $A \hat{e}_1'$ and $A \hat{e}_2'$ we can check that the results are the same as what we have found before.
+
+\textbf{Solution for b):}
+
+\[ \TT{B} \text{ orthonormal} \iff \TT{B}^{-1} = \TT{B}^T \iff \TT{B}^T \TT{B} = \TT{I} \]
+
+Let's calculate $\TT{B}^T \TT{B}$:
+
+\[ \TT{B}^T \TT{B} = \begin{pmatrix}
+  \cos \theta & \sin \theta \\
+  - \sin \theta & \cos \theta
+\end{pmatrix} \begin{pmatrix}
+  \cos \theta & - \sin \theta \\
+  \sin \theta & \cos \theta
+\end{pmatrix} = \]
+\[ = \begin{pmatrix}
+  \cos^2 \theta + \sin^2 \theta & - \sin \theta \cos \theta + \sin \theta \cos \theta \\
+  - \sin \theta \cos \theta + \sin \theta \cos \theta & \cos^2 \theta + \sin^2 \theta
+\end{pmatrix} = \begin{pmatrix}
+  1 & 0 \\
+  0 & 1
+\end{pmatrix} = Id \]
+
+Therefore, $\TT{B}$ is orthonormal.
+
+\textbf{Solution for c):}
+
+Let's show that columns $v_1 = (\cos \theta, \sin \theta)$ and $v_2 = (- \sin \theta, \cos \theta)$ (we assume they are expressed in basis $E$) form an orthonormal basis, by definition of an orthonormal basis:
+\[ \begin{cases}
+  (v_1, v_1) = \cos^2 \theta + \sin^2 \theta = 1 \\
+  (v_1, v_2) = - \sin \theta \cos \theta + \sin \theta \cos \theta = 0 \\
+  (v_2, v_2) = \sin^2 \theta + \cos^2 \theta = 1
+\end{cases} \]
+Therefore, they form an orthonormal basis.
+
+Let's check it for the row vectors $\tilde{v}_1 = (\cos \theta, - \sin \theta)$, $\tilde{v}_2 = (\sin \theta, \cos \theta)$ too:
+\[ \begin{cases}
+  (\tilde{v}_1, \tilde{v}_1) = \cos^2 \theta + \sin^2 \theta = 1 \\
+  (\tilde{v}_1, \tilde{v}_2) = \sin \theta \cos \theta - \sin \theta \cos \theta = 0 \\
+  (\tilde{v}_2, \tilde{v}_2) = \sin^2 \theta + \cos^2 \theta = 1
+\end{cases} \]
+Therefore, $\{\tilde{v}_1, \tilde{v}_2\}$ also form an orthonormal basis.
+
+\textbf{Solution for d):}
+
+\[ \det \TT{B} = \cos^2 \theta + \sin^2 \theta = 1 \]
+
+The fact that any $2 \times 2$ orthogonal matrix with determinant 1 represents a rotation and with determinant -1 represents a reflection through a line (and their equivalent statements in 3D) is proved in \cite{geo}.
+
+\begin{Problem}
+  Consider $\TT{B} = \vec{u} \vec{v}$. Show that $\TT{B} \cdot \vec{w} = \vec{u} (\vec{v} \cdot \vec{w})$.
+
+  We often think of the direct product between vectors in terms of its action on a vector. Note how this way of thinking about it directly shows that, in general, the direct product is not commutative: $\vec{u} \vec{v} \neq \vec{v} \vec{u}$.
+\end{Problem}
+
+\Solution
+
+Using Einstein summation convention:
+
+\[ \TT{B}_{ij} = (\vec{u} \vec{v})_{ij} = u_i v_j \implies (\TT{B} \cdot \vec{w})_i = B_{ij} w_k \delta_{jk} = B_{ij} w_j = u_i v_j w_j \]
+\[ (\vec{v} \cdot \vec{w})_j = v_i w_j \delta_{ij} = v_j w_j \implies (\vec{u} (\vec{v} \cdot \vec{w}))_i = u_i v_j w_j \]
+
+Given that we've shown that each component of both vectors in a specific basis are equal to each other, we have proven that in fact both vectors are equal to each other, thus proving the statement.
+
+\begin{Problem}
+  Consider a second rank tensor $\TT{B}$ written in terms of the $\{ \hat{e}_i, \hat{e}_j \}$ basis. Show that $\hat{e}_i \cdot \TT{B} \cdot \hat{e}_j = B_{ij}$ (the $i, j$ component of tensor $\TT{B}$).
+
+  Note this is the tensor expression analogous to the vector expression giving the $i$ component of, say, vector $u$: $u_i = \hat{e}_i \cdot \vec{u}$. In continuum mechanics, we will ofteh consider the $i, j$ component of the stress tensor; it represents the $i$ component of the force (that is, the force along $\hat{e}_i$) per unit area acting on a surface element oriented along direction $j$ (that is, on a surface element with normal along $\hat{e}_j$).
+
+  Note: In quantum mechanics, we often write this tensor expression using bra-kets: $B_{ij} = \langle \hat{e}_i | \TT{B} | \hat{e}_j \rangle$. In this context, we think of $\TT{B}$ as an operator. The quantity $\langle \hat{e}_i | \TT{B} | \hat{e}_j \rangle$ equals the expectation value of the observable represented by operator $\TT{B}$ in quantum state $| \hat{e}_i \rangle$.
+\end{Problem}
+
+\[ (\hat{e}_i \cdot \TT{B})_m = \delta_{ik} B_{lm} \delta_{kl} = B_{im} \implies \]
+\[ \implies \hat{e}_i \cdot \TT{B} \cdot \hat{e}_j = B_{im} \delta_{nj} \delta_{mn} = B_{ij} \]
+
+\begin{Problem}
+  We have stated in class that the symmetry and antisymmetry of second rank tensors are tensor properties, that is, properties that are independent of coordinate system.
+
+  To show this is the case for the symmetry property, first consider how second rank tensors transform. Then assume the tensor is symmetric in the unprimed basis to then show this is also true in the primed basis.
+\end{Problem}
+
+Let's consider a change of basis for a second rank tensor. If $S$ is the change of basis matrix (from basis $B'$ to $B$) and $A$, $A'$ are the matrix representations of a second rank tensor in basis $B$ and $B'$ respectively, we have that:\cite{multi} \[ A' = S^t A S. \]
+
+Therefore: \[ A'^t = (S^t A^t S)^t = S^t A S = A' \] using the property $(AB)^t = B^t A^t$.
+
+\begin{Problem}
+  Use index notation to show that $\TT{B} : \TT{C} = \Tr(\TT{B} \cdot \TT{C})$, where $\TT{B}$ and $\TT{C}$ are second rank tensors.
+\end{Problem}
+
+\[ \TT{B} : \TT{C} = B_{ij} C_{kl} \delta_{jk} \delta_{il} = B_{ij} C_{ji} \]
+\[ (\TT{B} \cdot \TT{C})_{il} = B_{ij} C_{kl} \delta_{jk} = B_{ij} C_{jl} \implies \Tr(\TT{B} \cdot \TT{C}) = \sum_i (\TT{B} \cdot \TT{C})_{ii} = B_{ij} C_{ji} \]
+
+\begin{Problem}
+  Use the quotient rule to show that torque is a second rank tensor.
+\end{Problem}
+
+In class we saw $\tau_{ij} = r_i F_j - r_j F_i$. The quotient rule for second rank vectors states that if we show that for every vector $v_j$ the quantities $u_i := \sum_j T_{ij} v_j$ are the components of a non-zero vector, then $T_{ij}$ are the components of a second rank tensor. It's sufficient to show this for a unit non-zerovector $\hat{e}$. Using Einstein's summation convention:  \[ u_i = T_{ij} \hat{e}_j = (r_i F_j - r_j F_i) \hat{e}_j = r_i (\vec{F} \cdot \hat{e}) - F_i (\vec{r} \cdot \hat{e}) \]
+
+The two last terms are component i of 2 vectors, and so is their difference. Therefore, by the quotient rule, this proves that torque is a second rank tensor.
+
+\newpage
+
+\begin{Problem}
+  Prove that $(\vec{u'} \cross \vec{v'})_\alpha = (\det \TT{A}) a_{\alpha i} (\vec{u} \cross \vec{v})_i$, where $\TT{A} = \{ a_{ij} \}$ is an orthogonal transformation from the unprimed to the primed basis. This shows the cross product between two (polar) vectors is a pseudovector.
+
+  It follows that the scalar $\vec{w} \cdot (\vec{u} \cross \vec{v})$, where $u$, $v$ and $w$ are (polar) vectors, is a pseudoscalar. Show this.
+\end{Problem}
+
+As we saw in class: \[ (\vec{a} \cross \vec{b})_i = \varepsilon_{ijk} a_j b_k, \]
+\[ \varepsilon'_{\alpha \beta \gamma} = \det \TT{A} a_{\alpha i} a_{\beta j} a_{\gamma k} \varepsilon_{ijk} \]
+
+Since $\TT{A}$ is the orthogonal transformation from the unprimed to the primed basis, we have that $\TT{A} \cdot \vec{u} = \vec{u'}$ and $\TT{A} \cdot \vec{v} = \vec{v'}$. This means that: \[ (\vec{u'})_i = (\TT{A} \cdot \vec{u})_i = a_{ij} u_k \delta_{jk} = a_{ik} u_k \] and \[ (\vec{v'})_i = a_{ik} v_k. \]
+
+Then:
+\[ \text{LHS} = (\vec{u'} \cross \vec{v'})_\alpha = (\det \TT{A}) a_{\alpha i} a_{\beta j} a_{\gamma k} a_{\beta m} a_{\gamma n} \varepsilon_{ijk} u_m v_n \]
+We have that columns of orthogonal matrix $\TT{A}$ make an orthonormal triad ($a_{ij} a_{ik} = \delta_{ik}$), so:
+\[ \text{LHS} = (\det \TT{A}) a_{\alpha i} \delta_{jm} \delta_{kn} \varepsilon_{ijk} u_m v_n = (\det \TT{A}) a_{\alpha i} \varepsilon_{imn} u_m v_n = (\det \TT{A}) a_{\alpha i} (\vec{u} \cross \vec{v})_i = RHS \]
+
+\printbibliography
+
+\end{document}
diff --git a/quad8/continuummechanics/homework/hw1/references.bib b/quad8/continuummechanics/homework/hw1/references.bib
new file mode 100644
index 0000000..979ce41
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw1/references.bib
@@ -0,0 +1,19 @@
+@booklet{geo,
+  author={Facultat de Matemàtiques i Estadística (UPC)},
+  title={Apunts Geometría afí i euclidiana},
+  url={https://drive.google.com/file/d/1V1TodeUpnjbe-JKKufW_Qe37EIHXZAUN/view}
+}
+
+@booklet{multi,
+  author={Òscar Benedito, Ernesto Lanchares, Miquel Ortega},
+  title={Álgebra Multilineal y Geometría Proyectiva},
+  organization={ApuntsFME},
+  pages={11},
+  url={https://apuntsfme.gitlab.io/pdfs/segon/algebra_multilineal_y_geometria.pdf},
+  year={2018}
+}
+
+@online{mathe,
+  title={Cross product: matrix transformation identity},
+  url={https://math.stackexchange.com/questions/859836/cross-product-matrix-transformation-identity}
+}
diff --git a/quad8/gd/entregables/.gitignore b/quad8/gd/entregables/.gitignore
deleted file mode 100644
index 2c17622..0000000
--- a/quad8/gd/entregables/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-# Tex files
-*.aux
-*.fdb_latexmk
-*.fls
-*.log
-*.out
-*.synctex.gz
-*.bbl
-*.blg
-
-# Bibtex-specific files
-*.bcf
-*.run.xml