Multiple quad8 changes

Change-Id: Ia9f2b1550c7d7d4364fcb9fb91a5e41ff6778cc7
diff --git a/quad8/continuummechanics/homework/hw3/main.pdf b/quad8/continuummechanics/homework/hw3/main.pdf
new file mode 100644
index 0000000..952a1a2
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw3/main.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw3/main.tex b/quad8/continuummechanics/homework/hw3/main.tex
new file mode 100644
index 0000000..63de975
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw3/main.tex
@@ -0,0 +1,255 @@
+\documentclass[11pt,a4paper,dvipsnames]{article}
+\usepackage[utf8]{inputenc}
+
+\input{../preamble.tex}
+
+\title{Homework 3\\Continuum Mechanics}
+\author{Adrià Vilanova Martínez}
+\date{April 11, 2021}
+
+\begin{document}
+
+\maketitle
+
+\begin{Problem}
+  One of the hallmarks of the linear regime is the superposition principle. In this problem, we are going to use superposition to find the relation between the bulk modulus $K$, Young's modulus $Y$ and Poisson's ration $\nu$.
+
+  Consider a rectangular block subjected to uniform compressive stresses $-P$ on each face. The equilibrium sides of the block along $x$, $y$ and $z$ are $l$, $h$ and $w$, respectively, and the corresponding length changes are $\Delta l$, $\Delta h$ and $\Delta w$.
+
+  \begin{enumerate}[a)]
+    \item Find the strain along $x$ using Hooke's law as we learnt it in introductory courses (that is, $\sigma_{xx} = Y u_{xx}$ and $u_{yy} = u_{zz} = - \nu u_{xx}$). You will be using superposition since the strain along $x$ is the sum of three contributions, one coming from the compressive stress along $x$ and two additional contributions coming from the compressive stresses along $y$ and $z$.
+
+    Confirm that by using the inverted version of Hooke's law for isotropic materials we obtain the same answer.
+
+    \item The strains along $y$ and $z$ are identical to that along $x$. Find the bulk modulus of the material as a function of $Y$ and $\nu$. Realize our result is identical to that obtained in class in an alternative way.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):} \\
+As the only contact force is pressure, the only components of the stress tensor will be the ones in the diagonal, which will be equal to $-P$.
+
+If we only consider the compressive stress along $x$, we get:
+\[ u_{xx}^1 = \frac{1}{Y} \sigma_{xx} = - \frac{1}{Y} P. \]
+
+However, we also have to consider the strain caused by the stresses in the $y$ and $z$ directions:
+\[ \begin{cases}
+  \displaystyle u_{xx}^2 = - \nu u_{yy}^2 = - \frac{\nu}{Y} \sigma_{yy} = \frac{\nu}{Y} P, \\[2ex]
+  \displaystyle u_{xx}^3 = - \nu u_{zz}^3 = - \frac{\nu}{Y} \sigma_{zz} = \frac{\nu}{Y} P.
+\end{cases} \]
+
+So, by the superposition principle:
+\[ u_{xx} = u_{xx}^1 + u_{xx}^2 + u_{xx}^3 = \frac{P}{Y} \left( 2 \nu - 1 \right). \]
+
+We can also calculate the strain along $x$ with the inverted version of Hooke's law for isotropic materials:
+\[ u_{ij} = \frac{1 + \nu}{Y} \sigma_{ij} - \frac{\nu}{Y} \, \Tr \TT{\sigma} \, \delta_{ij}. \]
+
+By using it, we obtain:
+\[ u_{xx} = \frac{1}{Y} \left( (1 + \nu) \sigma_{xx} - \nu \, \Tr \TT{\sigma} \, \delta_{xx} \right) = \frac{1}{Y} \left( - (1 + \nu) P + 3 \nu P \right) = \]
+\[ = \frac{P}{Y} \left( - 1 - \nu + 3 \nu \right) = \frac{P}{Y} \left( 2 \nu - 1 \right) \]
+which is precisely what we got before by using the superposition principle and Hooke's law we learned in introductory courses.
+
+\textbf{Solution for b):} \\
+From the previous result, we obtain:
+\[ \Tr \TT{u} = 3 P \frac{2 \nu - 1}{Y} \notate[X]{{}\implies{}}{1.25}{\scriptstyle \Tr \TT{u} \, \approx \, \frac{\Delta V}{V}} P \frac{V}{\Delta V} \approx \frac{1}{3} \frac{Y}{2 \nu - 1}. \]
+
+And by the definition of the bulk modulus, we conclude that
+\[ K = - V \left( \frac{\partial P}{\partial V} \right)_T \approx - V \frac{\Delta P}{\Delta V} \approx \frac{Y}{3 (1 - 2 \nu)} \]
+which is the same result we derived in class.
+
+\newpage
+
+\begin{Problem}
+  Consider the class example we referred to as ``constrained settling''. We are going to tackle the problem here in an alternative way to how we did it in class.
+
+  \begin{enumerate}[a)]
+    \item Start by solving the Navier-Cauchy equation to obtain the displacement field.
+    \item Then obtain the strain and stress tensors.
+    \item Why do you think Lautrup refers to this example as an ``elastic sea''?
+  \end{enumerate}
+\end{Problem}
+
+\Solution
+The Navier-Cauchy equation is:
+\[ \vec{f} + \mu \nabla^2 \vec{u} + (\lambda + \mu) \nabla (\nabla \cdot \vec{u}) = 0. \]
+
+Since the walls are slippery, they allow vertical but not horizontal displacements. This indicates us that the displacement field will be of the form $\vec{u} = (0, 0, u_z(z))$. By imposing the Navier-Cauchy equation to this expression, we get the following:
+\[ 0 = \begin{pmatrix}
+  0 \\
+  0 \\
+  - \rho g
+\end{pmatrix} + \mu \begin{pmatrix}
+  0 \\
+  0 \\
+  u_z''(z)
+\end{pmatrix} + (\lambda + \mu) \begin{pmatrix}
+  0 \\
+  0 \\
+  u_z''(z)
+\end{pmatrix} \implies \]
+\[ \implies \rho g = (\lambda + 2 \mu) u_z''(z) \implies u_z''(z) = \frac{\rho g}{\lambda + 2 \mu} =: \frac{1}{D} \implies \]
+\[ \implies u'_z(z) = \frac{1}{D} z + C \implies u_z(z) = \frac{1}{2D}z^2 + Cz + B \]
+
+where $C, B$ are constants that are determined by the boundary conditions.
+
+In our case, our boundary conditions are the following ones:
+\[ \begin{cases}
+  u_z(0) = 0 \implies B = 0 \\
+  [ \TT{\sigma} \cdot \hat{n} ] = 0.
+\end{cases} \]
+
+Let's calculate the strain tensor:
+\[ \TT{u} = \frac{1}{2} (\nabla \vec{u} + (\nabla \vec{u})^T) \]
+where
+\[ \nabla \vec{u} = \begin{pmatrix}
+  0 & 0 & 0 \\
+  0 & 0 & 0 \\
+  0 & 0 & \frac{z}{D} + C
+\end{pmatrix}. \]
+
+Therefore:
+\[ \TT{u} = \begin{pmatrix}
+  0 & 0 & 0 \\
+  0 & 0 & 0 \\
+  0 & 0 & \frac{z}{D} + C
+\end{pmatrix}. \]
+
+We can then calculate the stress vector using Hooke's law:
+\[ \sigma_{ij} = 2 \mu u_{ij} + \lambda \, \Tr \TT{u} \, \delta_{ij} \implies \]
+\[ \implies \TT{\sigma} = \left( \frac{z}{D} + C \right) \begin{pmatrix}
+  \lambda & 0 & 0 \\
+  0 & \lambda & 0 \\
+  0 & 0 & \lambda + 2 \mu
+\end{pmatrix} \]
+
+Now we can impose the boundary condition $[\TT{\sigma} \cdot \hat{n}] = 0$. Since the interface is a free surface (we neglect atmospheric pressure), we have that $\TT{\sigma}_2 = 0$, which means that:
+\[ \TT{\sigma}_1 \hat{n} = 0 \implies \sigma_{iz}(h) = 0 \quad \forall i. \]
+
+In particular, $\sigma_{zz}(h) = 0$, and this means
+\[ C = - \frac{h}{D}. \]
+
+In conclusion, substituting $C$ and $D$ into the expressions we found:
+\[ \begin{cases}
+  \vec{u} = \begin{pmatrix}
+    0 \\
+    0 \\
+    \frac{1}{D} \left( \frac{1}{2} z^2 - hz \right)
+  \end{pmatrix} \\
+  \TT{u} = \begin{pmatrix}
+    0 & 0 & 0 \\
+    0 & 0 & 0 \\
+    0 & 0 & \frac{1}{D} (z - h)
+  \end{pmatrix} \\
+  \TT{\sigma} = \frac{\lambda}{D} (z - h) \begin{pmatrix}
+    \lambda & 0 & 0 \\
+    0 & \lambda & 0 \\
+    0 & 0 & \lambda + 2 \mu
+  \end{pmatrix}.
+\end{cases} \]
+
+Lautrup refers to this example as an elastic sea because $p_z = - \sigma_{zz} = \rho g (h - z)$, and $p_z$ increases linearly with depth like a fluid at rest.
+
+\newpage
+
+\begin{Problem}
+  Consider the situation studied in problem 2: a homogeneous and isotropic elastic solid with denisty $\rho$ inside a container with rigid walls. However, in this case, the container is cylindrical and not a prism, and there is friction between the elastic solid and the walls. Hence, $\sigma_{zr} (r = R) = \mu_s \sigma_{zz} (r = R)$, where $R$ is the radius of the circular cross-section and $\mu_s$ is the friction coefficient. There is still gravity; the corresponding specific force is $\vec{g} = g \hat{z}$. Note the $z$-axis runs along the cylinder and points downwards.
+
+  \begin{enumerate}[a)]
+    \item Discuss how friction affects both the strain and stress tensors. What new components arise in these tensors relative to the case without friction?
+
+    \item Now consider a thin slice of elastic material inside the cylindrical container; this slice will have cross-sectional area $\pi R^2$ and height $\Delta z$.
+
+    Apply the condition of mechanical equilibrium to this slice, assuming that $\sigma_{zz}$ is uniform across the circular cross-section and that $\sigma_{rr} = \sigma_{\theta \theta} = k \sigma_{zz}$, with $k$ a constant, and show that
+    \[ \frac{d \sigma_{zz}}{dz} = - \rho g - \frac{2 \mu_s k}{R} \sigma_{zz}. \]
+
+    \item Integrate this equation and show that
+    \[ p_z = \rho g \lambda \left( 1 - e^{- \frac{z}{\lambda}} \right) \]
+    where $\lambda = \frac{R}{2 \mu_s k}$. Note we have assumed that at the top of the solid $\sigma_{zz} = 0$.
+
+    \item Consider the limiting cases $z \ll \lambda$ and $z \gg \lambda$ and discuss the physics in each case. Doing this illustrates the physical significance of $\lambda$ and what friction brings to the problem.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):} \\
+Due to friction, $\vec{u} = (0, 0, u_z(r, z))$, so in adition to the dependence on z, there's now an r-dependence too.
+
+\[ \vec{\nabla} \vec{u} = \begin{pmatrix}
+  0 & 0 & \partial_r u_z \\
+  0 & 0 & 0 \\
+  0 & 0 & \partial_z u_z
+\end{pmatrix} \implies \TT{u} = \frac{1}{2} (\vec{\nabla} \vec{u} + (\vec{\nabla} \vec{u})^T) = \begin{pmatrix}
+  0 & 0 & \frac{1}{2} \partial_r u_z \\
+  0 & 0 & 0 \\
+  \frac{1}{2} \partial_r u_z & 0 & \partial_z u_z
+\end{pmatrix}. \]
+
+We can now use Hooke's law:
+\[ \TT{\sigma} = 2 \mu \TT{u} + \lambda (\Tr \TT{u}) \TT{I} \implies \]
+\[ \TT{\sigma} = \begin{pmatrix}
+  \lambda \partial_z u_z & 0 & \mu \partial_r u_z \\
+  0 & \lambda \partial_z u_z & 0 \\
+  \mu \partial_r u_z & 0 & (2 \mu + \lambda) \partial_z u_z
+\end{pmatrix}. \]
+
+\textbf{Solution for b):} \\
+The local condition for mechanical equilibrium is
+\[ \vec{f} + \nabla \cdot \TT{\sigma}^T = 0 \quad \forall \text{ material particles}. \]
+
+If we integrate over volume $V$:
+\[ \int_V \vec{f} dv' + \int_V \vec{\nabla} \cdot \TT{\sigma}^T dv' = \int_V \vec{F} dv' + \oint_A \TT{\sigma} \cdot \vec{dS} = 0, \]
+where $V$ is a cylindrical slice of the material ($|V| = \pi R^2 \Delta z$).
+
+\[ \int_V \vec{f} dv' = \int_V \rho \vec{g} dv' = \hat{e}_z \rho g \pi R^2 \Delta z. \]
+\[ \oint_A \TT{\sigma} \cdot \vec{dS} = \int_{A_1} \TT{\sigma} \vec{dS} + \int_{A_2} \TT{\sigma} \vec{dS} + \int_{A_\perp} \TT{\sigma} \vec{dS}, \]
+where $A_1$, $A_2$ are the circular surfaces at the top and at the bottom, and $A_\perp$ is the lateral surface.
+
+For the top and bottom surfaces, we have:
+\[ \int_{A_i} \TT{\sigma} \cdot \vec{dS} = \int_{A_i} (-1)^i \TT{\sigma}_{rz}(z_i) \hat{e}_r r d\theta dr + \int_{A_i} (-1)^i \sigma_{zz}(z_i) \hat{e}_z r d\theta dr, \]
+and since $\sigma_{zz} \neq f(r)$ because we've supposed that it is uniform across the entire section, we have:
+\[ \int_{A_i} \TT{\sigma} \cdot \vec{dS} = 0 + \int_{A_i} (-1)^i \sigma_{zz}(z_i) \hat{e}_z r d\theta dr = (-1)^i \hat{e}_z \sigma_{zz}(z_i) R^2 \pi \]
+
+For the lateral surface, we have:
+\[ \int_{A_\perp} \TT{\sigma} \cdot \vec{dS} = \int_{A_\perp} \sigma_{rr} R d\theta dz \hat{e}_r + \int_{A_\perp} \sigma_{zr}(R) R d\theta dz \hat{e}_z = \]
+\[ = 0 + \mu_S K R \hat{e}_z \int_{z}^{z + \Delta z} \sigma_{zz} dz' \int_{0}^{2\pi} d\theta \approx 2 \pi R \mu_S k \hat{e}_z \sigma_{zz} \Delta z. \]
+
+Putting it all together:
+\[ \hat{e}_z (\rho g \pi R^2 \Delta z - \sigma_{zz}(z) \pi R^2 + \sigma_zz{z + \Delta z} \pi R^2 + 2\pi R \mu_S k \sigma_{zz} \Delta z) = 0 \implies \]
+\[ \implies \pi R^2 \frac{\sigma_{zz}(z + \Delta z) - \sigma_{zz}(z)}{\Delta z} = - \rho g \pi R^2 - 2 \pi R \mu_s k \sigma_{zz}. \]
+
+Taking the limit for $\Delta z \to 0$:
+\[ \pi R^2 \frac{d \sigma_{zz}}{dz} = - \rho g \pi R^2 - 2 \pi R \mu_S k \sigma_{zz} \implies \]
+\[ \implies \frac{d\sigma_{zz}}{dz} = - \rho g - \frac{2 \mu_s k}{R} \sigma_{zz}. \]
+
+\textbf{Solution for c):} \\
+We'll first solve the homogeneous ODE
+\[ f'(z) + \frac{1}{\lambda} f(z) = 0. \]
+
+This is a linear ODE with known solution
+\[ f_h(z) = e^{- \frac{z}{\lambda}}. \]
+
+We can then solve the full ODE with the constant variations method: let's suppose the solution to the full ODE is $\sigma_{zz}(z) = f(z) = f_h(z) g(z)$. Then:
+\[ f_h'(z) g(z) + f_h(z) g'(z) = f'(z) = - \rho g - \frac{1}{\lambda} f_h(z) g(z) \implies \]
+\[ \implies \cancel{- \frac{1}{\lambda} f_h(z) g(z)} + g'(z) f_h(z) = - \rho g \cancel{- \frac{1}{\lambda} f_h(z) g(z)} \implies \]
+\[ \implies g'(z) = - \rho g e^{\frac{z}{\lambda}} \implies g(z) = C - \rho g \lambda e^{\frac{z}{h}} = C - \rho g \lambda \frac{1}{f_h(z)} \implies \]
+\[ \implies \sigma_{zz}(z) = f(z) = f_h(z) \left( C - \rho g \lambda \frac{1}{f_h(z)} \right) = C f_h(z) - \rho g \lambda = C e^{-\frac{z}{h}} - \rho g \lambda. \]
+
+If we impose $\sigma_{zz}(0) = 0$:
+\[ 0 = \sigma_{zz}(0) = C - \rho g \lambda \implies C = \rho g \lambda, \]
+and thus:
+\[ \sigma_{zz}(z) = \rho g \lambda \left( e^{-\frac{z}{h}} - 1 \right). \]
+
+Since $p_z = - \sigma_{zz}$, we have shown that the statement is true.
+
+\textbf{Solution for d):} \\
+$\lambda = \frac{R}{2 \mu_S k}$ is a characteristic length scale ($\mu_S$, $k$ are dimensionless). Using $\mu_s \approx 0.5$, $k \approx 1$, we find $\lambda \approx R$.
+
+To discuss the case in which $z \ll \lambda$, we can approximate $p_z$ via a truncated Taylor series:
+\[ p_z(z) = \rho g \lambda \left( \frac{z}{\lambda} + \mathcal{O}\left(\frac{z}{\lambda}\right)^2 \right) \approx \rho g z, \]
+which is the behavior in the absence of friction.
+
+If instead $z \gg \lambda$, this means $\frac{z}{\lambda} \gg 1$ and therefore $e^{- \frac{z}{h}} \ll 1$. Thus:
+\[ e^{- \frac{z}{h}} \approx 0 \implies p_z(z) \approx \rho g \lambda, \]
+which is a constant value.
+
+Therefore, we can conclude the pressure saturates for sufficiently large $z$. Friction supports the weight of the elastic material for sufficiently light columns.
+
+\end{document}
diff --git a/quad8/continuummechanics/homework/hw4/main.pdf b/quad8/continuummechanics/homework/hw4/main.pdf
new file mode 100644
index 0000000..255c99e
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw4/main.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw4/main.tex b/quad8/continuummechanics/homework/hw4/main.tex
new file mode 100644
index 0000000..3b43d2f
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw4/main.tex
@@ -0,0 +1,156 @@
+\documentclass[11pt,a4paper,dvipsnames]{article}
+\usepackage[utf8]{inputenc}
+
+\input{../preamble.tex}
+
+\title{Homework 4\\Continuum Mechanics}
+\author{Adrià Vilanova Martínez}
+\date{April 11, 2021}
+
+\begin{document}
+
+\maketitle
+
+\begin{Problem}
+  Consider a solid sphere of constant density $\rho$ and undeformed radius $R$, subjected to its own gravitational force. It is made of an elastically homogeneous and isotropic material of Young's modulus $Y$ and Poisson's ratio $\nu$.
+
+  \begin{enumerate}
+    \item Determine the displacement field of the material particles in the sphere.
+    \item Compute the corresponding strain and stress fields.
+  \end{enumerate}
+
+  \underline{Note:} The gravitational force per unit volume experienced by a material particle is: $\vec{f} = \rho \vec{g} = - \rho g \frac{r}{R} \hat{e}_r$, where $g = \frac{4}{3} \pi G \rho R$, with $G$ the gravitational constant.
+\end{Problem}
+
+\Solution
+The displacement field in spherical coordinates will be $\vec{u} = (u_r(r), 0, 0)$ due to the symmetry of the problem.
+
+Let's use Navier-Cauchy's equation:
+\[ \vec{f} + \mu \vec{\nabla}^2 \vec{u} + (\lambda + \mu) \vec{\nabla} (\vec{\nabla} \cdot \vec{u}) = 0 \]
+which in spherical coordinates becomes:
+\[ \begin{pmatrix}
+  - \rho g \frac{r}{R} \\
+  0 \\
+  0
+\end{pmatrix} + \mu \begin{pmatrix}
+  \partial^2_{rr} u_r + \frac{2}{r} \partial_r u_r - \frac{2}{r^2} u_r \\
+  0 \\
+  0
+\end{pmatrix} + (\lambda + \mu) \begin{pmatrix}
+  \partial^2_{rr} u_r + \frac{2}{r} \partial_r u_r - \frac{2}{r^2} u_r \\
+  0 \\
+  0
+\end{pmatrix} = 0 \iff \]
+\[ \iff - \rho g \frac{r}{R} + (\lambda + 2 \mu) \left( \partial^2_{rr} u_r + \frac{2}{r} \partial_r u_r - \frac{2}{r^2} u_r \right) = 0 \iff \]
+\[ \iff r^2 \partial^2_{rr} u_r + 2 r \partial_r u_r - u_r = \frac{\rho g}{(\lambda + 2 \mu) R} r^3 =: k r^3. \]
+
+If we take as an \textit{ansatz} the function
+\[ u_r(r) := a \cdot r^b, \]
+we can see that a particular solution to the ODE is
+\[ u_r(r) = \frac{k}{10} r^3. \]
+
+Due to the fact that the homogeneous part of the ODE has the solution space
+\[ \{ A r + B \frac{1}{r^2} : A, B \in \mathbb{R} \}, \]
+and the fact that since $u_r(r = 0) \neq \infty \implies B = 0$, we conclude that \[ \vec{u}(r) = \left( \frac{k}{10} r^3 + A r, 0, 0 \right). \]
+
+Since we have
+\[ \vec{\nabla} \vec{u} = \begin{pmatrix}
+  \frac{3}{10} k r^2 + A & 0 & 0 \\
+  0 & \frac{1}{10} k r^2 + A & 0 \\
+  0 & 0 & \frac{1}{10} k r^2 + A
+\end{pmatrix}, \]
+Cauchy's strain tensor is:
+\[ \TT{u} = \frac{1}{2} \left( \vec{\nabla} \vec{u} + (\vec{\nabla} \vec{u})^T \right) = \vec{\nabla} \vec{u}. \]
+
+Via Hooke's law, the only non-zero components of the stress vector are the ones in the diagonal:
+\[ \sigma_{ii} = 2 \mu u_{ii} + \lambda \Tr \TT{u} \implies \]
+\[ \TT{\sigma} = \begin{pmatrix}
+  \frac{6 \mu + 5 \lambda}{10} k r^2 + (3 \lambda + 2 \mu) A & 0 & 0 \\
+  0 & \frac{2 \mu + 5 \lambda}{10} k r^2 + (3 \lambda + 2 \mu) A & 0 \\
+  0 & 0 & \frac{2 \mu + 5 \lambda}{10} k r^2 + (3 \lambda + 2 \mu) A \\
+\end{pmatrix}. \]
+
+If we impose the boundary condition $\sigma_{rr} (r = R) = 0$ (free surface), we get:
+\[ (3 \lambda + 2 \mu) A = \frac{6 \mu + 5 \lambda}{10} k R^2. \]
+
+We can transform $Y$ and $\nu$ into the Lamé coefficients by applying the following transformation:
+\[ \begin{cases}
+  \lambda = \frac{Y \nu}{(1 - 2 \nu) (1 + \nu)}, \\
+  \mu = \frac{Y}{2 (1 + \nu)}.
+\end{cases} \]
+
+\newpage
+
+\begin{Problem}
+  A cylindrical pipe of inner radius $R_0$, outer radius $R_1$, and Lame coefficients $\mu$ and $\lambda$, is subjected to an internal pressure $p_0$, an external pressure $p_1$, and a uniform tensile force per unit area $F_z/A$ along the symmetry axis of the pipe $z$. Consider the end of the pipe at $z = 0$ is clamped to a rigid wall.
+
+  \begin{enumerate}
+    \item Determine the displacement field corresponding to the elastic deformation of the pipe. Neglect gravity and corrections due to the finite length of the pipe.
+
+    \item Compute the stress and strain fields corresponding to such deformation.
+  \end{enumerate}
+\end{Problem}
+
+We'll consider the displacement field resulting from the hydrostatic pressure, and the one resulting from the tensile force.
+
+\textbf{Displacement field resulting from the hydrostatic pressure:}
+
+Due to the symmetry of the problem in this case, we have that $\vec{u} = (u_r(r), 0, 0)$ in cylindrical coordinates.
+
+By applying the Navier-Cauchy equation, we get:
+\[ (\lambda + 2 \mu) \frac{d}{dr} \left( \frac{1}{r} \frac{d}{dr} (r u_r) \right) \implies u_r = \alpha r + \beta \frac{1}{r}. \]
+
+Therefore, we have that the only non-zero components of the strain tensor are:
+\[ u_{rr} = \frac{d u_r}{dr} = \alpha - \beta \frac{1}{r^2}, \]
+\[ u_{\phi\phi} = \frac{u_r}{r} = \alpha + \beta \frac{1}{r^2}. \]
+
+By using Hooke's law, we get:
+\[ \sigma_{rr} = 2 \alpha (\lambda + \mu) - 2 \beta \mu \frac{1}{r^2}, \]
+\[ \sigma_{\theta \theta} = 2 \alpha (\lambda + \mu) + 2 \beta \mu \frac{1}{r^2}, \]
+\[ \sigma_{zz} = 2 \alpha \lambda. \]
+
+We can now impose the boundary conditions $\sigma_{rr}(z = R_0) = - p_0$, $\sigma_{rr}(z = R_1) = - p_1$, and we get:
+\[ \alpha = \frac{p_0 R_0^2 - p_1 R_1^2}{2 (\lambda + \mu) (R_1^2 - R_0^2)}, \]
+\[ \beta = \frac{(p_0 - p_1) R_0^2 R_1^2}{2 \mu (R_1^2 - R_0^2)}. \]
+
+\textbf{Displacement field resulting from the tensible force:}
+
+Due to the uniform force, we have that:
+\[ \sigma_{zz} = \frac{F_z}{A}, \]
+which is the only non-zero component of the stress tensor. Therefore, from Hooke's law we have that the only non-zero components of the strain tensor are:
+\[ u_{zz} = \frac{1}{Y} \sigma_{zz} = \frac{F_z}{A Y}, \]
+\[ u_{rr} = - \nu u_{zz} = - \frac{F_z \nu}{A Y}, \]
+\[ u_{\theta \theta} = - \nu u_{zz} = - \frac{F_z \nu}{A Y}. \]
+
+Now we can integrate (in cylindrical coordinates) the previous expressions to find the displacement field:
+\[ u_{zz} = \frac{du_z}{dz} \implies u_z(z) = \frac{F_z}{AY} z + c, \]
+and since $u_z(0) = 0$, we have:
+\[ u_z(z) = \frac{F_z}{AY} z. \]
+
+Also:
+\[ u_{rr} = \frac{du_r}{dr} \implies u_r(r) = - \frac{F_z \nu}{A Y} r + c', \]
+and since $u_{\theta \theta} = \frac{u_r(r)}{r} \implies c' = 0$, then:
+\[ u_r(r) = - \frac{F_z \nu}{A Y} r \]
+
+\textbf{Conclusion:}
+
+Thanks to the superposition principle, we can sum the previous displacement fields to calculate the total displacement field:
+\[ \vec{u}(r) = \begin{pmatrix}
+  \left( \alpha - \frac{F_z \nu}{A Y} \right) r + \beta \frac{1}{r} \\
+  0 \\
+  \frac{F_z}{A Y} z
+\end{pmatrix}. \]
+
+As for the strain and stress tensors, we can do the same in order to get their total expressions:
+\[ \TT{\sigma} = \begin{pmatrix}
+  2 \alpha (\lambda + \mu) - 2 \beta \mu \frac{1}{r^2} & 0 & 0 \\
+  0 & 2 \alpha (\lambda + \mu) + 2 \beta \mu \frac{1}{r^2} & 0 \\
+  0 & 0 & 2 \alpha \lambda + \frac{F_z}{A}
+\end{pmatrix}, \]
+\[ \TT{u} = \begin{pmatrix}
+  \alpha - \beta \frac{1}{r^2} - \frac{F_z \nu}{A Y} & 0 & 0 \\
+  0 & \alpha + \beta \frac{1}{r^2} - \frac{F_z \nu}{A Y} & 0 \\
+  0 & 0 & \frac{F_z}{A Y}
+\end{pmatrix}. \]
+
+\end{document}
diff --git a/quad8/continuummechanics/homework/hw5/main.pdf b/quad8/continuummechanics/homework/hw5/main.pdf
new file mode 100644
index 0000000..ec6c37f
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw5/main.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw5/main.tex b/quad8/continuummechanics/homework/hw5/main.tex
new file mode 100644
index 0000000..80dcbfc
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw5/main.tex
@@ -0,0 +1,201 @@
+\documentclass[11pt,a4paper,dvipsnames]{article}
+\usepackage[utf8]{inputenc}
+
+\input{../preamble.tex}
+
+\title{Homework 5\\Continuum Mechanics}
+\author{Adrià Vilanova Martínez}
+\date{April 25, 2021}
+
+\begin{document}
+
+\maketitle
+
+\begin{Problem}
+  In this problem, we are going to compare the relative importance between stretching and bending a beam. To do this, consider a long beam oriented along the positive z-direction that is clamped on its left-most point. Neglect gravity.
+
+  \begin{enumerate}
+    \item If we apply a stretching force $F_z$ on the right-most point of the beam, show that the displacement at that point can be written as
+    \[ u_z = \frac{F_z}{A} \frac{L}{Y}, \]
+    with $L$ the length of the beam, $A$ the cross-sectional area and $Y$ the Young's modulus.
+
+    \item If we instead apply a downward force (along the Y-direction) $F_y$ on the right-most point of the beam, show that the displacement is
+    \[ u_y(z = L) = \frac{L^3 F_y}{3 Y I} \approx \frac{L^3 F_y}{3 Y A^2}, \]
+    where we have taken $I \approx A^2$ in the last step.
+  \end{enumerate}
+
+  This implies:
+  \[ \left| \frac{u_z}{u_y} \right| \approx \frac{A}{L^2} \left| \frac{F_z}{F_y} \right|. \]
+
+  Hence, for long beams ($A \ll L^2$) and comparable stretching and bending forces ($\left| \frac{F_z}{F_y} \right| \approx 1$), we see that $|u_z| \ll |u_y|$. This imples that the longitudinal displacement is always negligible compared to the transverse (due to bending) displacement.
+\end{Problem}
+
+\textbf{Solution for a):} \\
+We have that $\sigma_{zz} = \frac{F_z}{A} = Y u_{zz}$ by Hooke's law, and all the other components of the stress vector are zero. Therefore, $u_{zz} = \frac{F_z}{A Y}$.
+
+Since $u_{zz} = \frac{d u_z}{dz}$, we have
+\[ u_z = \int_0^R u_{zz} dz = \frac{F_z L}{A Y}. \]
+
+\begin{Problem}
+  Consider a cylindrical beam of length $L$ and cross-sectional radius $R$ oriented along the positive $\hat{e}_z$ direction and made of an isotropic and homogeneous elastic material with Lame coefficients $\lambda$ and $\mu$. We fix the left-most end of the beam, which is located at $z = 0$, such that the diplacement vector in the corresponding cross-section is zero. The other end, located at $z = L$, is subjected to a force (per unit area) $\TT{\sigma} \cdot \hat{e}_Z |_{r = R} = \sigma_L \hat{e}_\phi$, where $\TT{\sigma}$ is the stress tensor, $\sigma_L$ is a constant force per unit area supplied at $r = R$ to the circular cross-section located at $z = L$, and we are using the cylindrical system.
+
+  The resultant deformation results in a displacement vector that increases linearly with $z$, and that, based on the symmetry of the problem, we can write as
+  \[ \vec{u} = (0, u_\phi(r, z), 0) = (0, R(r) Z(z), 0) = R(r) Z(z) \hat{e}_\phi, \]
+  where we have separated the (r, z)-dependence of $u_\phi$ into its r- and z-dependences. You can safely ignore body forces, such as the gravitational force.
+
+  \begin{enumerate}
+    \item Obtain the displacement field in the solid.
+    \item Obtain the strain tensor.
+    \item Obtain the stress tensor.
+    \item What is the total work done by the applied stress?
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):} \\
+Since $\vec{u}$ increases linearly with $z$, we have that $Z(z) = az + b$.
+
+In order to find the displacement field, we will use Navier-Cauchy's equation combined with the general expression we have for the displacement field:
+\[ \underbrace{\vec{f}}_{= 0} + \mu \nabla^2 \vec{u} + (\lambda + \mu) \nabla (\nabla \cdot \vec{u}) = 0 \iff \]
+\[ \iff \mu (0, \partial_{rr} u_\phi + \partial_{zz} u_\phi + \frac{1}{r} \partial_r u_\phi - \frac{1}{r^2} u_\phi, 0) + (\lambda + \mu) \cdot 0 = 0 \iff \]
+\[ \iff \partial_{rr} u_\phi + \partial_{zz} u_\phi + \frac{1}{r} \partial_r u_\phi - \frac{1}{r^2} u_\phi = 0 \iff \]
+\[ \iff R''(r) + \frac{1}{r} R'(r) - \frac{1}{r^2} R(r) = 0 \iff \]
+\[ r^2 R''(r) + r R'(r) - R(r) = 0 \]
+
+If we take as an ansatz $R(r) = C \cdot r^k$, we can clearly see that two independent solutions for the ODE which form the basis of the solution space are:
+\[ \left\{ r, \frac{1}{r} \right\}, \]
+and so the general solution for the radial component is:
+\[ R(r) = cr + d \frac{1}{r}. \]
+If we impose that when $u_\phi$ must be bounded near 0, we get that $D = 0$, and so in reality
+\[ R(r) = cr. \]
+We also have that at $z = 0$, $u_\phi = 0 \quad \forall r$ since the beam is fixed, so:
+\[ 0 = u_\phi(0) = R(r) (0 \cdot A + B) \implies B = 0. \]
+Thus:
+\[ u_\phi = A c r z = E rz, \]
+where $E := Ac$.
+
+\textbf{Solution for b):} \\
+\[ \nabla \vec{u} = \begin{pmatrix}
+  0 & Ez & 0 \\
+  - Ez & 0 & 0 \\
+  0 & Er & 0
+\end{pmatrix} \implies \TT{u} = \frac{1}{2} (\nabla \vec{u} + (\nabla \vec{u})^T) = \frac{1}{2} \begin{pmatrix}
+  0 & 0 & 0 \\
+  0 & 0 & Er \\
+  0 & Er & 0
+\end{pmatrix}. \]
+
+\textbf{Solution for c):} \\
+We can get the stress tensor from the strain tensor via Hooke's law:
+\[ \TT{\sigma} = 2 \mu \TT{u} + \lambda (\Tr \TT{u}) \TT{I}, \]
+but since $\nabla \cdot \vec{u} = 0$, our expression simplifies to:
+\[ \TT{\sigma} = 2 \mu \TT{u} = \begin{pmatrix}
+  0 & 0 & 0 \\
+  0 & 0 & E \mu r \\
+  0 & E \mu r & 0
+\end{pmatrix}. \]
+We are now in good position to impose the boundary condition of the stress tensor at the end of the beam ($z = L$):
+\[ \sigma_L \hat{e}_\phi = [\TT{\sigma} \cdot \hat{e}_z]_{r = R} = \left[ \begin{pmatrix}
+  0 \\
+  \mu E r \\
+  0
+\end{pmatrix} \right]_{r = R} = \mu E R \hat{e}_\phi \implies E = \frac{\sigma_L}{\mu R}. \]
+
+Therefore:
+\[ \vec{u} = \left( 0, \frac{\sigma_L}{\mu R} rz, 0 \right), \]
+\[ \TT{u} = \frac{1}{2} \begin{pmatrix}
+  0 & 0 & 0 \\
+  0 & 0 & \frac{\sigma_L}{\mu R} r \\
+  0 & \frac{\sigma_L}{\mu R} r & 0
+\end{pmatrix}, \]
+\[ \TT{\sigma} = \begin{pmatrix}
+  0 & 0 & 0 \\
+  0 & 0 & \sigma_L \frac{r}{R} \\
+  0 & \sigma_L \frac{r}{R} & 0
+\end{pmatrix}. \]
+
+\textbf{Solution for d):} \\
+We can calculate the elastic energy as:
+\[ u = \frac{1}{2} \TT{\sigma} : \TT{u} = \frac{\sigma_L^2}{2 \mu} \frac{r^2}{R^2}. \]
+Given that $u = \frac{W}{V}$, we can integrate the elastic energy over the entire volume of the beam to find the work done by the applied stress:
+\[ W = \int_V u \, dv = \frac{\sigma_L^2}{2 \mu R^2} \int r^3 d\phi dr dz = \frac{\sigma_L^2}{2 \mu R^2} \frac{2 \phi L}{4 R^2} = \frac{\sigma_L^2 \pi R^2 L}{4 \mu}. \]
+
+\newpage
+
+\begin{Problem}
+  Consider a transverse plane wave, $\vec{u} = \vec{a} \exp[ i(\vec{k} \cdot \vec{r} - \omega t) ]$, propagating through an elastic solid. The solid is homogeneous, isotropic and has Lame coefficients $\lambda$ and $\mu$.
+
+  \begin{enumerate}
+    \item Show that the propagation of these waves does not involve volume changes.
+
+    \item Assume now that the wave propagates along the $\hat{x}$ direction. Calculate the stress tensor and justify why we call these waves, \textit{shear waves}.
+
+    \item Now consider a longitudinal wave. Show that $\curl \vec{u} = 0$. Hint: You may consider using the Levi-Civita symbol.
+  \end{enumerate}
+
+  Assume now that the wave propagates along the $\hat{x}$ direction. Confirm there are no off-diagonal terms in Cauchy's strain tensor. Hence, these waves propagate without shear distorsions; only normal stresses are involved. That's why we often refer to them as \textit{pressure or compressional waves}.
+\end{Problem}
+
+\textbf{Solution for a):} \\
+\[ \nabla \vec{u} = \Tr \vec{\TT{u}} = i \exp[i(\vec{k} \cdot \vec{r} - \omega t)] \vec{a} \cdot \vec{k}, \]
+as we calculate in the following subsection. But since $\vec{a}$ and $\vec{k}$ are orthogonal, we have that $\nabla \vec{u} = 0$, and therefore the volume of the elastic solid remains invariant.
+
+\textbf{Solution for b):} \\
+\[ \TT{u} = \frac{1}{2} [\nabla \vec{u} + (\nabla \vec{u})^t] = i \exp[ i(\vec{k} \cdot \vec{r} - \omega t) ] \frac{1}{2} \begin{pmatrix}
+  2 a_x k_x & a_y k_x + a_x k_y & a_z k_x + a_x k_z \\
+  a_x k_y + a_y k_x & 2 a_y k_y & a_z k_y + a_y k_z \\
+  a_x k_z + a_z k_x & a_y k_z + a_z k_y & 2 a_z k_z
+\end{pmatrix} = \]
+\[ = i \exp[ i(\vec{k} \cdot \vec{r} - \omega t) ] \frac{1}{2} \left[ \begin{pmatrix}
+  k_x \\
+  k_y \\
+  k_z
+\end{pmatrix} \begin{pmatrix}
+  a_x & a_y & a_z
+\end{pmatrix} + \begin{pmatrix}
+  a_x \\
+  a_y \\
+  a_z
+\end{pmatrix} \begin{pmatrix}
+  k_x & k_y & k_z
+\end{pmatrix} \right]. \]
+
+From the previous expression we have that $\Tr (\TT{u}) = i \exp[ i(\vec{k} \cdot \vec{r} - \omega t) ] \vec{k} \cdot \vec{a} = 0$, so by using Hooke's law, we get:
+\[ \TT{\sigma} = i \exp[ i(\vec{k} \cdot \vec{r} - \omega t) ] 2 \mu \left[ \begin{pmatrix}
+  k_x \\
+  k_y \\
+  k_z
+\end{pmatrix} \begin{pmatrix}
+  a_x & a_y & a_z
+\end{pmatrix} + \begin{pmatrix}
+  a_x \\
+  a_y \\
+  a_z
+\end{pmatrix} \begin{pmatrix}
+  k_x & k_y & k_z
+\end{pmatrix} \right]. \]
+
+Due to the fact that $\vec{k} = k \hat{x}$, so $k_y = k_z = 0$, we get:
+\[ \TT{\sigma} = i \exp[ i(\vec{k} \cdot \vec{r} - \omega t) ] \mu \begin{pmatrix}
+  0 & a_y k_x & a_z k_x \\
+  a_y k_x & 0 & 0 \\
+  a_z k_x & 0 & 0
+\end{pmatrix}. \]
+
+Since there are no diagonal terms, there are only shear stresses.
+
+\textbf{Solution for c):} \\
+\[ (\curl \vec{u})_i = \varepsilon_{ijk} \partial_j u_k = \varepsilon_{ijk} i k_j u_k = i (\vec{k} \cross \vec{u}), \]
+but since for longitudinal waves $\vec{k}$ is parallel to $\vec{u}$ (because of their definition), we have that $\curl \vec{u} = 0$.
+
+\textbf{Solution for d):} \\
+\[ \vec{u} = a \exp[i(kx - \omega t)] \hat{x}. \]
+Therefore:
+\[ \nabla \vec{u} = aik \exp[i(kx - \omega t)] e_{xx}, \]
+which means
+\[ \TT{u} = aik \exp[i(kx - \omega t)] e_{xx}. \]
+Applying Hooke's law, we have that the only non-zero components of $\TT{\sigma}$ are:
+\[ \sigma_{xx} = (2 \mu + \lambda) u_{xx}, \]
+\[ \sigma_{yy} = \sigma_{zz} = \lambda u_{xx}. \]
+We have confirmed that $\TT{\sigma}$ is diagonal, which means there are only normal stresses (no shearing).
+
+\end{document}
diff --git a/quad8/continuummechanics/homework/hw6/Vilanova_Martinez_Adria_HW6_revised.pdf b/quad8/continuummechanics/homework/hw6/Vilanova_Martinez_Adria_HW6_revised.pdf
new file mode 100644
index 0000000..b26cf73
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw6/Vilanova_Martinez_Adria_HW6_revised.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw6/main.pdf b/quad8/continuummechanics/homework/hw6/main.pdf
new file mode 100644
index 0000000..b26cf73
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw6/main.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw6/main.tex b/quad8/continuummechanics/homework/hw6/main.tex
new file mode 100644
index 0000000..9e550ca
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw6/main.tex
@@ -0,0 +1,392 @@
+\documentclass[11pt,a4paper,dvipsnames]{article}
+\usepackage[utf8]{inputenc}
+
+\input{../preamble.tex}
+
+\newcommand\myfunc[5]{%
+  \begingroup
+  \setlength\arraycolsep{0pt}
+  #1\colon\begin{array}[t]{c >{{}}c<{{}} c}
+             #2 & \to & #3 \\ #4 & \mapsto & #5
+          \end{array}%
+  \endgroup}
+
+\usepackage{biblatex}
+\addbibresource{references.bib}
+
+\title{Homework 6\\Continuum Mechanics}
+\author{Adrià Vilanova Martínez}
+\date{May 9, 2021}
+
+\begin{document}
+
+\maketitle
+
+\begin{Problem}
+  A liquid is subjected to the following velocity gradient:
+  \[ \grad \vec{v} = ( \text{grad} \, \vec{v} )^T = \begin{pmatrix}
+    \alpha & \beta & 0 \\
+    - \frac{\beta}{2} & - \frac{\alpha}{2} & 0 \\
+    0 & 0 & 0
+  \end{pmatrix}, \]
+  where $\alpha, \beta \in \mathbb{R}$. It is clear that the flow is two-dimensional.
+
+  Characterize local deformation rates, that is, calculate local strain rates (elongations, which are often called dilations, and shear). Characterize also local rotation rates.
+\end{Problem}
+
+\Solution
+We can calculate the symmetric and antisymmetric parts of $\text{grad} \, \vec{v}$:
+\[ \TT{e} = \frac{1}{2} [ \nabla \vec{v} + (\nabla \vec{v})^T ] = \begin{pmatrix}
+  \alpha & \frac{1}{4} \beta & 0 \\
+  \frac{1}{4} \beta & - \frac{1}{2} \alpha & 0 \\
+  0 & 0 & 0
+\end{pmatrix}, \]
+\[ \TT{w} = \frac{1}{2} [ - \nabla \vec{v} + (\nabla \vec{v})^T ] = \begin{pmatrix}
+  0 & - \frac{3}{4} \beta & 0 \\
+  \frac{3}{4} \beta & 0 & 0 \\
+  0 & 0 & 0
+\end{pmatrix}. \]
+
+The diagonal terms of $\grad \vec{v}$ (which are the same as the ones in $\TT{e}$) represent the relative change in elongation of the fluid element in each direction, so that means that locally:
+\[ \begin{cases}
+  \displaystyle \frac{\Delta l_x}{l_x} \approx \alpha \Delta t, \\[3ex]
+  \displaystyle\frac{\Delta l_y}{l_y} \approx - \frac{1}{2} \alpha \Delta t, \\[3ex]
+  \displaystyle \frac{\Delta l_z}{l_z} = 0.
+\end{cases}
+\]
+
+Therefore, we know the fluid elongates along the $x$-direction, and dilates along the $y$-direction. Also, given that $\Tr \TT{e} = \frac{1}{2} \alpha$, we know the fluid behaves in an incompressible manner only if $\alpha = 0$.
+
+We also know that the off-diagonal terms of $\TT{e}$ are related to local shear. In effect, we know that locally the change of a $\SI{90}{\degree}$ angle with respect to time is
+\[ \frac{d \gamma}{dt} = - 2 e_{12} = - \frac{1}{2} \beta. \]
+
+Finally, $\TT{w}$ characterizes local rotation rates. In fact, the dual vector associated with $\TT{w}$ ($\vec{w}$) lets us define the vortex vector $\vec{\Omega} = \frac{1}{2} \vec{w}$ which represents the local angular velocity of rotation of a fluid element. Thus, we have:
+\[ \vec{\Omega} = \frac{1}{2} \vec{w} = \begin{pmatrix}
+  0 \\
+  0 \\
+  \frac{3}{4} \beta
+\end{pmatrix}. \]
+
+\begin{Problem}
+  In this problem, we are going to work a bit more with Stokes' stream function; that is, the stream function for incompressible flows with axisymmetry.
+
+  \begin{enumerate}[a)]
+    \item Consider cylindrical coordinates $(r, \phi, z)$ and a flow in the $rz$-plane (a flow with cylindrical, or axial, symmetry about the $z$-axis).
+
+    Verify that by choosing the stream function such that $v_r = \frac{1}{r} \partial_z \psi$ and $v_z = - \frac{1}{r} \partial_r \psi$, the incompressibility condition is automatically fulfilled.
+
+    Then show that the velocity derives from the potential vector $\vec{A} = - \frac{1}{r} \psi \hat{e}_\phi$.
+
+    \item Now consider spherical coordinates $(r, \theta, \phi)$ and a flow in the $r \theta$ plane (a flow with azimuthal symmetry).
+
+    Verify that by choosing the stream function such that $v_r = \frac{1}{r^2 \sin \theta} \partial_\theta \psi$ and $v_\theta = - \frac{1}{r \sin \theta} \partial_r \psi$, the incompressibility condition is automatically fulfilled.
+
+    Then show that the velocity derives from the potential vector $\vec{A} = \frac{1}{r \sin \theta} \psi \hat{e}_\phi$.
+  \end{enumerate}
+\end{Problem}
+
+\Solution
+We will show a more general result which includes the 2 previous cases:
+
+Suppose we have a transformation from the cartesian coordinates $(x, y, z)$ to a new set of orthogonal coordinates $(q_1, q_2, q_3)$. Let's call the inverse transformation $\varphi$, which is a parametrization of a domain of $\mathbb{R}^3$ such that:
+\[ \myfunc{\varphi}{U}{\mathbb{R}^3}{(q_1, q_2, q_3)}{(x, y, z).} \]
+
+Then this parametrization has an associated second-rank metric tensor in each point called the matric tensor defined as $g_{ij} = \varphi_i \cdot \varphi_j$, where $\varphi_i = \partial_i \varphi$. This tensor is similar to the first fundamental form of surfaces, because it gives us the metrics in the new coordinate system.
+
+Since the new coordinate system is orthogonal, by definition the only non-zero components of the tensor are the ones in the diagonal. Then, thanks to the development done at \cite{se} we can calculate the rotational of a vector field $V$ expressed in the new coordinate system as:
+\[ \curl V = \frac{1}{\sqrt{\det \TT{g}}} \begin{vmatrix}
+  \hat{q}_1 \sqrt{g_{11}} & \partial_{q_1} & V_1 \sqrt{g_{11}} \\
+  \hat{q}_2 \sqrt{g_{22}} & \partial_{q_2} & V_2 \sqrt{g_{22}} \\
+  \hat{q}_3 \sqrt{g_{33}} & \partial_{q_3} & V_3 \sqrt{g_{33}}
+\end{vmatrix}. \]
+If we define $h_i := g_{ii}$, we can express the previous formula in a more compact form:
+\[ \curl V = \frac{1}{h_1 h_2 h_3} \begin{vmatrix}
+  \hat{q}_1 h_1 & \partial_{q_1} & V_1 h_1 \\
+  \hat{q}_2 h_2 & \partial_{q_2} & V_2 h_2 \\
+  \hat{q}_3 h_3 & \partial_{q_3} & V_3 h_3
+\end{vmatrix}. \]
+
+Now, we'll state the more general result: under the previous assumptions, given a function $\psi$ (called the stream function) and a potential vector $\vec{A} = \frac{1}{h_i} \psi \hat{e}_{q_i}$, then the conditions that $\psi$ should satisfy so the fluid is incompressible are:
+\[ \vec{v} = \curl \vec{A} = \frac{1}{h_1 h_2 h_3} \begin{vmatrix}
+  \hat{q}_1 h_1 & \partial_{q_1} & A_1 h_1 \\
+  \hat{q}_2 h_2 & \partial_{q_2} & A_2 h_2 \\
+  \hat{q}_3 h_3 & \partial_{q_3} & A_3 h_3
+\end{vmatrix} = \frac{1}{h_1 h_2 h_3} \begin{vmatrix}
+  \hat{q}_1 h_1 & \partial_{q_1} & \psi \delta_{1i} \\
+  \hat{q}_2 h_2 & \partial_{q_2} & \psi \delta_{2i} \\
+  \hat{q}_3 h_3 & \partial_{q_3} & \psi \delta_{3i}
+\end{vmatrix}. \]
+This is because since the divergence of the rotational of a vector field is 0, the fluid would be automatically compressible if it satisfies these conditions.
+
+\textbf{Solution for a):}
+\[ \curl \vec{A} = - \frac{1}{r} \begin{vmatrix}
+  \hat{r} & \partial_r & - A_r \\
+  r \hat{\phi} & \partial_\phi & r (- A_\phi) \\
+  \hat{z} & \partial_z & - A_z
+\end{vmatrix} = - \frac{1}{r} \begin{vmatrix}
+  \hat{r} & \partial_r & 0 \\
+  r \hat{\phi} & \partial_\phi & \psi \\
+  \hat{z} & \partial_z & 0
+\end{vmatrix} = \begin{pmatrix}
+  \frac{1}{r} \partial_z \psi \\
+  0 \\
+  - \frac{1}{r} \partial_r \psi
+\end{pmatrix} = \vec{v}, \]
+which confirms that the velocity $\vec{v}$ derives from the potential vector $\vec{A}$, and automatically we have that the fluid is incompressible (it can also be manually checked by calculating $\div \vec{v}$ and checking it is equal to zero, but we've already shown it is true).
+
+\textbf{Solution for b):}
+\[ \curl \vec{A} = \frac{1}{r^2 \sin \theta} \begin{vmatrix}
+  \hat{r} & \partial_r & A_r \\
+  r \hat{\theta} & \partial_\theta & r A_\theta \\
+  r \sin \theta \hat{\phi} & \partial_\phi & r \sin \theta A_\phi
+\end{vmatrix} = \frac{1}{r^2 \sin \theta} \begin{vmatrix}
+  \hat{r} & \partial_r & 0 \\
+  r \hat{\theta} & \partial_\theta & 0 \\
+  r \sin \theta \hat{\phi} & \partial_\phi & \psi
+\end{vmatrix} = \begin{pmatrix}
+  \frac{1}{r^2 \sin \theta} \partial_\theta \psi \\
+  0 \\
+  - \frac{1}{r \sin \theta} \partial_r \psi
+\end{pmatrix} = \vec{v}, \]
+which confirms that the velocity $\vec{v}$ derives from the potential vector $\vec{A}$, and automatically we have that the fluid is incompressible.
+
+\begin{Problem}
+  The velocity field of a certain two-dimensional vortex, in polar plane coordinates, is given by:
+  \[ \begin{cases}
+    v_r = 0, \\[1ex]
+    v_\theta = \left\{\begin{array}{ll}
+      \dfrac{\Omega r}{2}, & r < a, \\
+      \dfrac{\Omega a^2}{2r}, & r > a,
+    \end{array}\right.
+  \end{cases} \]
+  where $a$ is the extension of the vortex core and $\Omega$ measures the vortex intensity.
+
+  \begin{enumerate}[a)]
+    \item Show that the flow is incompressible and compute the stream function.
+    \item Compute and draw schematically the streamlines and the particle trajectories.
+    \item Compute the vorticity and the velocity potential in the region where it can be defined.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):}
+\[ \div \vec{v} = \frac{1}{r} \left[ \partial_r (r v_r) + \partial_\theta (v_\theta) \right] = \frac{1}{r} \left[ 0 + 0 \right] = 0, \]
+so the flow is incompressible.
+
+From the theoretical development done in class, we know the stream function satisfies:
+\[ \begin{cases}
+  r v_r = \partial_\theta \psi, \quad \text{(1)} \\
+  - v_\theta = \partial_r \psi. \quad \text{(2)}
+\end{cases} \]
+
+Subtituting the velocity field in (1) we obtain:
+\[ 0 = \partial_\theta \psi \implies \psi = \tilde{c} + g(r). \]
+
+We can now substitue both the velocity field and the previous expression in (2).
+
+For $r \leq a$:
+\[ - \frac{\Omega r}{2} = \partial_r(c + g(r)) = g'(r) \implies g(r) = - \frac{\Omega r^2}{4} + d. \]
+
+For $r > a$:
+\[ - \frac{\Omega a^2}{2r} = g'(r) \implies g(r) = - \frac{\Omega a^2}{2} \log(r) + \tilde{d}. \]
+
+Since $\psi$ has to be differentiable (and therefore continuous), we have that:
+\[ - \frac{\Omega a^2}{4} + d = - \frac{\Omega a^2}{2} \log(a) + \tilde{d} \implies \tilde{d} = d - \frac{\Omega a^2}{2} \left( \frac{1}{2} - \log(a) \right), \]
+and thus:
+\[ \psi(r) = \left\{\begin{array}{ll}
+  - \dfrac{\Omega r^2}{4} + c, & r \leq a \\[2ex]
+  - \dfrac{\Omega a^2}{2} \left( \log\left(\dfrac{r}{a}\right) + \dfrac{1}{2} \right) + c, & r > a
+\end{array}\right. \]
+where $c \in \mathbb{R}$ is a constant.
+
+\textbf{Solution for b):} \\
+The streamlines are given by the set of points satsfying $\psi = \text{const}$.
+
+Therefore, for $r \leq a$:
+\[ \frac{\Omega r^2}{4} + c = C \implies r = \left( \frac{4}{\Omega} (C - c) \right)^{\frac{1}{2}} = \text{const}, \]
+and this means streamlines are concentric circles with center $0$.
+
+For $r > a$:
+\[ \frac{\Omega a^2}{4} \left( \log(\frac{r}{a}) \right) + c = C \implies r = \text{const}, \]
+and this means streamlines are again concentric circles with center $0$.
+
+With regards to the particle trajectories, these are the curves $\gamma(t)$ solution to the following Cauchy problem:
+\[ \begin{cases}
+  \dot{\gamma}(t) = v(\gamma(t)), \quad \text{(1)} \\
+  \gamma(0) = p_0 = \begin{pmatrix}
+    r_0 \\
+    \theta_0
+  \end{pmatrix}, \quad \text{(2)}
+\end{cases} \]
+which by Picard's theorem exist and are unique when the initial condition $p_0$ is fixed (because $\vec{v}$ is globally Lipschitz).
+
+Let's find their parametrization (in this section, $F_i(t)$ means the $i$-component of $F(t)$ and not its partial derivative with respect to $i$).
+
+If we take a look into the radial component of the trajectory/curve:
+\[ \text{(1)} \implies \dot{\gamma}_r(t) = 0 \implies \gamma_r(t) = c = r_0. \]
+Therefore, particles will always move in trajectories inscribed in a circle.
+
+Now, for particles for which $r \leq a$:
+\[ \text{(1)} \implies \dot{\gamma}_\theta(t) = \frac{1}{2} \Omega \gamma_r(t) \implies \gamma_\theta(t) = \dfrac{1}{2} \Omega r_0 t + d, \]
+where $d \in \mathbb{R}$ is a constant. If we impose the initial condition, we find
+\[ \theta_0 = \gamma_\theta(0) = d. \]
+Note that the origin is a stagnation point.
+
+For points in which $r > a$:
+\[ \text{(1)} \implies \dot{\gamma}_\theta(t) = \frac{1}{2 \gamma_r(t)} \Omega a^2 \implies \gamma_\theta(t) = \dfrac{1}{2 r_0} \Omega a^2 t + d, \]
+where $d \in \mathbb{R}$ is a constants. If we impose the initial condition, we find
+\[ \theta_0 = \gamma_\theta(0) = d. \]
+
+Therefore, the particle trajectories are:
+\[ \gamma(t) = \left\{\begin{array}{ll}
+  \begin{pmatrix}
+    r_0 \\
+    \dfrac{1}{2} r_0 \Omega t + \theta_0
+  \end{pmatrix}, & r_0 \leq a, \\[3ex]
+  \begin{pmatrix}
+    r_0 \\
+    \dfrac{a^2}{2 r_0} \Omega t + \theta_0
+  \end{pmatrix}, & r_0 > a.
+\end{array}\right. \]
+
+\begin{figure}[H]
+  \centering
+  \includegraphics[width=8cm]{streamlines_trajectories.pdf}
+  \caption{Drawing showing the streamlines and particle trajectories (which are the same), along with the velocity profile.}
+\end{figure}
+
+\textbf{Solution for c):}
+\[ \vec{\omega} = \curl \vec{v} = \frac{1}{r} \begin{vmatrix}
+  \hat{r} & \partial_r & 0 \\
+  r \hat{\theta} & \partial_\theta & r v_\theta \\
+  \hat{z} & \partial_z & 0
+\end{vmatrix} = \frac{1}{r} \begin{pmatrix}
+  - r \partial_z v_\theta \\
+  0 \\
+  \partial_r (r v_\theta)
+\end{pmatrix} = \frac{1}{r} \begin{pmatrix}
+  0 \\
+  0 \\
+  \partial_r (r v_\theta)
+\end{pmatrix} = \partial_r (r v_\theta) \hat{e}_z \implies \]
+\[ \vec{\omega} = \left\{\begin{array}{ll}
+  \partial_r \left( \dfrac{\Omega}{2} r^2 \right) = \Omega r, & r < a, \\[2ex]
+  \partial_r \left( \dfrac{\Omega a^2}{2} \right) = 0, & r > a.
+\end{array}\right. \]
+
+Note that $\vec{\omega}$ is not generally defined at points in which $r = a$, because $\vec{v}$ isn't differentiable there. The only case in which it is differentiable is the following:
+\[ \lim_{r \to a^-} \partial_r v = \lim_{r \to a^+} \partial_r v \iff \frac{\Omega}{2} = - \frac{\Omega}{2} \iff \Omega = 0, \]
+which corresponds to the case in which the velocity field is exactly 0 in all points (the fluid is still), which is a degenerate case.
+
+In the subset $\{ (r, \theta, z) \, : \, r > a \} \subset \mathbb{R}^3$ the vorticity vector is $\vec{w} = 0$, and so we can define the velocity potential $\Phi$ (which satisfies $\vec{v} = \grad \Phi$). Let's find it:
+\[ \begin{pmatrix}
+  0 \\
+  \dfrac{\Omega a^2}{2 r}
+\end{pmatrix} = \vec{v} = \grad \Phi = \begin{pmatrix}
+  \partial_r \Phi \\
+  \dfrac{1}{r} \partial_\theta \Phi
+\end{pmatrix} \implies \left\{\begin{array}{l}
+  \Phi = g(\theta) + \tilde{c} \\
+  \dfrac{\Omega a^2}{2} = g'(\theta) \implies g(\theta) = \dfrac{1}{2} \Omega a^2 \theta + d
+\end{array}\right\} \implies \]
+\[ \implies \Phi(r, \theta, z) = \frac{1}{2} \Omega a^2 \theta + c, \]
+where $c \in \mathbb{R}$ is a constant.
+
+\begin{Problem}
+  In class, we have analyzed the flow $\vec{v} = (ax, -ay, 0)$, with $a \in \mathbb{R}$. In this case,
+  \[ \TT{G} = \text{grad} \, \vec{v} = \begin{pmatrix}
+    a & 0 \\
+    0 & -a
+  \end{pmatrix} = \TT{e} = \dev \TT{e}. \]
+
+  We have also analyzed flow with stream function $\psi = c (y^2 - x^2)$, with $c \in \mathbb{R}$. In this case,
+  \[ \TT{G} = \text{grad} \, \vec{v} = \begin{pmatrix}
+    0 & 2c \\
+    2c & 0
+  \end{pmatrix} = \TT{e} = \dev \TT{e}. \]
+
+  Prove that if $a = 2c$, the two flows are the same except for a $\frac{\pi}{4}$ rotation. This illustrates that we can think of pure shear flow as pure elongational flow along directions oriented at $\frac{\pi}{4}$ relative to the original directions.
+\end{Problem}
+
+\Solution
+For the first flow, we saw in class that the streamlines were the hyperbolas
+\[ y = \frac{b}{x}, \quad b \in \mathbb{R}, \]
+and that the origin was a stagnation point. We also saw that particles followed the following trajectories:
+\[ \gamma(t) = \begin{pmatrix}
+  x_0 e^{at} \\
+  y_0 e^{-at} \\
+  z_0
+\end{pmatrix}, \]
+depending on the initial position $(x_0, y_0, z_0)$ at time $0$ (since $a$ is constant, the ODE is autonomous).
+
+For the first flow, we can easily calculate the streamlines due to the fact that in them the stream function is constant. This gives us the following streamlines:
+\[ y = \pm \sqrt{x^2 + c}, \]
+where $c \in \mathbb{R}$ is a constant.
+
+Also, in class we calculated the velocity field (modulus a sign), which is:
+\[ \vec{v} = 2c (y, x). \]
+
+If we impose $a = 2c$, we have $\vec{v} = a(y, x)$, then the field $\vec{v}_2$ resulting of a $\frac{\pi}{4}$ rotation around the center will satisfy the following formula (where we've taken into account the rotation of the 3-dimensional space and the rotation of the free vectors):
+\[ \vec{v}_2 = A \vec{v}(A^{-1} (x, y)), \]
+where $A$ is the rotation matrix of angle $\theta = - \frac{\pi}{4}$.
+
+\[ A^{-1}(x, y) = \begin{pmatrix}
+  \cos(- \theta) & - \sin(- \theta) \\
+  \sin(- \theta) & \cos(- \theta)
+\end{pmatrix} \begin{pmatrix}
+  x \\
+  y
+\end{pmatrix} = \begin{pmatrix}
+  \cos(\theta) & \sin(\theta) \\
+  - \sin(\theta) & \cos(\theta)
+\end{pmatrix} \begin{pmatrix}
+  x \\
+  y
+\end{pmatrix}, \]
+\[ A\vec{v}(A^{-1}(x, y)) = a \begin{pmatrix}
+  \cos(\theta) & - \sin(\theta) \\
+  \sin(\theta) & \cos(\theta)
+\end{pmatrix} \begin{pmatrix}
+  0 & 1 \\
+  1 & 0
+\end{pmatrix} \begin{pmatrix}
+  \cos(\theta) & \sin(\theta) \\
+  - \sin(\theta) & \cos(\theta)
+\end{pmatrix} \begin{pmatrix}
+  x \\
+  y
+\end{pmatrix} = \]
+\[ = a \begin{pmatrix}
+  \cos(\theta) & - \sin(\theta) \\
+  \sin(\theta) & \cos(\theta)
+\end{pmatrix} \begin{pmatrix}
+  - \sin(\theta) x + \cos(\theta) y \\
+  \cos(\theta) x + \sin(\theta) y
+\end{pmatrix} = a \begin{pmatrix}
+  - 2 \sin(\theta) \cos(\theta) x + (\cos^2(\theta) - \sin^2(\theta)) y \\
+  (\cos^2(\theta) - \sin^2(\theta)) x + 2 \sin(\theta) \cos(\theta) y
+\end{pmatrix} = \]
+\[ = a \begin{pmatrix}
+  x \\
+  - y
+\end{pmatrix}. \]
+
+Therefore, the flow is the same in both cases, rotated by an angle $\theta = -\frac{\pi}{4}$ (the minus is there because the rotation is anticlockwise).
+
+\begin{Problem}
+  Show that the vorticity flux, $\int_A \vec{\omega} \cdot d\vec{S}$, is constant along a vorticity tube.
+\end{Problem}
+
+\Solution
+%Since $\vec{\omega} = \curl \vec{v}$, using Stokes' theorem:
+%\[ \int_A \vec{\omega} \cdot d\vec{S} = \int_A (\curl \vec{v}) \cdot d\vec{S} = \int_C \vec{v} \cdot d\vec{l} \]
+Let's consider 2 sections of the tube $S_1$, $S_2$, and the lateral surface along the stream tube $S_L$. Then, since $\div \vec{\omega} = 0$ everywhere, using the Divergence Theorem we have that:
+\[ 0 = \int_{V} \div \vec{\omega} \, dv = \oint_{S_1 \cup S_2 \cup S_L} \vec{\omega} \cdot d\vec{S} = \int_{S_1} \vec{\omega} \cdot d\vec{S} + \int_{S_2} \vec{\omega} \cdot d\vec{S} + \int_{S_L} \vec{\omega} \cdot d\vec{S}. \]
+Since the lateral surface is the surface of the vortex tube, which is a surface formed by the vortex lines (lines parallel to the vorticity vector), the normal vector to the surface is perpendicular to the vorticity vector, and thus the flux of the vorticity vector through the the lateral surface is zero. Thus, we have:
+\[ \int_{S_1} \vec{\omega} \cdot d\vec{S} + \int_{S_2} \vec{\omega} \cdot d\vec{S} = 0, \]
+where the orientation of $d\vec{S}$ is the one which points outside of the volume $V$ enclosed by the surface $S_1 \cup S_2 \cup S_L$. If we take the orientation of the normal vector to the surface such that $\vec{n} \cdot \vec{w} \geq 0$, we have to reverse one of the normal vectors in the previous expression, and we get:
+\[ \int_{S_1} \vec{\omega} \cdot d\vec{S} = \int_{S_2} \vec{\omega} \cdot d\vec{S}, \]
+which is what we wanted to prove.
+
+\printbibliography
+
+\end{document}
diff --git a/quad8/continuummechanics/homework/hw6/references.bib b/quad8/continuummechanics/homework/hw6/references.bib
new file mode 100644
index 0000000..67fd916
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw6/references.bib
@@ -0,0 +1,4 @@
+@online{se,
+  title={Curl in cylindrical coordinates - StackExchange Mathematics},
+  url={https://math.stackexchange.com/a/2160871}
+}
diff --git a/quad8/continuummechanics/homework/hw6/streamlines_trajectories.pdf b/quad8/continuummechanics/homework/hw6/streamlines_trajectories.pdf
new file mode 100644
index 0000000..9426080
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw6/streamlines_trajectories.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw7/main.pdf b/quad8/continuummechanics/homework/hw7/main.pdf
new file mode 100644
index 0000000..f12338e
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw7/main.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw7/main.tex b/quad8/continuummechanics/homework/hw7/main.tex
new file mode 100644
index 0000000..22e7838
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw7/main.tex
@@ -0,0 +1,301 @@
+\documentclass[11pt,a4paper,dvipsnames]{article}
+\usepackage[utf8]{inputenc}
+
+\input{../preamble.tex}
+
+\title{Homework 7\\Continuum Mechanics}
+\author{Adrià Vilanova Martínez}
+\date{May 16, 2021}
+
+\begin{document}
+
+\maketitle
+
+\begin{Problem}
+  In this problem we are going to work a bit with the continuity equation.
+
+  \begin{enumerate}[a)]
+    \item Show that constant density implies the fluid is incompressible. That is, show that $\rho = \text{cte.} \implies \div \vec{v} = 0$.
+
+    \item Now consider an incompressible fluid. Show that this implies that the Lagrangian derivative of the density is zero. That is, that $\frac{d\rho}{dt} = 0$.
+  \end{enumerate}
+
+  This means that the density of a fluid particle, which moves with the fluid, has constant density. It does not mean that the density of a fixed fluid region is constant. In fact, for incompressible fluids, the local (or Eulerian) rate of change of the density is related to its spatial variation, that is, $\frac{\partial \rho}{\partial t} = - \vec{v} \cdot \grad \rho$.
+\end{Problem}
+
+\textbf{Solution for a):} \\
+The continuity equation is
+\[ \frac{\partial \rho}{\partial t} + \div (\rho \vec{v}) = 0. \]
+By imposing $\rho = \text{cte.}$, we obtain:
+\[ 0 + \rho \div \vec{v} = 0 \implies \div \vec{v} = 0. \]
+
+\textbf{Solution for b):} \\
+An alternative expression for the continuity equation shown in theory class is as follows:
+\[ \frac{d \rho}{dt} + \rho \div \vec{v} = 0. \]
+This was derived easily by using the identity for the divergence of a scalar fields times a vectorial field, and also by using the definition of the total derivative (also known as material derivative).
+
+Since the fluid is incompressible, this means that $\div \vec{v} = 0$, and therefore:
+\[ \frac{d \rho}{dt} = 0. \]
+
+\begin{Problem}
+  In this problem we are going to work a bit with the equation of motion of a fluid. That is, with Newton's second law applied to a material particle.
+
+  \begin{enumerate}[a)]
+    \item Start by using index notation and showing that
+    \[ \div (\rho \vec{v} \vec{v}) = \rho \vec{v} \cdot \grad \vec{v} + \vec{v} \div (\rho \vec{v}). \]
+  \end{enumerate}
+\end{Problem}
+
+\Solution
+The $j$-component of the right-hand side in index notation is:
+\[ (\text{RHS})_j = \rho v_i \partial_i v_j + v_j \partial_i (\rho v_i) = \rho v_i \partial_i v_j + v_i v_j \partial_i \rho + \rho v_j \partial_i v_i, \]
+and the $j$-component of the left-hand side is:
+\[ (\text{LHS})_j = \partial_i ( \rho v_i v_j ) = v_i v_j \partial_i \rho + \rho v_j \partial_i v_i + \rho v_i \partial_i v_j. \]
+
+Both expressions are the same $\forall j$, so $(\text{LHS}) = (\text{RHS})$.
+
+\begin{FreeProblem}
+  \begin{enumerate}[a)]
+    \setcounter{enumi}{1}
+    \item Then use what we called in class Reynolds' transport theorem, which is nothing but Leibniz's rule generalized to 3-dimensions, together with the continuity equation, to show that
+    \[ \frac{d}{dt} \int_{V(t)} \rho \vec{v} \, dv = \int_{V(t)} \rho \frac{d \vec{v}}{dt} \, dv \]
+    where we have written $V(t)$ to emphasize that the volume co-moves with the fluid.
+
+    Using this result, Newton's second law applied to a material particle becomes:
+    \[ \rho \frac{d \vec{v}}{dt} = \vec{f}^* = \vec{f} + \div \TT{\sigma} = \rho \left( \frac{\partial \vec{v}}{\partial t} + \vec{v} \cdot \grad \vec{v} \right) \]
+    where we have used the relation between total (Lagrangian) and local (Eulerian) accelerations in the last step, and the fact that the stress tensor is symmetric. This equation governs the behavior of all continuous matter.
+  \end{enumerate}
+\end{FreeProblem}
+
+\Solution
+Via Reynolds' transport theorem, we have:
+\[ \frac{d}{dt} \int_{V(t)} \rho \vec{v} \, dv = \int_{V(t)} \partial_t (\rho \vec{v}) \, dv + \int_{\partial V(t)} (\vec{v} \cdot n) \rho \vec{v} \, dS = \]
+\[ = \int_{V(t)} \left( \rho \frac{d \vec{v}}{dt} + \frac{\partial \rho}{\partial t} \vec{v} \right) \, dv + \int_{\partial V(t)} (\vec{v} \cdot n) \rho \vec{v} \, dS \notate[X]{{}={}}{1}{\text{\scriptsize Eq. of continuity}} \]
+\[ = \int_{V(t)} \rho \frac{d \vec{v}}{dt} \, dv - \int_{V(t)} \div (\rho \vec{v}) \, dv + \int_{\partial V(t)} (\vec{v} \cdot n) \rho \vec{v} \, dS \notate[X]{{}={}}{1}{\text{\scriptsize Divergence th.}} \]
+\[ = \int_{V(t)} \rho \frac{d \vec{v}}{dt} \, dv - \int_{\partial V(t)} (\rho \vec{v} \cdot n) \, dS + \int_{\partial V(t)} (\vec{v} \cdot n) \rho \vec{v} \, dS = \int_{V(t)} \rho \frac{d \vec{v}}{dt} \, dv. \]
+
+
+\begin{FreeProblem}
+  \begin{enumerate}[a)]
+    \setcounter{enumi}{2}
+    \item Let's now consider a fluid. We first separate out of the stress tensor the part corresponding to the pressure stresses, which are the only ones acting in the absence of acceleration, that is, for a fluid at rest or in uniform translational motion. Then:
+    \[ \sigma_{ij} = -p \delta_{ij} + \sigma'_{ij} \]
+    where $\TT{\sigma}'$ is called the viscosity stress tensor, which is the part of the stress tensor resulting from the deformation of the elements of the fluid. Since $\TT{\sigma}$ is symmetric, and so is $-p \TT{I}$, the viscosity stress tensor $\TT{\sigma}'$ is also symmetric. In addition, $\TT{\sigma}' = f(\TT{e})$, where $\TT{e} = \TT{t} + \TT{d}$ is the strain rate tensor [remember $\TT{G} = \text{grad} \, \vec{v} = \TT{e} + \TT{w}$], with $\TT{t}$ and $\TT{d}$ its spherical and deviatoric parts, respectively.
+
+    Show that for a Newtonian fluid, the $ij$ component of the viscosity stress tensor is:
+    \[ \sigma'_{ij} = A_{ijkl} e_{kl} = 2A e_{ij} + B e_{ll} \delta_{ij} \]
+    where $A_{ijkl}$ is a fourth rank tensor, and $A$ and $B$ are fluid properties. We call $A$ the viscosity (we usually denote it as $\eta$), and define $\xi = \frac{2}{3} \eta + B$ as the second viscosity.
+
+    \textit{Hint}: use that fluids are isotropic; this imples that $A_{ijkl}$ is an isotropic tensor. Then use that $\TT{\sigma}'$ is symmetric. Note this proof mimics the derivation of Hooke's law for linearly and isotropic elastic materials.
+
+    With these definitions of $\eta$ and $\xi$, we have:
+    \[ \sigma'_{ij} = \eta \left( 2 e_{ij} - \frac{2}{3} e_{ll} \delta_{ij} \right) + \xi e_{ll} \delta_{ij}. \]
+
+    We then see that for incompressible fluids: $\sigma'_{ij} = 2 \eta e_{ij}$.
+  \end{enumerate}
+\end{FreeProblem}
+
+\Solution
+Since $\TT{A}$ is an isotropic tensor, it must be expressed in terms of $\delta_{ij}$ (2nd-rank isotropic tensor) for it to be independent of the direction of the axis:
+\[ A_{ijkl} = c_1 \delta_{ij} \delta_{kl} + c_2 \delta_{ik} \delta_{jl} + c_3 \delta_{il} \delta_{jk}. \]
+
+Also, since we know that $\TT{\sigma}'$ is symmetric, this means $c_2 = c_3$, and then:
+\[ A_{ijkl} = c_1 \delta_{ij} \delta_{kl} + c_2 (\delta_{ik} \delta_{jl} + \delta_{il} \delta_{jk}). \]
+
+Let's call $c_1 =: B$ and $c_2 =: A$. This lets us conclude:
+\[ \sigma_{ij}' = A_{ijkl} e_{kl} = (c_1 \delta_{ij} \delta_{kl} + c_2 (\delta_{ik} \delta_{jl} + \delta_{il} \delta_{jk})) e_{kl} = c_1 \delta_{ij} e_{kk} + c_2 e_{ij} + c_2 e_{ji} \notate[X]{{}={}}{1}{\scriptstyle \TT{e} \text{ symmetric}} \]
+\[ = 2 A e_{ij} + B e_{ll} \delta_{ij}. \]
+
+\begin{FreeProblem}
+  \begin{enumerate}[a)]
+    \setcounter{enumi}{3}
+    \item Use index notation to show that the divergence of the viscosity stress tensor is:
+    \[ \div \TT{\sigma}' = \eta \nabla^2 \vec{v} + \left( \frac{\eta}{3} + \xi \right) \grad ( \div \vec{v} ). \]
+
+    Using this fact, we arrive at the Navier-Stokes equation, which is nothing but Newton's second law (or the equation of motion) for a Newtonian-fluid particle:
+    \[ \rho \left( \frac{\partial \vec{v}}{\partial t} + \vec{v} \cdot \grad \vec{v} \right) = \vec{f} - \grad p + \eta \nabla^2 \vec{v} + \left( \frac{\eta}{3} + \xi \right) \grad (\div \vec{v}). \]
+
+    For incompressible fluids, we then have:
+    \[ \rho \left( \frac{\partial \vec{v}}{\partial t} + \vec{v} \cdot \grad \vec{v} \right) = \vec{f} - \grad p + \eta \nabla^2 \vec{v}. \]
+
+    For fluids at rest or in uniform translational motion this equation becomes the usual equation describing hydrostatic equilibrium: $\vec{f} = \rho \vec{g} = \grad p$. Note that this equation is also nothing but the expression of mechanical equilibrium: $\vec{f} + \div \TT{\sigma}^T = \vec{f} + \div \TT{\sigma} = 0$, considering $\TT{\sigma}$ is symmetric and that for fluids at rest or in uniform translational motion $\TT{\sigma} = - p \TT{I}$.
+
+    There are other interesting forms and limiting cases of the Navier-Stokes equations; we've discussed some of them in class.
+  \end{enumerate}
+\end{FreeProblem}
+
+\Solution
+The right hand side can be transformed into the following expression:
+\[ \text{RHS} = \left( \frac{4 \eta}{3} + \xi \right) (\grad (\div \vec{v})) - \eta \curl (\curl \vec{v}), \]
+so the $j$-component of the right hand side in index notation is:
+\[ (\text{RHS})_j = \left( \frac{4 \eta}{3} + \xi \right) \partial_j \partial_i v_i - \eta \varepsilon_{jbc} \partial_b \varepsilon_{cde} \partial_d v_e = \]
+\[ = \left( \frac{4 \eta}{3} + \xi \right) \partial_j \partial_i v_i - \eta \varepsilon_{jbc} \varepsilon_{cde} \partial_b \partial_d v_e = \]
+\[ = \left( \frac{4 \eta}{3} + \xi \right) \partial_j \partial_i v_i - \eta (\delta_{jd} \delta_{be} - \delta_{je} \delta_{bd}) \partial_b \partial_d v_e = \]
+\[ = \left( \frac{4 \eta}{3} + \xi \right) \partial_j \partial_i v_i - \eta \delta_{jd} \delta_{be} \partial_b \partial_d v_e + \eta \delta_{je} \delta_{bd} \partial_b \partial_d v_e = \]
+\[ = \left( \frac{4 \eta}{3} + \xi \right) \partial_j \partial_i v_i - \eta \partial_b \partial_j v_b + \eta \partial_b \partial_b v_j = \]
+\[ = \left( \frac{\eta}{3} + \xi \right) \partial_j \partial_i v_i + \eta \partial_b \partial_b v_j. \]
+
+The $j$-component of the left hand side in index notation is:
+\[ (\text{LHS})_j = \partial_i \sigma'_{ij} = \partial_i \left( \eta \left( 2 e_{ij} - \frac{2}{3} e_{ll} \delta_{ij} \right) + \xi e_{ll} \delta_{ij} \right) = \]
+\[ = \eta \left( \partial_i \partial_j v_i + \partial_i \partial_i v_j - \frac{2}{3} \partial_j \partial_l v_l \right) + \xi \partial_j \partial_l v_l = \]
+\[ = \left( \frac{\eta}{3} + \xi \right) \partial_j \partial_i v_i + \eta \partial_b \partial_b v_j = \text{(RHS)}_j. \]
+
+\begin{Problem}
+  Consider the interface between two ``real'' fluids. We stated in class what the boundary conditions are for both velocity and stresses in this case. We wrote the continuity of tangential stresses at the interface as: $(\TT{\sigma}_1 \cdot \hat{n}) \cdot \hat{t} = (\TT{\sigma}_2 \cdot \hat{n}) \cdot \hat{t}$.
+
+  \begin{enumerate}[a)]
+    \item Start by showing that the condition can be written as:
+    \[ (\TT{\sigma}_1' \cdot \hat{n}) \cdot \hat{t} = (\TT{\sigma}_2' \cdot \hat{n}) \cdot \hat{t}, \]
+    where $\TT{\sigma}'$ is the viscosity stress tensor.
+
+    \item Now consider that the fluids are incompressible, that the interface lies in the $xz$ plane, and that $\vec{v}$ is locally (near the interface) along the $x$-direction and a function of the $y$-coordinate only [$\vec{v} = (v_x(y), 0, 0)$]. Show that the continuity of tangential stresses can be written as:
+    \[ \eta_1 \partial_y v_x^{(1)} = \eta_2 \partial_y v_x^{(2)}. \]
+
+    \item If $\eta_1 > \eta_2$, sketch how the velocity profile for both fluids will look like near the interface.
+
+    \item How will the velocity profile look like if fluid 2 is an ``ideal'' fluid?
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):} \\
+By definition we have that $\TT{\sigma} = - p \TT{I} + \TT{\sigma}'$. Therefore:
+\[ (\TT{\sigma} \cdot \hat{n}) \cdot \hat{t} = (\TT{\sigma}' \cdot \hat{n}) \cdot \hat{t} + p (\TT{I} \cdot \hat{n}) \cdot \hat{t} = (\TT{\sigma}' \cdot \hat{n}) \cdot \hat{t}, \]
+since all the off-diagonal components of $\TT{I}$ are zero.
+
+\textbf{Solution for b):} \\
+Let's reproduce the proof done in class. In either one of the fluids we have
+\[ \grad \vec{v} = \partial_y v_x(y) \hat{j} \hat{i} \longrightarrow \TT{e} = \frac{1}{2} \partial_y v_x(y) (\hat{j} \hat{i} + \hat{i} \hat{j}). \]
+Since $\TT{\sigma}' = 2 \eta \TT{e}$, we obtain:
+\[ \TT{\sigma}' = \eta \partial_y v_x(y) (\hat{j} \hat{i} + \hat{i} \hat{j}). \]
+Finally, imposing the boundary condition which we proved in section a), taking into account that $\hat{n} = \hat{j}$ and choosing $\hat{t} = \hat{i}$, we have:
+\[ \eta_1 \partial_y v_x^{(1)}(y) = \eta_2 \partial_y v_x^{(2)}(y), \]
+which is what we wanted to prove.
+
+\textbf{Solution for c):} \\
+Since $\eta_1 > \eta_2$:
+\[ \partial_y v_x^{(1)} < \partial_y v_x^{(2)}. \]
+
+\begin{figure}[H]
+  \centering
+  \includegraphics[width=8cm]{vprofile_3c.png}
+  \caption{Sketch of the velocity profile when $\eta_1 > \eta_2$.}
+\end{figure}
+
+\textbf{Solution for d):} \\
+If fluid 2 is an ``ideal'' fluid, this means $\eta_2 = 0$, and therefore:
+\[ \partial_y v_x^{(1)} = 0, \]
+and this means $v_x^{(1)}$ will be constant locally near the interface.
+
+We don't have more information about fluid 2, so we don't know its velocity profile.
+
+\begin{figure}[H]
+  \centering
+  \includegraphics[width=8cm]{vprofile_3d.png}
+  \caption{Sketch of the velocity profile when $\eta_2 = 0$.}
+\end{figure}
+
+\begin{Problem}
+  (Water flowing down an inclined solid surface behaves as a Newtonian incompressible fluid.)
+
+  Consider the flow field shown in figure 1.
+
+  \begin{enumerate}[a)]
+    \item If the velocity profile takes the form
+    \[ u = U \left[ a + b \frac{y}{H} - \left( \frac{y}{H} \right)^2 \right] \]
+    where $U$ is the velocity of the free surface, determine the constants $a$ and $b$.
+
+    \item Confirm that the flow is incompressible.
+
+    \item Is the flow irrotational? If not, find its vorticity.
+
+    \item Compute the magnitude of the shear stress that water exerts on the solid surface and on the free surface.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):} \\
+Let's impose the boundary conditions to determine the constants. Since there isn't slip at the interface between the solid and the fluid, we have:
+\[ 0 = u(y = 0) = a. \]
+At the free surface, we can apply the boundary condition written in the problem statement:
+\[ U = u(y = H) = U(b - 1) \implies b = 2. \]
+
+Therefore:
+\[ u = U \left[ 2 \frac{y}{H} - \left( \frac{y}{H} \right)^2 \right]. \]
+
+\textbf{Solution for b):}
+\[ \div \vec{v} = \div (u \hat{i}) = \partial_x u = 0. \]
+
+\textbf{Solution for c):}
+\[ \curl \vec{v} = \begin{vmatrix}
+  \hat{i} & \partial_x & u \\
+  \hat{j} & \partial_y & 0 \\
+  \hat{k} & \partial_z & 0
+\end{vmatrix} = \begin{pmatrix}
+  0 \\
+  \partial_z u \\
+  - \partial_y u
+\end{pmatrix} = \left( - 2U \frac{1}{H} + 2U \frac{y}{H^2} \right) \hat{k} = - \frac{2U}{H} \left( 1 - \frac{y}{H} \right) = \vec{w} \neq 0. \]
+Therefore, the flow is rotational.
+
+\textbf{Solution for d):} \\
+Since $\TT{e} = \frac{1}{2} (\grad \vec{v} + (\grad \vec{v})^T)$, we have:
+\[ \TT{\sigma} = - p \TT{I} + 2 \eta \TT{e} = -p \TT{I} + \eta \partial_y u (\hat{i} \hat{j} + \hat{j} \hat{i}) \implies \]
+\[ \implies \sigma_{xy} = \eta \partial_y u = \frac{2 \eta U}{H} \left( 1 - \frac{y}{H} \right). \]
+
+In conclusion:
+\[ \begin{cases}
+  \sigma_{xy}(0) = \dfrac{2 \eta U}{H}, \\
+  \sigma_{xy}(H) = 0.
+\end{cases} \]
+
+\begin{Problem}
+  In this problem, we are going to look at planar Poiseuille flow. Consider two parallel plates separated a distance $a$ along the $y$-axis and a Newtonian incompressible fluid of density $\rho$ and viscosity $\eta$ that flows between them in the positive $x$-direction. The flow is driven by a pressure difference $\Delta p$ applied over a length $L$.
+
+  \begin{enumerate}[a)]
+    \item Show that the velocity profile is:
+    \[ v_x(y) = \left| \frac{\Delta p}{L} \right| \frac{1}{2 \eta} (ay - y^2). \]
+
+    \item Obtain the flow rate per unit length-along-the-$z$-axis, $Q_{\text{length}}$.
+
+    \item Show that the average fluid-speed, which is $\frac{Q_{\text{length}}}{a}$, is equal to $\frac{2}{3}$ the maximum speed.
+  \end{enumerate}
+
+  The flow rate and the cross-sectional area are often used to obtain the characteristic speed of the flow. In this problem, $Q_{\text{length}}$ and the plate-plate separation $a$ define a characteristic speed $U$, which is $\langle v_x \rangle$.
+\end{Problem}
+
+\Solution
+Due to the symmetries of the problem, we have $\vec{v} = v_x(y) \hat{i}$. As we are in a 1D-flow in a stationary state, we have that $\partial_x p = c$, which means:
+\[ \partial_x p = \frac{\Delta p}{L}. \]
+
+If we impose the Navier-Stokes equation we get:
+\[ 0 = \vec{f} - \grad p + \eta \nabla^2 \vec{v} \implies \]
+\[ \implies \begin{cases}
+  \frac{\Delta p}{L} = \eta \partial_{yy} v_x, \\
+  \partial_y p = - \rho g, \\
+  \partial_z p = 0.
+\end{cases} \]
+
+By integrating twice the first equation we get:
+\[ v_x(y) = \frac{\Delta p}{L} \frac{y^2}{2 \eta} - c_1 \frac{y}{\eta} - \frac{c_2}{\eta} = 0. \]
+
+Now, by imposing the no-slip boundary conditions in the walls, we get that:
+\[ \begin{cases}
+  \displaystyle 0 = v_x(0) = - \frac{c_2}{\eta} \implies c_2 = 0, \\
+  \displaystyle 0 = v_x(a) = \frac{\Delta p}{L} \frac{a^2}{2 \eta} - c_1 \frac{a}{\eta} \implies c_1 = \frac{\Delta p}{L} \frac{a}{2},
+\end{cases} \]
+and thus:
+\[ v_x(y) = \frac{\Delta p}{L} \frac{y^2}{2 \eta} + \frac{\Delta p}{L} \frac{ay}{2 \eta} = \left| \frac{\Delta p}{L} \right| \frac{1}{2 \eta} (ay - y^2). \]
+
+The flow rate is:
+\[ Q = \int_A \vec{v}  \cdot d\vec{S} = \int_Z \int_0^a v_x(y) \, dy \, dz \implies \]
+\[ \implies Q_{\text{length}} = \left| \frac{\Delta p}{L} \right| \frac{1}{2 \eta} \int_0^a \left( ay - y^2 \right) \, dy = \left| \frac{\Delta p}{L} \right| \frac{a^3}{12 \eta}. \]
+
+Finally, we have that the average fluis speed is:
+\[ \langle v_x \rangle = \frac{1}{|[0, a]|} \int_0^a v_x(s) \, ds = \frac{1}{a} Q_{\text{length}} = \left| \frac{\Delta p}{L} \right| \frac{a^2}{12 \eta}. \]
+
+We can get the maximum speed by imposing:
+\[ v_x'(y) = 0 \implies y = \frac{a}{2} \implies v_x^{\text{max}} = \left| \frac{\Delta p}{L} \right| \frac{a^2}{8 \eta}. \]
+
+In conclusion, combining the 2 previous results it is clear that:
+\[ \langle v_x \rangle = \frac{2}{3} v_x^{\text{max}}. \]
+
+\end{document}
diff --git a/quad8/continuummechanics/homework/hw7/vprofile_3c.png b/quad8/continuummechanics/homework/hw7/vprofile_3c.png
new file mode 100644
index 0000000..2acc90c
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw7/vprofile_3c.png
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw7/vprofile_3d.png b/quad8/continuummechanics/homework/hw7/vprofile_3d.png
new file mode 100644
index 0000000..e21d74c
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw7/vprofile_3d.png
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw8/main.pdf b/quad8/continuummechanics/homework/hw8/main.pdf
new file mode 100644
index 0000000..d963b98
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw8/main.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw8/main.tex b/quad8/continuummechanics/homework/hw8/main.tex
new file mode 100644
index 0000000..8f07c42
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw8/main.tex
@@ -0,0 +1,303 @@
+\documentclass[11pt,a4paper,dvipsnames]{article}
+\usepackage[utf8]{inputenc}
+
+\input{../preamble.tex}
+
+\title{Homework 8\\Continuum Mechanics}
+\author{Adrià Vilanova Martínez}
+\date{May 23, 2021}
+
+\showcorrectionstrue % Change "true" to "false" in order to show corrections as
+                     % if they weren't corrections (in black instead of red).
+
+\begin{document}
+
+\maketitle
+
+\begin{Problem}
+  Two incompressible and immiscible fluids of similar densities $\rho_1$ and $\rho_2$, and of viscosities $\eta_1$ and $\eta_2$ are confined between two horizontal parallel plates. The gap between the plates is $H$. Since $\rho_1 \approx \rho_2$, we can safely neglect gravitational effects.
+
+  Fluid 1, in contact with the lower plate, forms a layer of thickness $h_1$. Fluid 2, in contact with the upper plate, forms a layer on top of fluid 1 of thickness $H - h_1$. The upper plate moves with velocity $\vec{U} = U \hat{i}$.
+
+  \begin{enumerate}[a)]
+    \item Determine the steady-state velocity profile in each fluid layer. Sketch both velocity profiles assuming $\eta_2 = 2 \eta_1$.
+
+    \item Compute the tangential force per unit area exerted on the upper plate.
+
+    \item Think about the pressure and whether it is constant or not and why.
+  \end{enumerate}
+\end{Problem}
+
+\correction{\textsc{Note}: I understood $\eta_2 = 2 \eta_1$ was a restriction throughout the whole problem, and not only for the velocity profiles.}
+
+\textbf{Solution for a):} \\
+Because of the temporal and spatial symmetries of the problem and some of the boundary conditions, the velocity field will only depend on $z$, so $\vec{v} \equiv \vec{v}(z)$, and we'll also have that $\vec{v} \cdot \hat{j} = \vec{v} \cdot \hat{k} = 0$.
+
+Imposing Navier-Cauchy's equation in the case of incompressible fluids (for a generic viscosity $\eta$ and a velocity of the previous form) taken into account that we're in a steady state, we obtain:
+\[ \begin{cases}
+  0 = - \partial_x p + \eta v_x''(z), \\
+  0 = - \partial_y p \implies p \not\equiv p(y), \\
+  0 = - \partial_z p \implies p \not\equiv p(z).
+\end{cases} \]
+
+In the case of parallel flow in the $x$-direction in stationary flows, we know that $\partial_x P$ is constant throughout the volume of the fluid (and in fact equal to 0 due to the fact that the flow is only driven by the plates and is not pressure-driven). Thus, by integrating the first equation we have
+\[ v_x(z) = c z + d, \]
+which is the expression for the only non-zero component of the velocity field in both fluids (each fluid will have its own constants, which will be denoted by $c_i$ and $d_i$ where $i$ is the index of the fluid which has density $\rho_i$ and viscosity $\eta_i$).
+
+Let's now impose all the boundary conditions: due to the fact that the fluids are real, there is a no slip condition in the interfaces with the plates (the tangential components of the velocity of the plate and fluid will be equal). This means:
+\[ \begin{cases}
+  v_x(H) = U, \\
+  v_x(0) = 0
+\end{cases} \implies \begin{cases}
+  c_2 H + d_2 = U, \\
+  d_1 = 0.
+\end{cases} \implies \]
+\[ \implies v_x(z) = \left\{\begin{array}{ll}
+  c_1 z, & (z < h_1) \\
+  c_2 (z - H) + U. & (z > h_1)
+\end{array}\right. \]
+
+At the interface between both fluids, since it is planar, both fluids are incompressible and Newtonian, and the velocity field is of the form $\vec{v} = v_x(z) \hat{i}$, we have seen in class that in that interface we have
+\[ \eta_1 \partial_z v_x^{(1)} = \eta_2 \partial_z v_x^{(2)} \implies \partial_z v_x^{(1)} = 2 \partial_z v_x^{(2)}, \]
+where the superscript indicates whether the expression of the velocity taken is the limit coming from the upper (2) or lower (1) section.
+
+Thus, derivating and using the previous equality we obtain:
+\[ c := c_1 = 2 c_2 \implies v_x(z) = \left\{\begin{array}{ll}
+  \correction{2} c z, & (z < h_1) \\
+  c (z - H) + U. & (z > h_1)
+\end{array}\right. \]
+
+\correction{I missed the following boundary condition which lets us determine $c$: we must impose continuity of the velocity at the liquid-liquid interface:
+\[ v_x^\text{(1)} (h_1) = v_x^\text{(2)} (h_1) \implies 2 c h_1 = c(h_1 - H) + U \implies c = \frac{1}{h_1} (U - cH). \]}
+
+At the interface between both fluids we can also impose the continuity of the tangential stresses. For that, let's calculate the stress tensor:
+\[ \grad \vec{v} = v_x'(z) \hat{k} \hat{i} \implies \TT{e} = \frac{1}{2} v_x'(z) (\hat{k} \hat{i} + \hat{i} \hat{k}). \]
+Finally, since $\TT{\sigma} = -p \TT{I} + \TT{\sigma}' = -p \TT{I} + 2 \eta \TT{e}$:
+\[ \TT{\sigma} = -p \TT{I} + \eta v_x'(z) (\hat{k} \hat{i} + \hat{i} \hat{k}). \]
+Now we can impose the boundary condition $(\TT{\sigma}_1 \cdot \hat{n}) \cdot \hat{n} = (\TT{\sigma}_2 \cdot \hat{n}) \cdot \hat{n} = 0$, which gives us:
+\[ p_1 = p_2. \]
+This means the pressure is identical in both fluids.
+
+\correction{However, here we've supposed that superficial tension is 0. If that wasn't the case, although pressure would remain constants in each of the fluids, we would have a difference of pressures $\Delta p = 2 \gamma H$ at the interface. As the mean curvature is $H = 0$, we would also get $p_1 = p_2$ in this case, though.}
+
+\begin{figure}[H]
+  \centering
+  \input{vprofile1.tex}
+  \caption{Sketch of the velocity profile when $\eta_2 = 2 \eta_1$.}
+\end{figure}
+
+\textbf{Solution for b):} \\
+The tangential force per unit area exerted on the upper plate is:
+\[ \sigma_{xz}(H) = \eta v_x'(H) = \eta U. \]
+
+\textbf{Solution for c):} \\
+As shown in section a), in both fluids the pressure in all points throughout each fluid is constant, and not only that, but both pressures are equal to each other.
+
+\newpage
+
+\begin{Problem}
+  A liquid of viscosity $\eta$ flows under the action of gravity through a cylindrical pipe of radius $R$ and length $L$. The pipe is inclined an angle $\alpha$ relative to the horizontal. There is also a pressure difference $\Delta p$ between the two ends of the pipe.
+
+  \begin{enumerate}[a)]
+    \item Compute the steady-state velocity profile.
+    \item Find the flow rate across the pipe.
+    \item Calculate the viscous drag force exerted by the fluid on the pipe.
+  \end{enumerate}
+\end{Problem}
+
+Let's use cylindrical coordinates, $(r, \theta, z)$, with the symmetry axis of the pipe along $z$.
+
+In general, $\vec{v} = (v_r, v_\theta, v_z)$, but considering laminar flow and symmetry arguments (no end effects), we have $\vec{v} = v_z(r, \theta, z) \hat{e}_z$ and $v_r = v_\theta = 0$.
+
+In addition, the fluid is assumed to be incompressible:
+\[ \div \vec{v} = 0 \implies \partial_z v_z = 0 \implies v_z \not\equiv v_z(z). \]
+
+Due to symmetry, the velocity field has no angular dependence either, so that $v_z \not\equiv v_z(\theta)$. Hence:
+\[ \vec{v} = v_z(r) \hat{e}_z, \]
+where $v_z(r)$ is the radial velocity profile.
+
+The convective acceleration is then identically zero (parallel shear flow): $(\vec{v} \cdot \nabla) \vec{v} = v_z \partial_z \vec{v} = 0$. The flow is also stationary: $\partial_t \vec{v} = 0$. The Navier-Stokes equation reduces to:
+\[ 0 = - \grad p + \rho \vec{g} + \eta \nabla^2 \vec{v}. \]
+For the three velocity components:
+\[ \begin{cases}
+  0 = - \partial_r p + \rho g \cos \alpha \cos \theta, \\
+  0 = - \frac{1}{r} \partial_\theta p - \rho g \cos \alpha \sin \theta, \\
+  0 = - \partial_z p + \rho g \sin \alpha + \eta \nabla^2 v_z.
+\end{cases} \]
+
+The first 2 equations simply determine the hydrostatic pressure profile, $p(r, \theta, z)$.
+
+The presure gradient in the $z$ direction is constant, by translational invariance along $z$, and given by $\partial_z p = \frac{\Delta p}{L}$ with $\Delta p := p_L - p_0$. The last equation then reads:
+\[ \eta \nabla^2 v_z = -\rho g \sin \alpha + \frac{\Delta p}{L} \implies \eta \frac{1}{r} \partial_r (r \partial_r) v_z(r) = - \rho g \sin \alpha + \frac{\Delta p}{L} \implies \]
+\[ \implies \partial_r (r \partial_r) v_z(r) = \frac{1}{\eta} \left( - \rho g \sin \alpha + \frac{\Delta p}{L} \right) r \implies \]
+\[ \implies r \partial_{rr} v_z(r) = \frac{1}{\eta} \left( - \rho g \sin \alpha + \frac{\Delta p}{L} \right) r - \partial_{r} v_z(r) \implies \]
+\[ \implies \partial_{rr} v_z(r) = \frac{1}{\eta} \left( - \rho g \sin \alpha + \frac{\Delta p}{L} \right) - \frac{1}{r} \partial_{r} v_z(r) \implies \]
+\[ \implies \partial_r v_z(r) = \frac{1}{2 \eta} \left( - \rho g \sin \alpha + \frac{\Delta p}{L} \right) r + \frac{A}{r} \implies \]
+\[ \implies v_z(r) = \frac{1}{4 \eta} \left( - \rho g \sin \alpha + \frac{\Delta p}{L} \right) r^2 + A \log(r) + B. \]
+The constants $A$, $B$ are determined by the boundary conditions:
+\[ \begin{cases}
+  v_z(0) \not\to \infty \implies A = 0, \\
+  v_z(R) = 0 \text( (no-slip)) \implies B = -\frac{1}{4 \eta} \left( - \rho g \sin \alpha + \frac{\Delta p}{L} \right) R^2.
+\end{cases} \]
+
+Finally:
+\[ v_z(r) = \frac{1}{4 \eta} \left( \frac{\Delta p}{L} - \rho g \sin \alpha \right) (r^2 - R^2). \]
+This is a parabolic velocity profile, which results from the superposition of a profile due to $\frac{\Delta p}{L}$ and to $g$ separately, since the reduced Navier-Stokes equation is linear.
+
+\textbf{Solution for b):} \\
+Flow rate:
+\[ Q = \int_0^{2 \pi} d\theta \int_0^R dr \, r v_z(r) = \frac{2 \pi}{4 \eta} \left( \frac{\Delta p}{L} - \rho g \sin \alpha \right) \int_0^R r (r^2 - R^2) \, dr \implies \]
+\[ \implies Q = \frac{\pi}{8 \eta} R^4 \left( \rho g \sin \alpha - \frac{\Delta p}{L} \right). \]
+
+\textbf{Solution for c):} \\
+Drag force on the pipe:
+\[ \frac{d \vec{F}}{dS} = \TT{\sigma}' \cdot \hat{n}, \quad \TT{\sigma}' = \eta (\grad \vec{v} + (\grad \vec{v})^T). \]
+
+In this case the only non-zero elements of the viscous stress tensor are $\sigma'_{rz} = \sigma'_{zr} = \eta \partial_r v_z$. Hence:
+\[ \frac{d \vec{F}}{dS} = \sigma'_{zr} |_{r = R} \hat{e}_z = \eta \left. \frac{\partial v_z}{\partial r} \right|_{r = R} \hat{e}_z = \frac{1}{2} \left( \frac{\Delta p}{L} - \rho g \sin \alpha \right) R \hat{e}_z. \]
+
+Integrating over the surface of the pipe, we get the total drag force:
+\[ F_z = \frac{1}{2} \left( \frac{\Delta p}{L} - \rho g \sin \alpha \right) R \int_0^L dz \int_0^{2 \pi} d\theta \, R, \]
+so that
+\[ F_z = \pi R^2 L \left( \frac{\Delta p}{L} - \rho g \sin \alpha \right); \quad \vec{F} = F_z \hat{e}_z. \]
+
+\begin{Problem}
+  Vorticity in Stokes' 1st problem - we have looked at this problem in class. Specifically, we obtained the velocity profile by solving the Navier-Stokes equation, which reduces in this problem to the diffusion equation.
+
+  \begin{enumerate}[a)]
+    \item Using the result in class, find the vorticity.
+
+    \item Calculate the vorticity flux through rectangle in the $xy$-plane with dimension along $x$ equal to $L$. (Hint: use Stokes' theorem to find the corresponding circulation.)
+
+    Note that the vorticity-flux is independent of time; it remains unchanged as the Stokes' boundary layer grows.
+
+    \item Using what we called in class the alternative form of the Navier-Stokes equation, show that vorticity obeys a diffusion equation.
+
+    This tells us that vorticity cannot be generated inside the viscous Stokes' layer during its growth, but only redistributed. We thus conclude that vorticity must arise at the plate surface during the (in reality, nearly) instantaneous accelereation of the fluid, and afterwards diffuse away from the plate into the fluid at large without changing the total vorticity-flux.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):} \\
+In class we found that
+\[ v_x(y, t) = v_0 \left[ 1 - \erf \left( \frac{y}{2 \sqrt{\nu t}} \right) \right]. \]
+Therefore:
+\[ \vec{\omega} = \curl \vec{v} = \begin{vmatrix}
+  \hat{i} & \partial_x & v_0 \left[ 1 - \erf \left( \frac{y}{2 \sqrt{\nu t}} \right) \right] \\
+  \hat{j} & \partial_y & 0 \\
+  \hat{k} & \partial_z & 0
+\end{vmatrix} = \frac{v_0}{\sqrt{\pi \nu t}} \exp\left[ - \left( \frac{y}{2 \sqrt{\nu t}} \right)^2 \right] \hat{k}. \]
+
+\textbf{Solution for b):}
+\[ I = \int_{R} (\curl \vec{v}) dS = \oint_{\partial R} \vec{v} \cdot dl = \left( \int_{AB} + \int_{BC} + \int_{CD} + \int_{DA} \right) \vec{v} \cdot dl, \]
+where $A, B, C, D$ are the vertexs of the rectangle starting from the bottom-left corner (lowest $x$ and $y$) in the anti-clockwise direction.
+Since $\vec{v} = v_x(y) \hat{i}$:
+\[ I = \left( \int_{AB} + \bcancel{\int_{BC}} + \int_{CD} + \bcancel{\int_{DA}} \right) \vec{v} \cdot dl = L (v_x(y_1) - v_x(y_2)). \]
+
+\correction{Considering the bottom side at the origin, and taking the limit of the upper side of the rectangle going to infinity, given that at the infinity limit $v_x = 0$ and at the origin $v_x = v_0$, we get
+\[ I = L v_0. \]}
+
+\textbf{Solution for c):} \\
+The alternative form of the Navier-Stokes equation for incompressible flows is:
+\[ \partial_t \vec{\omega} + \curl (\vec{\omega} \cross \vec{v}) = \frac{\eta}{\rho} \nabla^2 \vec{\omega} \]
+
+We can use the identity for the curl of the vectorial product of 2 vector fields to see that the second term in the LHS vanishes, thus leaving us with the diffusion equation in 3D:
+\[ \curl (\vec{\omega} \cross \vec{v}) = \vec{\omega} \cancel{\div \vec{v}} - \vec{v} \cancel{\div \vec{\omega}} + (\vec{v} \cdot \nabla) \vec{\omega} - (\vec{\omega} \cdot \nabla) \vec{v} = \]
+\[ = v_x \cancel{\partial_x \vec{\omega}} - \omega_z \cancel{\partial_z \vec{v}} = 0, \]
+where we have used the results in sections a) and b), the fact that the flow is incompressible and that $\div \vec{\omega} = \div (\curl \vec{v}) = 0$.
+
+Therefore:
+\[ \partial_t \vec{\omega} = \frac{\eta}{\rho} \nabla^2 \vec{\omega}. \]
+
+\begin{Problem}
+  Consider the kinetic energy density of an incompressible fluid, $\frac{1}{2} \rho v^2$. In this problem we are going to derive the conservation law for energy applied to a control (fixed) volume $V$.
+
+  \begin{enumerate}[a)]
+    \item Use the equation of motion for a fluid to show that:
+    \[ \partial_t \left( \frac{1}{2} \rho v^2 \right) = \frac{v^2}{2} \partial_t \rho - \rho v_i v_j \partial_j v_i - v_i \partial_i p + v_i \partial_j \sigma'_{ij} + v_i f_i. \]
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution:}
+\[ \partial_t \left( \frac{1}{2} \rho v^2 \right) = \frac{v^2}{2} \partial_t \rho + \rho v_i \partial_t v_i = \]
+\[ = \frac{v^2}{2} \partial_t \rho + \rho v_i (- (\vec{v} \cdot \nabla) v_i + \frac{1}{\rho} f_i^* ) = \]
+\[ = \frac{v^2}{2} \partial_t \rho + \rho v (- (v_j \partial_j) v_i + \frac{1}{\rho} (f_i + (\div \TT{\sigma}^T)_i) ) = \]
+\[ = \frac{v^2}{2} \partial_t \rho - \rho v_i v_j \partial_j v_i - v_i \partial_i p + v_i \partial_j \sigma'_{ij} + v_i f_i. \]
+
+\begin{FreeProblem}
+  \begin{enumerate}[a)]
+    \setcounter{enumi}{1}
+    \item Now use the continuity equation to show that:
+    \[ v_j \partial_j \left( \frac{\rho v^2}{2} \right) = v_j \rho v_i \partial_j v_i - \frac{v^2}{2} \frac{\partial \rho}{\partial t}. \]
+  \end{enumerate}
+\end{FreeProblem}
+
+\Solution
+First of all, we have:
+\[ v_j \partial_j \left( \frac{\rho v^2}{2} \right) = v_j \rho v_i \partial_j v_i - \frac{v^2}{2} v_j \partial_j \rho. \]
+
+Also, from the continuity equation it follows that
+\[ \partial_t \rho = - \div (\rho \vec{v}) = - \rho \cancel{\div \vec{v}} - \vec{v} \cdot \grad \rho = - v_j \partial_j \rho, \]
+which completes our proof.
+
+\begin{FreeProblem}
+  \begin{enumerate}[a)]
+    \setcounter{enumi}{2}
+    \item Use this result, that $\partial_j (v_i \sigma'_{ij}) = v_i \partial_j \sigma'_{ij} + \sigma'_{ij} \partial_j v_i$ and that $\TT{\sigma}'$ is symmetric, to obtain:
+    \[ \partial_t \left( \frac{1}{2} \rho v^2 \right) = - (\vec{v} \cdot \grad) \left( \frac{1}{2} \rho v^2 + p \right) + \div (\TT{\sigma}' \cdot \vec{v}) - \TT{\sigma}' : \grad \vec{v} + \vec{v} \cdot \vec{f}. \]
+  \end{enumerate}
+\end{FreeProblem}
+
+\textbf{Solution:}
+\[ \partial_t \left( \rho \frac{v^2}{2} \right) = \cancel{\frac{v^2}{2} \partial_t \rho} - v_j \partial_j \left( \frac{\rho v^2}{2} \right) - \cancel{\frac{v^2}{2} \partial_t \rho} - v_i \partial_i p + \partial_j (v_i \sigma'_{ij}) - \sigma'_{ij} \partial_j v_i + v_i f_i = \]
+\[ \notate[X]{{}={}}{1}{\scriptstyle v_i \sigma'_{ij} = v_i \sigma'_{ji} = \sigma'_{ji} v_i} - (\vec{v} \cdot \grad) \left( \frac{\rho v^2}{2} + p \right) + \div (\TT{\sigma}' \cdot \vec{v}) - \TT{\sigma}' : \grad \vec{v} + \vec{v} \cdot \vec{f}. \]
+
+\begin{FreeProblem}
+  \begin{enumerate}[a)]
+    \setcounter{enumi}{3}
+    \item Now use the identity $\div (\alpha \vec{A}) = \alpha \div \vec{A} + \vec{A} \cdot \grad \alpha$, with $\alpha$ a scalar and $\vec{A}$ a vector, to finally obtain:
+    \[ \partial_t \left( \frac{1}{2} \rho v^2 \right) = - \div[ \vec{v} \left( \frac{\rho v^2}{2} + p \right) - \TT{\sigma}' \cdot \vec{v} ] - \TT{\sigma}' : \grad \vec{v} + \vec{v} \cdot \vec{f}. \]
+  \end{enumerate}
+\end{FreeProblem}
+
+\Solution
+As per the identity above:
+\[ \div[ \vec{v} \left( \frac{\rho v^2}{2} + p \right) ] = \cancel{\left( \frac{\rho v^2}{2} + p \right) \underbrace{\div \vec{v}}_{= 0}} + (\vec{v} \cdot \grad) \left( \frac{\rho v^2}{2} + p \right) = (\vec{v} \cdot \grad) \left( \frac{\rho v^2}{2} + p \right). \]
+
+\begin{FreeProblem}
+  \begin{enumerate}[a)]
+    \setcounter{enumi}{4}
+    \item By integrating this equation to control (fixed) volume $V$, and using Gauss theorem, we arrive at the conservation law for the energy in volume $V$:
+    \[ \begin{split}
+      \frac{d}{dt} \int_V \frac{1}{2} \rho v^2 \, dV' = & - \oint_A \frac{1}{2} \rho v^2 \vec{v} \cdot \hat{n} \, dS - \oint_A p \vec{v} \cdot \hat{n} \, dS \\
+      & \oint_A \vec{v} \cdot \TT{\sigma}' \cdot \hat{n} \, dS + \int_V \vec{v} \cdot \vec{f} \, dV' - \int_V \TT{\sigma}' : \grad \vec{v} \, dV'.
+    \end{split} \]
+  \end{enumerate}
+\end{FreeProblem}
+
+\Solution
+Given that $V$ is fixed:
+\[ \int_V \partial_t \left( \frac{1}{2} \rho v^2 \right) \, dV' = \frac{d}{dt} \int_V \left( \frac{1}{2} \rho v^2 \right) \, dV'. \]
+
+Then, using Gauss' theorem:
+\[ \int_V \div[ \vec{v} \left( \frac{\rho v^2}{2} + p \right) - \TT{\sigma}' \cdot \vec{v} ] \, dV' \lnotate[X]{{}={}}{1}{\scriptstyle \TT{\sigma}' \cdot \vec{v} = \vec{v} \cdot \TT{\sigma}' \text{ because } \TT{\sigma}' \text{ symm.}} \oint_A \left[ \frac{\rho v^2}{2} \vec{v} + p \vec{v} - \vec{v} \cdot \TT{\sigma}' \right] \cdot \hat{n}. \]
+
+\begin{FreeProblem}
+  \begin{enumerate}[a)]
+    \setcounter{enumi}{5}
+    \item Let's work with the last energy dissipation term. Show that for a Newtonian (and incompressible) fluid:
+    \[ \TT{\sigma}' : \grad \vec{v} = \TT{\sigma}' : \TT{e} = 2 \eta \TT{e}^2. \]
+  \end{enumerate}
+\end{FreeProblem}
+
+\textbf{Solution:} \\
+\[ \TT{\sigma}' : \grad \vec{v} = \sigma'_{ij} \partial_k v_n \delta_{jk} \delta_{in} = \sigma'_{ij} \partial_j v_i = \frac{1}{2} (2 \sigma'_{ij} \partial_j v_i) = \]
+\[ = \frac{1}{2} \sigma'_{ij} \partial_j v_i + \frac{1}{2} \sigma'_{ji} \partial_i v_j \notate[X]{{}={}}{1}{\scriptstyle \TT{\sigma}' \text{ symmetric}} \frac{1}{2} \sigma'_{ij} \partial_j v_i + \frac{1}{2} \sigma'_{ij} \partial_i v_j = \sigma'_{ij} \underbrace{\frac{1}{2} (\partial_i v_j + \partial_j v_i)}_{= e_{ji}} = \]
+\[ = \sigma'_{ij} e_{ji} = \TT{\sigma}' : \TT{e}. \]
+
+Then, for an incmopressible newtonian fluid we have $\TT{\sigma}' = 2 \eta \TT{e}$, and thus:
+\[ \TT{\sigma}' : \TT{e} = 2 \eta \TT{e} : \TT{e} = 2 \eta e_{ij} e_{kn} \delta_{jk} \delta_{in} = 2 \eta e_{ij} e_{ji} \notate[X]{{}={}}{1}{\scriptstyle \TT{e} \text{ symmetric}} 2 \eta e_{ij} e_{ij} = 2 \eta \sum_{i, j} e_{ij}^2. \]
+
+Therefore, we obtain:
+\[ \TT{\sigma}' : \grad \vec{v} = \TT{\sigma}' : \TT{e} = 2 \eta \TT{e}^2. \]
+
+\end{document}
diff --git a/quad8/continuummechanics/homework/hw8/vprofile1.gnu b/quad8/continuummechanics/homework/hw8/vprofile1.gnu
new file mode 100755
index 0000000..9dc18ee
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw8/vprofile1.gnu
@@ -0,0 +1,34 @@
+#!/usr/bin/env gnuplot -c
+# == DEFINICIONS ==
+outputfile = 'vprofile1' # Nom de la imatge resultant (sense extensió)
+
+# == CONFIGURACIÓ DE L'OUTPUT PEL LATEX ==
+set terminal cairolatex size 10cm, 7.5cm font ",10"
+set output outputfile.'.tex'
+
+# == CONFIGURACIÓ DEL PLOT ==
+set xlabel '$v_x$'
+set ylabel '$z$'
+
+unset key
+
+set arrow 2 from 0,0.25 to 0.5,0.25 lc 3 size 0.08,17
+set arrow 3 from 0,0.5 to 1,0.5 lc 3 size 0.08,17
+set arrow 4 from 0,0.75 to 1.5,0.75 lc 3 size 0.08,17
+set arrow 5 from 0,1 to 2,1 lc 3 size 0.08,17
+set arrow 6 from 0,1.25 to 2.25,1.25 lc 3 size 0.08,17
+set arrow 7 from 0,1.5 to 2.5,1.5 lc 3 size 0.08,17
+set arrow 8 from 0,1.75 to 2.75,1.75 lc 3 size 0.08,17
+set arrow 9 from 0,2 to 3,2 lc 3 size 0.08,17
+set arrow 1 from 0,1 to 3,1 nohead
+
+f(x) = (x > 2 ? x - 1 : 0.5*x )
+plot [0:3] f(x)
+
+# == CONFIGURACIÓ DE L'OUTPUT PER SVG ==
+# Això ho uso per generar també una imatge de previsualització que puc carregar
+# a l'ordinador per veure més o menys com a sortit el plot sense haver
+# d'inserir-ho al LaTeX per veure-ho.
+set terminal svg dashed size 600, 600 font "Computer Modern,Tinos,Helvetica,15"
+set output outputfile.'.svg'
+replot
diff --git a/quad8/continuummechanics/homework/hw8/vprofile1.pdf b/quad8/continuummechanics/homework/hw8/vprofile1.pdf
new file mode 100644
index 0000000..32d748b
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw8/vprofile1.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw8/vprofile1.svg b/quad8/continuummechanics/homework/hw8/vprofile1.svg
new file mode 100644
index 0000000..e81773c
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw8/vprofile1.svg
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="utf-8"  standalone="no"?>
+<svg 
+ width="600" height="600"
+ viewBox="0 0 600 600"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+>
+
+<title>Gnuplot</title>
+<desc>Produced by GNUPLOT 5.4 patchlevel 1 </desc>
+
+<g id="gnuplot_canvas">
+
+<rect x="0" y="0" width="600" height="600" fill="none"/>
+<defs>
+
+	<circle id='gpDot' r='0.5' stroke-width='0.5' stroke='currentColor'/>
+	<path id='gpPt0' stroke-width='0.178' stroke='currentColor' d='M-1,0 h2 M0,-1 v2'/>
+	<path id='gpPt1' stroke-width='0.178' stroke='currentColor' d='M-1,-1 L1,1 M1,-1 L-1,1'/>
+	<path id='gpPt2' stroke-width='0.178' stroke='currentColor' d='M-1,0 L1,0 M0,-1 L0,1 M-1,-1 L1,1 M-1,1 L1,-1'/>
+	<rect id='gpPt3' stroke-width='0.178' stroke='currentColor' x='-1' y='-1' width='2' height='2'/>
+	<rect id='gpPt4' stroke-width='0.178' stroke='currentColor' fill='currentColor' x='-1' y='-1' width='2' height='2'/>
+	<circle id='gpPt5' stroke-width='0.178' stroke='currentColor' cx='0' cy='0' r='1'/>
+	<use xlink:href='#gpPt5' id='gpPt6' fill='currentColor' stroke='none'/>
+	<path id='gpPt7' stroke-width='0.178' stroke='currentColor' d='M0,-1.33 L-1.33,0.67 L1.33,0.67 z'/>
+	<use xlink:href='#gpPt7' id='gpPt8' fill='currentColor' stroke='none'/>
+	<use xlink:href='#gpPt7' id='gpPt9' stroke='currentColor' transform='rotate(180)'/>
+	<use xlink:href='#gpPt9' id='gpPt10' fill='currentColor' stroke='none'/>
+	<use xlink:href='#gpPt3' id='gpPt11' stroke='currentColor' transform='rotate(45)'/>
+	<use xlink:href='#gpPt11' id='gpPt12' fill='currentColor' stroke='none'/>
+	<path id='gpPt13' stroke-width='0.178' stroke='currentColor' d='M0,1.330 L1.265,0.411 L0.782,-1.067 L-0.782,-1.076 L-1.265,0.411 z'/>
+	<use xlink:href='#gpPt13' id='gpPt14' fill='currentColor' stroke='none'/>
+	<filter id='textbox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'>
+	  <feFlood flood-color='white' flood-opacity='1' result='bgnd'/>
+	  <feComposite in='SourceGraphic' in2='bgnd' operator='atop'/>
+	</filter>
+	<filter id='greybox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'>
+	  <feFlood flood-color='lightgrey' flood-opacity='1' result='grey'/>
+	  <feComposite in='SourceGraphic' in2='grey' operator='atop'/>
+	</filter>
+</defs>
+<g fill="none" color="white" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M90.75,505.50 L102.00,505.50 M568.49,505.50 L557.24,505.50  '/>	<g transform="translate(80.25,510.38)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="end">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 0</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M90.75,384.75 L102.00,384.75 M568.49,384.75 L557.24,384.75  '/>	<g transform="translate(80.25,389.63)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="end">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 0.5</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M90.75,264.00 L102.00,264.00 M568.49,264.00 L557.24,264.00  '/>	<g transform="translate(80.25,268.88)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="end">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 1</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M90.75,143.26 L102.00,143.26 M568.49,143.26 L557.24,143.26  '/>	<g transform="translate(80.25,148.14)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="end">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 1.5</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M90.75,22.51 L102.00,22.51 M568.49,22.51 L557.24,22.51  '/>	<g transform="translate(80.25,27.39)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="end">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 2</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M90.75,505.50 L90.75,494.25 M90.75,22.51 L90.75,33.76  '/>	<g transform="translate(90.75,532.88)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="middle">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 0</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M170.37,505.50 L170.37,494.25 M170.37,22.51 L170.37,33.76  '/>	<g transform="translate(170.37,532.88)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="middle">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 0.5</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M250.00,505.50 L250.00,494.25 M250.00,22.51 L250.00,33.76  '/>	<g transform="translate(250.00,532.88)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="middle">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 1</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M329.62,505.50 L329.62,494.25 M329.62,22.51 L329.62,33.76  '/>	<g transform="translate(329.62,532.88)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="middle">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 1.5</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M409.24,505.50 L409.24,494.25 M409.24,22.51 L409.24,33.76  '/>	<g transform="translate(409.24,532.88)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="middle">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 2</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M488.87,505.50 L488.87,494.25 M488.87,22.51 L488.87,33.76  '/>	<g transform="translate(488.87,532.88)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="middle">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 2.5</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M568.49,505.50 L568.49,494.25 M568.49,22.51 L568.49,33.76  '/>	<g transform="translate(568.49,532.88)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="middle">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" > 3</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M90.75,22.51 L90.75,505.50 L568.49,505.50 L568.49,22.51 L90.75,22.51 Z  '/>	<path stroke='black'  d='M90.76,263.99 L568.50,263.99  '/>	<path stroke='rgb( 86, 180, 233)'  d='M158.21,441.40 L170.38,445.12 L158.21,448.84 M90.76,445.12 L170.38,445.12 M237.84,381.02 L250.01,384.74 L237.84,388.46
+		M90.76,384.74 L250.01,384.74 M317.46,320.65 L329.63,324.37 L317.46,328.09 M90.76,324.37 L329.63,324.37 M397.08,260.27
+		L409.25,263.99 L397.08,267.71 M90.76,263.99 L409.25,263.99 M436.90,199.90 L449.07,203.62 L436.90,207.34 M90.76,203.62
+		L449.07,203.62 M476.71,139.53 L488.88,143.25 L476.71,146.97 M90.76,143.25 L488.88,143.25 M516.52,79.15 L528.69,82.87
+		L516.52,86.59 M90.76,82.87 L528.69,82.87 M556.33,18.78 L568.50,22.50 L556.33,26.22 M90.76,22.50 L568.50,22.50
+		 '/></g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<g transform="translate(23.99,264.01) rotate(270)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="middle">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" >$z$</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<g transform="translate(329.62,566.63)" stroke="none" fill="black" font-family="Computer Modern,Tinos,Helvetica" font-size="15.00"  text-anchor="middle">
+		<text><tspan font-family="Computer Modern,Tinos,Helvetica" >$v</tspan><tspan font-family="Computer Modern,Tinos,Helvetica"  font-size="12.0" dy="4.50px">x</tspan><tspan font-family="Computer Modern,Tinos,Helvetica"  font-size="15.0" dy="-4.50px">$</tspan></text>
+	</g>
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+</g>
+	<g id="gnuplot_plot_1" ><title>f(x)</title>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='rgb(148,   0, 211)'  d='M90.75,505.50 L95.58,501.84 L100.40,498.18 L105.23,494.52 L110.05,490.86 L114.88,487.20 L119.70,483.55 L124.53,479.89
+		L129.36,476.23 L134.18,472.57 L139.01,468.91 L143.83,465.25 L148.66,461.59 L153.48,457.93 L158.31,454.27 L163.13,450.61
+		L167.96,446.96 L172.79,443.30 L177.61,439.64 L182.44,435.98 L187.26,432.32 L192.09,428.66 L196.91,425.00 L201.74,421.34
+		L206.57,417.68 L211.39,414.02 L216.22,410.37 L221.04,406.71 L225.87,403.05 L230.69,399.39 L235.52,395.73 L240.35,392.07
+		L245.17,388.41 L250.00,384.75 L254.82,381.09 L259.65,377.43 L264.47,373.78 L269.30,370.12 L274.12,366.46 L278.95,362.80
+		L283.78,359.14 L288.60,355.48 L293.43,351.82 L298.25,348.16 L303.08,344.50 L307.90,340.84 L312.73,337.19 L317.56,333.53
+		L322.38,329.87 L327.21,326.21 L332.03,322.55 L336.86,318.89 L341.68,315.23 L346.51,311.57 L351.34,307.91 L356.16,304.25
+		L360.99,300.60 L365.81,296.94 L370.64,293.28 L375.46,289.62 L380.29,285.96 L385.12,282.30 L389.94,278.64 L394.77,274.98
+		L399.59,271.32 L404.42,267.66 L409.24,264.00 L414.07,256.69 L418.89,249.37 L423.72,242.05 L428.55,234.73 L433.37,227.41
+		L438.20,220.10 L443.02,212.78 L447.85,205.46 L452.67,198.14 L457.50,190.82 L462.33,183.51 L467.15,176.19 L471.98,168.87
+		L476.80,161.55 L481.63,154.23 L486.45,146.92 L491.28,139.60 L496.11,132.28 L500.93,124.96 L505.76,117.64 L510.58,110.33
+		L515.41,103.01 L520.23,95.69 L525.06,88.37 L529.88,81.05 L534.71,73.74 L539.54,66.42 L544.36,59.10 L549.19,51.78
+		L554.01,44.46 L558.84,37.15 L563.66,29.83 L568.49,22.51  '/></g>
+	</g>
+<g fill="none" color="white" stroke="rgb(148,   0, 211)" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter">
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter">
+</g>
+<g fill="none" color="black" stroke="black" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+</g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+	<path stroke='black'  d='M90.75,22.51 L90.75,505.50 L568.49,505.50 L568.49,22.51 L90.75,22.51 Z  '/></g>
+<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter">
+</g>
+</g>
+</svg>
+
diff --git a/quad8/continuummechanics/homework/hw8/vprofile1.tex b/quad8/continuummechanics/homework/hw8/vprofile1.tex
new file mode 100644
index 0000000..297e04c
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw8/vprofile1.tex
@@ -0,0 +1,119 @@
+% GNUPLOT: LaTeX picture with Postscript
+\begingroup
+  \makeatletter
+  \providecommand\color[2][]{%
+    \GenericError{(gnuplot) \space\space\space\@spaces}{%
+      Package color not loaded in conjunction with
+      terminal option `colourtext'%
+    }{See the gnuplot documentation for explanation.%
+    }{Either use 'blacktext' in gnuplot or load the package
+      color.sty in LaTeX.}%
+    \renewcommand\color[2][]{}%
+  }%
+  \providecommand\includegraphics[2][]{%
+    \GenericError{(gnuplot) \space\space\space\@spaces}{%
+      Package graphicx or graphics not loaded%
+    }{See the gnuplot documentation for explanation.%
+    }{The gnuplot epslatex terminal needs graphicx.sty or graphics.sty.}%
+    \renewcommand\includegraphics[2][]{}%
+  }%
+  \providecommand\rotatebox[2]{#2}%
+  \@ifundefined{ifGPcolor}{%
+    \newif\ifGPcolor
+    \GPcolortrue
+  }{}%
+  \@ifundefined{ifGPblacktext}{%
+    \newif\ifGPblacktext
+    \GPblacktexttrue
+  }{}%
+  % define a \g@addto@macro without @ in the name:
+  \let\gplgaddtomacro\g@addto@macro
+  % define empty templates for all commands taking text:
+  \gdef\gplbacktext{}%
+  \gdef\gplfronttext{}%
+  \makeatother
+  \ifGPblacktext
+    % no textcolor at all
+    \def\colorrgb#1{}%
+    \def\colorgray#1{}%
+  \else
+    % gray or color?
+    \ifGPcolor
+      \def\colorrgb#1{\color[rgb]{#1}}%
+      \def\colorgray#1{\color[gray]{#1}}%
+      \expandafter\def\csname LTw\endcsname{\color{white}}%
+      \expandafter\def\csname LTb\endcsname{\color{black}}%
+      \expandafter\def\csname LTa\endcsname{\color{black}}%
+      \expandafter\def\csname LT0\endcsname{\color[rgb]{1,0,0}}%
+      \expandafter\def\csname LT1\endcsname{\color[rgb]{0,1,0}}%
+      \expandafter\def\csname LT2\endcsname{\color[rgb]{0,0,1}}%
+      \expandafter\def\csname LT3\endcsname{\color[rgb]{1,0,1}}%
+      \expandafter\def\csname LT4\endcsname{\color[rgb]{0,1,1}}%
+      \expandafter\def\csname LT5\endcsname{\color[rgb]{1,1,0}}%
+      \expandafter\def\csname LT6\endcsname{\color[rgb]{0,0,0}}%
+      \expandafter\def\csname LT7\endcsname{\color[rgb]{1,0.3,0}}%
+      \expandafter\def\csname LT8\endcsname{\color[rgb]{0.5,0.5,0.5}}%
+    \else
+      % gray
+      \def\colorrgb#1{\color{black}}%
+      \def\colorgray#1{\color[gray]{#1}}%
+      \expandafter\def\csname LTw\endcsname{\color{white}}%
+      \expandafter\def\csname LTb\endcsname{\color{black}}%
+      \expandafter\def\csname LTa\endcsname{\color{black}}%
+      \expandafter\def\csname LT0\endcsname{\color{black}}%
+      \expandafter\def\csname LT1\endcsname{\color{black}}%
+      \expandafter\def\csname LT2\endcsname{\color{black}}%
+      \expandafter\def\csname LT3\endcsname{\color{black}}%
+      \expandafter\def\csname LT4\endcsname{\color{black}}%
+      \expandafter\def\csname LT5\endcsname{\color{black}}%
+      \expandafter\def\csname LT6\endcsname{\color{black}}%
+      \expandafter\def\csname LT7\endcsname{\color{black}}%
+      \expandafter\def\csname LT8\endcsname{\color{black}}%
+    \fi
+  \fi
+    \setlength{\unitlength}{0.0500bp}%
+    \ifx\gptboxheight\undefined%
+      \newlength{\gptboxheight}%
+      \newlength{\gptboxwidth}%
+      \newsavebox{\gptboxtext}%
+    \fi%
+    \setlength{\fboxrule}{0.5pt}%
+    \setlength{\fboxsep}{1pt}%
+\begin{picture}(5660.00,4240.00)%
+    \gplgaddtomacro\gplbacktext{%
+      \csname LTb\endcsname%%
+      \put(559,508){\makebox(0,0)[r]{\strut{}$0$}}%
+      \csname LTb\endcsname%%
+      \put(559,1396){\makebox(0,0)[r]{\strut{}$0.5$}}%
+      \csname LTb\endcsname%%
+      \put(559,2284){\makebox(0,0)[r]{\strut{}$1$}}%
+      \csname LTb\endcsname%%
+      \put(559,3172){\makebox(0,0)[r]{\strut{}$1.5$}}%
+      \csname LTb\endcsname%%
+      \put(559,4060){\makebox(0,0)[r]{\strut{}$2$}}%
+      \csname LTb\endcsname%%
+      \put(648,349){\makebox(0,0){\strut{}$0$}}%
+      \csname LTb\endcsname%%
+      \put(1435,349){\makebox(0,0){\strut{}$0.5$}}%
+      \csname LTb\endcsname%%
+      \put(2223,349){\makebox(0,0){\strut{}$1$}}%
+      \csname LTb\endcsname%%
+      \put(3010,349){\makebox(0,0){\strut{}$1.5$}}%
+      \csname LTb\endcsname%%
+      \put(3797,349){\makebox(0,0){\strut{}$2$}}%
+      \csname LTb\endcsname%%
+      \put(4585,349){\makebox(0,0){\strut{}$2.5$}}%
+      \csname LTb\endcsname%%
+      \put(5372,349){\makebox(0,0){\strut{}$3$}}%
+    }%
+    \gplgaddtomacro\gplfronttext{%
+      \csname LTb\endcsname%%
+      \put(146,2284){\rotatebox{-270}{\makebox(0,0){\strut{}$z$}}}%
+      \csname LTb\endcsname%%
+      \put(3010,111){\makebox(0,0){\strut{}$v_x$}}%
+    }%
+    \gplbacktext
+    \put(0,0){\includegraphics[width={283.00bp},height={212.00bp}]{vprofile1}}%
+    \gplfronttext
+  \end{picture}%
+\endgroup
diff --git a/quad8/continuummechanics/homework/hw9/main.pdf b/quad8/continuummechanics/homework/hw9/main.pdf
new file mode 100644
index 0000000..c390f19
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw9/main.pdf
Binary files differ
diff --git a/quad8/continuummechanics/homework/hw9/main.tex b/quad8/continuummechanics/homework/hw9/main.tex
new file mode 100644
index 0000000..4a9d3a2
--- /dev/null
+++ b/quad8/continuummechanics/homework/hw9/main.tex
@@ -0,0 +1,249 @@
+\documentclass[11pt,a4paper,dvipsnames]{article}
+\usepackage[utf8]{inputenc}
+
+\input{../preamble.tex}
+
+\title{Homework 9\\Continuum Mechanics}
+\author{Adrià Vilanova Martínez}
+\date{May 29, 2021}
+
+\showcorrectionstrue % Change "true" to "false" in order to show corrections as
+                     % if they weren't corrections (in black instead of red).
+
+\begin{document}
+
+\maketitle
+
+\begin{Problem}
+  In this problem we are going to revisit the Venturi effect in the experimental set-up where we use manometer tubes to determine the pressure (see Fig. 1).
+
+  Show that if the flow is ideal and potential, $h_A = h_B$. Assume the pressures at $A'$ and $B'$ are equal to $p_0$, and that the speed of the fluid at $A'$ and $B'$ is zero. Note how by assuming potential flow, which is vorticity-free, we are truly neglecting the no-slip boundary condition at the walls, where we know we generate vorticity in real fluids. In this case, there is significant flow through the manometric tubes and thus we no longer have hydrostatic equilibrium along $y$.
+
+  This problem illustrates that to get physically meaningful results we must implicitly consider the role of viscous effects near the conduit walls. This is something we often do -assume viscous effects cause something that we must consider before treating the flow as ideal. Only by doing this will we be able to say something physically meaningful about the problem at hand. In the Venturi set-up in Fig. 1, we are approximating the flow profile as uniform in the cross-section, except in the vicinity near the solid walls. The transition to the condition of zero tangential velocity is then assumed to occur over a very narrow boundary layer. We relegate viscous effects to only affect within this thin fluid layer near the conduit walls. However, doing this is very important, as it prevents flow from penetrating the manometric tubes, thus guaranteeing that the pressure along $y$ is hydrostatic. The presence of a boundary layer is thus essential to the analysis we did in class, even if we did not explicitly considered it, and for it to describr reality; its presence, and thus the presence of viscous effects, is what enabled us to treat the flow as ideal to explain the experimentally observable fact that $h_B < h_A$.
+\end{Problem}
+
+\Solution
+If the fluid is ideal, this means that it is incompressible and has viscosity $\eta = 0$.
+%In class we derived the following general equations for this set-up, given that there is only velocity in the $z$-direction as a function of $r$:
+%\[ \begin{cases}
+%  0 = - \partial_z p + \eta (\partial_{rr} v_z + \frac{1}{r} \partial_r v_z), \\
+%  \partial_y p = - \rho g,
+%\end{cases} \]
+%which in our case we can particularize as:
+%\[ \begin{cases}
+%  \partial_z p = 0, \\
+%  \partial_y p = - \rho g.
+%\end{cases} \]
+%
+%The first equation tells us that $p(z) = \text{const.}$, while the second one tells us $p(y) = - \rho g y$.
+
+As the flow is potential, we can use the 2nd representation of Bernouilli's equation, which is valid everywhere in the fluid (we'll consider the fluid to be in a stationary state):
+\[ \frac{1}{2} \rho v^2 + p + \rho \varphi = \text{const}. \]
+
+We also have $\varphi = g y$, and since the velocity at the top of the tubes is zero, we can evaluate the previous expression in the pairs of points (A, A') and (B, B'):
+\[ p_A + \frac{1}{2} \rho v_A^2 = p_{A'} + \rho g y_A = p_0 + \rho g y_A \]
+\[ p_B + \frac{1}{2} \rho v_B^2 = p_{B'} + \rho g y_B = p_0 + \rho g y_B \]
+
+Also, applying Bernouilli's equation in points $(A, B)$ we get the following equation which lets us connect the previous 2 equations:
+\[ p_A + \frac{1}{2} \rho v_A^2 = p_B + \frac{1}{2} \rho v_B^2 \implies \]
+\[ \implies p_0 + \rho g y_A = p_0 + \rho g y_B \implies y_A = y_B. \]
+
+\begin{Problem}
+  (The Coanda effect.) Place a cylindrical object under a liquid jet, but slightly off-axis, as shown in Fig. 2(a). We observe that the jet tends to stick to the obstacle and undergoes a deflection, while concomitantly, the wires holding up the cylinder tilt towards the jet, indicating there is an attractive force between the two. This is known as the Coanda effect and can be understood from the curvature of the streamlines in the jet: The pressure on the surface of the cylinder, $p_\text{in}$, is less than the surrounding atmospheric pressure, $p_\text{atm}$.
+
+  Assume that instead of the jet we have a thin sheet of liquid in a plane parallel to the axis of the cylinder, as illustrated in Fig. 2(b). The thickness of the sheet is $e \ll R$, with $R$ the radius of curvature of the streamlines, the density of the fluid is $\rho$ and the speed at which it flows is $v$. From the pressure difference $p_\text{atm} - p_\text{in}$, estimate the attraction force per-unit-length-along-the-cylinder-axis.
+
+  \textsc{Note}: The Coanda effect also allows explaining how a very light ball can be levitated within an air jet impinging at a small angle to the vertical slightly above the wall; this is often seen in some science museums. Just as in the case of the cylinder, the compensating force results from the curvature of the streamlines, which lowers the pressure, and not because of the impact of the jet of air. A comparable phenomenon is the \textit{teapot effect}: the liquid stream that flows from the spout of a teapot seems to be attracted to the spout's surface after having followed the curve of the spout instead of flowing directly into a cup. However, in this case, surface tension also plays a role; the contact between the liquid film and the teapot depends on whether the liquid wets or not the teapot surface.
+\end{Problem}
+
+\Solution
+The force will be given by the acceleration of the particles turning. Basically, those particles will have a centripetal force which will be equal and opposite to that being felt by the cylindrical object.
+
+Given that the density of the fluid is constant, the flow is incompressible. Let's consider a single particle in contact with the cylinder's surface. This particle will be experiencing an acceleration in the direction normal to the surface (towards the center of curvature) equal to
+\[ \vec{a} = -\frac{v^2}{R} \hat{n}. \]
+Thus, the force experienced by a particle is:
+\[ \vec{f} = - \rho \frac{v^2}{R} \hat{n}. \]
+Now, let's integrate this in cylindrical coordinates to get the force:
+\[ \vec{F} = \int_S - \rho \frac{v^2}{R} \hat{n} dS' = L \int_0^{2 \theta_i} d\theta \, R \left( - \rho \frac{v^2}{R} \hat{n} \right) = \]
+\[ = - L \rho v^2 \int_0^{2 \theta_i} d\theta \, \hat{n} = - L \rho v^2 \int_0^{2 \theta_i} d\theta \, (- \cos \theta \, \hat{i} - \sin \theta \, \hat{j}) = \]
+\[ = - L \rho v^2 [ - \sin (2 \theta_i) \, \hat{i} + (\cos (2 \theta_i) - 1) \, \hat{j} ] = \]
+\[ = - L \rho v^2 [ - 2 \sin \theta_i \cos \theta_i \, \hat{i} - 2 \sin^2 \theta_i \, \hat{j} ] = - 2 L \rho v^2 \sin \theta_i [ - \cos \theta_i \, \hat{i} - \sin \theta_i \, \hat{j} ] = \]
+\[ = - 2 L \rho v^2 \sin \theta_i \, \hat{n}_{\theta_i} \implies \]
+\[ \implies \frac{\vec{F}}{L} = - 2 \rho v^2 \sin \theta_i \, \hat{n}_{\theta_i}. \]
+
+\correction{The only problem with this calculation is it only accounts for the particles near the cylinder. If we take into account all the particles of the flow (approximating $R + e \approx R$), we have to integrate the previous expression for all the streamlines, we get the correct answer, which is:
+\[ \frac{\vec{F}}{L} = - 2 \rho v^2 e \sin \theta_i \hat{n}_{\theta_i}. \]}
+
+\begin{Problem}
+  An ideal fluid of density $\rho$ flows steadily through an axisymmetric pipe of decreasing cross section. The inlet and outlet cross-sectional areas are $A_1$ and $A_2 < A_1$, respectively, and the flow is incompressible.
+
+  \begin{enumerate}[a)]
+    \item If the fluid gets into the pipe with speed $U_1$, show, starting from the incompressibility condition, that the speed at the outlet is $U_2 = U_1 \frac{A_1}{A_2}$. Note this reflects the flow rate through the pipe is constant.
+
+    \item Compute the force exerted by the fluid on the pipe.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):} \\
+Let's consider $V$ as the volume enclosed by the closed surface $\partial V = S_1 \cup S_2 \cup S_L$, where $S_1$ and $S_2$ are the cross-sectional surfaces with areas $A_1$ and $A_2$, and $S_L$ is the lateral surface along the pipe's wall between the two previous surfaces.
+
+\[ \div \vec{v} = 0 \notate[X]{{}\implies{}}{1}{\scriptstyle \text{True at all points}} \int_V \div \vec{v} \, dv' = 0 \notate[X]{{}\implies{}}{1}{\scriptstyle \text{Stokes' theorem}} \int_{\partial V} \vec{v} \cdot d\vec{S} = 0 \notate[X]{{}\implies{}}{1}{\scriptstyle \partial V = S_1 \cup S_2 \cup S_L} \]
+\[ \implies 0 = \left( \int_{\partial S_1} + \int_{\partial S_2} + \cancel{\int_{\partial S_L}} \right) \vec{v} \cdot d\vec{S} \lnotate[X]{{}={}}{1.2}{\scriptstyle \text{In } S_L, \, \vec{v} \perp d\vec{S}} \int_{\partial S_1} \vec{v} \cdot d\vec{S} + \int_{\partial S_2} \vec{v} \cdot d\vec{S} = \]
+\[ = \int_{\partial S_1} (- U_1) \, dS + \int_{\partial S_2} U_2 \, dS = - U_1 A_1 + U_2 A_2 \implies \]
+\[ \implies  U_2 = U_1 \frac{A_1}{A_2}. \]
+
+\textbf{Solution for b):} \\
+Given that the fluid is ideal, let's apply Bernoulli's equation along a streamline:
+\[ p_1 + \frac{\rho v_1^2}{2} = p_2 + \frac{\rho v_2^2}{2} \implies \]
+\[ \implies p_2 = p_1 + \frac{1}{2} \rho \left( v_1^2 - v_2^2 \right) = p_1 + \frac{1}{2} \rho v_1^2 \left( 1 - \left( \frac{A_1}{A_2} \right)^2 \right). \]
+
+In order to calculate the force exerted by the fluid on the pipe, let's impose the conservation of momentum applied to volume $V$ fixed:
+\[ \frac{d}{dt} \int_V \rho \vec{v} \cdot dV' = \int_V \partial_t (\rho \vec{v}) dV' \lnotate[X]{{}={}}{1}{\scriptstyle \text{stationarity}} 0, \]
+\[ \frac{d}{dt} \int_V \rho \vec{v} \cdot dV' = - \oint_A \TT{\pi} \cdot \hat{n} \, dS. \]
+
+Since $\TT{pi} = \rho \vec{v} \vec{v} - \TT{\sigma} = \rho \vec{v} \vec{v} - p \TT{I}$, we have:
+\[ \oint_A (\rho \vec{v} \vec{v} + p \TT{I}) \cdot \hat{n} \, dS = 0. \]
+
+Now, let's compute the force in each separate area:
+\begin{itemize}
+  \item In $S_1$, $\vec{v} = u_1 \hat{x}$, $\hat{n} = - \hat{x}$ and $p = p_1$, so:
+  \[ \int_{S_1} (\rho u_1 \hat{x} (- u_1) - \hat{x} p_1) \, dS = - \hat{x} (\rho u_1^2 + p_1) A_1. \]
+
+  \item In $S_2$, $\vec{v} = u_2 \hat{x}$, $\hat{n} = \hat{x}$ and $p = p_2$, so:
+  \[ \int_{S_2} (\rho u_2 \hat{x} \cdot u_2 + \hat{x} p_2 ) \, dS = \hat{x} (\rho u_2^2 + p_2) A_2 \]
+
+  \item In $S_L$, $\vec{v} \cdot \hat{n} = 0$, so $\rho \vec{v} \vec{v} \cdot \hat{n} = 0$.
+\end{itemize}
+
+Thus:
+\[ \vec{F} = \int_{S_L} p \hat{n} \, dS = \hat{x} \left[ p_2 (A_1 - A_2) + \frac{1}{2} \rho u_1^2 A_1 \left( 1 - \frac{A_1}{A_2} \right)^2 \right]. \]
+
+\begin{Problem}
+  Consider an incompressible fluid steadily rotating at constant angular velocity $\Omega$ about the $z$-axis. The density of the fluid is $\rho$ and we are in the presence of the gravitational field of the Earth.
+
+  \begin{enumerate}[a)]
+    \item Show that the viscous term in the Navier-Stokes equation is identically equal to zero. This implies the equation of motion is Euler's equation.
+
+    \item Obtain Bernouilli's equation in the rotating frame of reference. Does the resultant equation provide the pressure field (at any $r, z$), or is it only applicable along a streamline?
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):} \\
+The viscous term in the Navier-Stokes equation for incompressible fluids is:
+\[ \eta \nabla^2 \vec{v}. \]
+Let's see that it is equal to zero. The velocity field will be
+\[ \vec{v} = (0, v_\theta(r), 0)_{\{\hat{r}, \hat{\theta}, \hat{z}\}}. \]
+This is because the problem states that the fluid is steadily rotating at constant angular velocity $\Omega$. In fact:
+\[ v_\theta (r) = \Omega r. \]
+Thus, calculating the laplacian in cylindrical coordinates (and taking into consideraion that the only non-negative partial derivative is $\partial_r v_\theta$) we get:
+\[ \eta \nabla^2 \vec{v} = \eta \left[ \cancel{\partial_{rr} v_\theta} + \frac{1}{r} \partial_r v_\theta - \frac{1}{r^2} v_\theta \right] \hat{\theta} = \eta \left[ \frac{1}{r} \Omega - \frac{1}{r^2} r \Omega \right] \hat{\theta} = 0. \]
+
+\textbf{Solution for b):} \\
+Let's start with the Navier-Cauchy equation (in our case, Euler's equation):
+\[ \cancel{\rho \partial_t \vec{v}} + \rho \vec{v} \cdot \grad \vec{v} = \vec{f} - \grad p. \]
+We can use vector identity $\vec{v} \cdot \grad \vec{v} = - \vec{v} \cross \vec{\omega} + \grad(\frac{v^2}{2})$ and the fact that $\vec{f} = \rho \vec{g} = - \rho g \hat{k} \implies \vec{g} = - \grad \varphi$, where $\varphi = gz$, to show that:
+\[ - \rho \vec{v} \cross \vec{\omega} = - \rho \grad(gz) - \grad p - \rho \grad(\frac{v^2}{2}) \implies \]
+\[ \lnotate[X]{{}\implies{}}{1}{\scriptstyle \rho \text{ const.}} \grad(\frac{1}{2} \rho v^2 + p + \rho g z) = \rho \vec{v} \cross \vec{\omega} \implies \]
+\[ \implies \grad(\frac{1}{2} \rho \Omega^2 r^2 + p + \rho g z) = \vec{v} \cross (2 \Omega \hat{k}) = 2 \Omega^2 r \hat{r} = \grad(\Omega^2 r^2) \implies \]
+\[ \implies \Omega^2 r^2 \left( \frac{1}{2} \rho - 1 \right) + p + \rho g z = \text{const}. \implies \]
+This equation is valid everywhere in the fluid, since the Navier-Stokes equation is valid everywhere in the fluid, and we haven't introduced any further requirements than the ones which are met everywhere in the fluid.
+
+\correction{There has been a mistake I'm not able to see. The correct equation is slightly different:
+\[ - \frac{1}{2} \rho \Omega^2 r^2 + p + \rho g z = \text{const}. \]}
+
+\newpage
+
+\begin{Problem}
+  Multipolar expansion.
+
+  \begin{enumerate}[a)]
+    \item \underline{Uniform flow}. Consider a 2D flow in the $xy$-plane with $\vec{v} = U \hat{i}$. Show that in cartesian coordinates, the stream function is $\psi = U y$ and that the velocity potential is $\Phi = U x$. Note the streamlines are straight lines in the $x$-direction and that the $\Phi = \text{const.}$ lines are straight lines in the $y$-direction and perpendicular to the $\psi = \text{const.}$ lines.
+
+    \item Now consider an axially symmetric flow with $\vec{v} = U \hat{e}_z$. Show that in cylindrical coordinates $(r, \varphi, z)$, the Stokes stream function and the velocity potential are, respectively, $\psi = - \frac{1}{2} r^2 U$ and $\Phi = U z$. Then show that in spherical coordinates $(r, \theta, \varphi)$, $\psi = U \frac{r^2}{2} \sin^2 \theta$ and $\Phi = U r \cos \theta$.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for a):} \\
+As seen in class, the stream function satisfies:
+\[ \left.\begin{array}{r}
+  U = v_x = \partial_y \psi \\
+  0 = v_y = - \partial_x \psi
+\end{array}\right\} \implies \psi = U y. \]
+
+And the velocity potential satisfies:
+\[ \left.\begin{array}{r}
+  U = v_x = \partial_x \Phi \\
+  0 = v_y = \partial_y \Phi
+\end{array}\right\} \implies \Phi = U x. \]
+
+\textbf{Solution for b):} \\
+The stream function, in cylindrical coordinates, satisfies:
+\[ \left.\begin{array}{r}
+  U = v_z = - \frac{1}{r} \partial_r \psi \\
+  0 = v_r = - \frac{1}{r} \partial_z \psi
+\end{array}\right\} \implies \psi = - \frac{1}{2} U r^2. \]
+
+And the velocity potential satisfies:
+\[ \left.\begin{array}{r}
+  U = v_z = \partial_z \Phi \\
+  0 = v_r = \partial_r \Phi
+\end{array}\right\} \implies \Phi = U z. \]
+
+In spherical coordinates, the stream function satisfies:
+\[ \left.\begin{array}{r}
+  U \cos \theta = v_r = \frac{1}{r^2 \sin \theta} \partial_\theta \psi \\
+  - U \sin \theta = v_\theta = - \frac{1}{r \sin \theta} \partial_r \psi \implies - U r \sin^2 \theta = \partial_r \psi
+\end{array}\right\} \implies \]
+\[ \implies \psi = \frac{1}{2} U r^2 \sin^2 \theta. \]
+
+And finally, the velocity potential satisfies:
+\[ \left.\begin{array}{r}
+  U \cos \theta = v_r = \partial_r \Phi \\
+  - U \sin \theta = v_\theta = \frac{1}{r} \partial_\theta \Phi
+\end{array}\right\} \implies \Phi = U r \cos \theta. \]
+
+\begin{Problem}
+  \begin{enumerate}[a)]
+    \setcounter{enumi}{2}
+    \item \underline{Sources and sinks}. Consider a 2D flow in polar coordinates having $v_r (r) = - \frac{Q}{2 \pi r}$, with $Q = \text{const.}$, and $v_\varphi = 0$. Start by confirming that $Q$ is the flow rate (per unit length along $z$) across any circumference centered at the origin; recall the sign of $Q$ determines whether you are a source ($Q > 0$) or a sink ($Q < 0$).
+
+    Then show that $\psi = \frac{Q \varphi}{2 \pi}$ and that $\Phi = \frac{Q}{2 \pi} \log\frac{r}{r_0}$, where $r_0$ is a cut-off length.
+
+    \item Now consider an axially symmetric flow having $v_r = \frac{Q}{4 \pi r^2}$, with $Q = \text{const.}$, and $v_\varphi = v_\theta = 0$. Note we are using spherical coordinates $(r, \theta, \varphi)$. COnfirm that $Q$ is the flow rate through any spherical surface centered at the origin.
+
+    Then show that $\psi = - \frac{Q}{4 \pi} \cos \theta$ and that $\Phi = - \frac{Q}{4 \pi r}$.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solution for c):}
+\[ \oint_{\partial B(r)} \vec{v} \cdot \hat{n} \, dl = \int_0^{2 \pi} \frac{Q}{2 \pi r} r \, d\varphi = \frac{Q}{2 \pi} 2 \pi = Q. \]
+
+The stream function is given by:
+\[ \left.\begin{array}{r}
+  \frac{Q}{2 \pi r} = v_r = \frac{1}{r} \partial_\varphi \psi \\
+  0 = v_\varphi = - \partial_r \psi
+\end{array}\right\} \implies \psi = \frac{Q \varphi}{2 \pi}. \]
+
+And the velocity potential is given by:
+\[ \left.\begin{array}{r}
+  \frac{Q}{2 \pi r} = v_r = \partial_r \Phi \\
+  0 = v_\varphi = \frac{1}{r} \partial_\varphi \Phi
+\end{array}\right\} \implies \Phi = \frac{Q}{2 \pi} \log r + C = \frac{Q}{2 \pi} \log \frac{r}{r_0}. \]
+
+\textbf{Solution for d):}
+\[ \oint_{\partial B(r)} \vec{v} \cdot d\vec{S} = \oint_{\partial B(r)} v_r \hat{r} \cdot \hat{r} r^2 \sin \theta \, d\theta d\varphi = \frac{Q}{4 \pi} \int_0^\pi d\theta \, \sin \theta \int_0^{2 \pi} d\varphi = \frac{Q}{4 \pi} 4 \pi = Q. \]
+
+The stream function is given by:
+\[ \left.\begin{array}{r}
+  \frac{Q}{4 \pi r^2} = v_r = \frac{1}{r^2 \sin \theta} \partial_\theta \psi \\
+  0 = v_\theta = - \frac{1}{r \sin \theta} \partial_r \psi
+\end{array}\right\} \implies \]
+\[ \implies \psi = - \frac{Q}{4 \pi} \cos \theta. \]
+
+And finally, the velocity potential is given by:
+\[ \left.\begin{array}{r}
+  \frac{Q}{4 \pi r^2} = v_r = \partial_r \Phi \\
+  0 = v_\theta = \frac{1}{r} \partial_\theta \Phi
+\end{array}\right\} \implies \Phi = - \frac{Q}{4 \pi r}. \]
+
+\end{document}
diff --git a/quad8/continuummechanics/homework/preamble.tex b/quad8/continuummechanics/homework/preamble.tex
new file mode 100644
index 0000000..471d68e
--- /dev/null
+++ b/quad8/continuummechanics/homework/preamble.tex
@@ -0,0 +1,145 @@
+\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}
+\usepackage{float}
+\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$}}}%
+}
+
+\newcommand\lnotate[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\kern-9pt$\leftarrow$\smash{\llap{$~#4\quad\;\,$}}}%
+}
+
+% 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}}}
+\newcommand*{\dev}[0]{\text{dev}\,}
+
+% Corrections:
+\newif\ifshowcorrections
+
+\newcommand{\correction}[1]{%
+  \ifshowcorrections%
+    {\color{red} #1}%
+  \else%
+    #1%
+  \fi%
+}%
+
+\newcommand{\formulacorrection}[1]{%
+  \ifshowcorrections%
+    \textcolor{red}{#1}%
+  \else%
+    #1%
+  \fi%
+}%
diff --git a/quad8/fiesta/formulari/formulari.pdf b/quad8/fiesta/formulari/formulari.pdf
new file mode 100644
index 0000000..8483901
--- /dev/null
+++ b/quad8/fiesta/formulari/formulari.pdf
Binary files differ
diff --git a/quad8/fiesta/formulari/formulari.tex b/quad8/fiesta/formulari/formulari.tex
new file mode 100644
index 0000000..aaae981
--- /dev/null
+++ b/quad8/fiesta/formulari/formulari.tex
@@ -0,0 +1,175 @@
+\documentclass[a4paper,11pt]{article}
+
+\usepackage[portrait,margin=0.5in,top=0.5in,bottom=0.5in]{geometry}
+\usepackage{amsmath,multicol,siunitx,amsfonts,adjustbox}
+\usepackage[tiny]{titlesec}
+\usepackage[version=4]{mhchem}
+\usepackage[overload]{abraces}
+
+\usepackage[utf8]{inputenc}
+\usepackage[spanish]{babel}
+\titlespacing{\section}{0pt}{5pt}{0pt}
+\titlespacing{\subsection}{0pt}{5pt}{0pt}
+\titlespacing{\subsubsection}{0pt}{5pt}{0pt}
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{.5em}
+\pagenumbering{gobble}
+\setlength{\columnseprule}{1pt}
+
+\newcommand{\forceindent}{\leavevmode{\parindent=1em\indent}}
+
+\title{\vspace{-1em} Formulari Física Estadística}
+\author{Adrià Vilanova Martínez}
+\date{}
+
+\def\dbar{{\mathchar'26\mkern-12mu d}}
+\everymath{\displaystyle}
+\DeclareSIUnit{\atmosphere}{atm}
+\def\hrulefilll{\leavevmode\leaders\hrule height 1.4pt\hfill\kern 0pt}
+\def\hrulefillll{\leavevmode\leaders\hrule height 2.1pt\hfill\kern 0pt}
+
+\begin{document}
+  \maketitle
+
+  \begin{multicols*}{3}
+    \section{Microcanonical ensemble $(N, V, E)$}
+
+    \subsection{Introduction}
+
+    $S = K_b \log \Omega$.
+
+    \underline{Basic relations:}
+
+    \begin{adjustbox}{width=\textwidth/3}
+      $\begin{array}{cc}
+        \frac{1}{T} = \left( \frac{\partial S}{\partial E} \right)_{N, V} & \frac{P}{T} = \left( \frac{\partial S}{\partial V} \right)_{E, N} \\
+        \mu = - T \left( \frac{\partial S}{\partial N} \right)_{E, V} & C(T) = \frac{\partial E}{\partial T}
+      \end{array}$
+    \end{adjustbox}
+
+    \underline{Potentials:} $\begin{cases}
+      F = E - TS, \\
+      G = F + PV, \\
+      H = E + PV
+    \end{cases}$
+
+    \subsection{Ideal gas}
+
+    $H(\vec{q}, \vec{p}) = \sum_{i = 1}^N H_i(\vec{q_i}, \vec{p_i}) = \sum_{i = 1}^N \frac{p_i^2}{2m}$
+
+    %$H_i(\vec{q_i}, \vec{p_i}) \, \psi_{\vec{n_i}} = \varepsilon_{\vec{n_i}} \, \psi_{\vec{n_i}}$
+
+    $PV = \frac{2}{3} E$ (valid for ideal classic and quantum gasses)
+
+    For a reversible adiabatic process the entropy is constant, and thus: $PV^{\frac{5}{3}} = \text{const.}$
+
+    $C_V = \frac{3}{2} N K_B$, $C_P = \frac{5}{2} N K_B$
+
+    $\mu = K_B T \log\left( \frac{N \lambda^3}{V} \right)$
+
+    $\lambda = \sqrt{\frac{h^2}{2 \pi m K_B T}}$
+
+    $\begin{array}{l}
+      S(E, N, V) = \frac{3}{2} N K_B \left( - \log(\lambda) \right. \\
+      \left. + \frac{2}{3} \log\left( \frac{V}{N} \right) + \frac{5}{3} \right)
+    \end{array}$
+
+    \section{Canonical ensemble $(N, V, T)$}
+
+    \underline{Partition function:}
+
+    $Z = \sum_{E_i} \Omega(E_i) e^{- \beta E_i}$
+
+    $P(E_i) = \frac{1}{Z} \Omega(E_i) e^{- \beta E_i}$
+
+    $\langle E \rangle = - \left( \frac{\partial \log Z}{\partial \beta} \right)_{N, V}$
+
+    $\sigma_E = \sqrt{K_B T^2 C_v}$
+
+    $F = - K_B T \log Z$
+
+    \underline{Thermodynamic relations:}
+
+    $\begin{array}{ll}
+      P = - \left( \frac{\partial F}{\partial V} \right)_{T, N} & S = \left( \frac{\partial F}{\partial T} \right)_{V, N} \\
+      \mu = \left( \frac{\partial F}{\partial N} \right)_{T, V}
+    \end{array}$
+
+    \underline{Identical part.:} $Z(N) = \frac{[Z(1)]^N}{N!}$
+
+    \underline{Localized part.:} $Z(N) = [Z(1)]^N$
+
+    \underline{Single-particle partition function:}
+    $Z(1) = \frac{1}{h^3} \int e^{- \beta H(\vec{q_i}, \vec{p_i})} d\vec{q_i} d\vec{p_i}$
+
+    \underline{Equipartition theorem:} $\langle x_i \cdot \frac{\partial H}{\partial x_j} \rangle = K_B T \delta_{ij}$
+
+    $H = \sum_{i = 1}^n a_i x_i^{\eta_i} \Rightarrow E = K_B T \sum_{i = 1}^{6n} \frac{1}{\eta_i}$
+
+    \section{Grand canonical ensemble $(\mu, V, T)$}
+
+    $Q = \sum_{N = 0}^\infty \sum_E \Omega(N, E) e^{- \beta (E - \mu N)}$
+
+    $P(E, N) = \frac{1}{Q} \Omega(N, E) e^{- \beta (E - \mu N)}$
+
+    \underline{Fugacity:} $z := e^{\beta \mu}$
+
+    $Q = \sum_{N = 0}^\infty z^N \sum_E \Omega(N, E) e^{- \beta E} = \sum_{N = 0}^\infty z^N Z(N)$
+
+    \begin{adjustbox}{width=\textwidth/3}
+      $\begin{cases}
+        Z(N) = \frac{1}{N!} [Z(1)]^N \implies Q = e^{z Z(1)} \\
+        Z(N) = [Z(1)]^N \implies Q = \frac{1}{1 - z Z(1)} \\
+      \end{cases}$
+    \end{adjustbox}
+
+    $\alpha = - \beta \mu$
+
+    $\langle E \rangle = - \left( \frac{\partial \log Q}{\partial \beta} \right)_{\alpha, V}$
+
+    \begin{adjustbox}{width=\textwidth/3}
+      $\sigma_E^2 = \left( \frac{\partial^2 \log Q}{\partial \beta^2} \right)_{\alpha, V} = - \left( \frac{\partial \langle E \rangle}{\partial \beta} \right)_{\alpha, V}$
+    \end{adjustbox}
+
+    \begin{adjustbox}{width=\textwidth/3}
+      $\langle N \rangle = - \left( \frac{\partial \log Q}{\partial \alpha} \right)_{\beta, V} = z \left( \frac{\partial \log Q}{\partial z} \right)_{T, V}$
+    \end{adjustbox}
+
+    \begin{adjustbox}{width=\textwidth/3}
+      $\sigma_N^2 = \left( \frac{\partial^2 \log Q}{\partial \alpha^2} \right)_{\beta, V} = - \left( \frac{\partial \langle N \rangle}{\partial \alpha} \right)_{\beta, V}$
+    \end{adjustbox}
+
+    $\Xi = U - TS - \mu N = - K_B T \log Q$
+
+    \underline{Thermodynamic relations:}
+
+    $\begin{array}{ll}
+      PV = - \Xi & N = - \left( \frac{\partial \Xi}{\partial \mu} \right)_{T, V} \\
+      S = - \left( \frac{\partial \Xi}{\partial T} \right)_{V, \mu}
+    \end{array}$
+
+    (isolating $\mu$ from the first 2 eqs. we get the eq. of state)
+
+    \section{Quantum statistical mechanics}
+
+    $E_k = \sum_i n_i \varepsilon_i$, $Z = \sum_k e^{- \beta E_k}$
+
+    $Z = \sum_{\{ n_i \}} f(\{ n_i \}) e^{- \beta E_k}$
+
+    Distinguishable: $g(\{ n_i \}) = \frac{N!}{n_1! n_2! \cdots n_N!}$
+
+    Indistinguishable: $g(\{ n_i \}) = 1$
+
+    $Q = \prod_i \sum_{n_i = 0}^{n_{i, max}} (z e^{- \beta \varepsilon_i})^{n_i}$
+
+    \section{Miscelanea}
+
+    \underline{Vol($d$-sphere):}
+    $V_d(R) = \frac{\pi^{\frac{d}{2}} R^d}{\Gamma\left( 1 + \frac{d}{2} \right)}$
+
+    \underline{Stirling:} $\log n! \approx n \log n - n$
+
+    $\sum_{n = 0}^N x^n = \frac{x^{N + 1} - 1}{x - 1}$
+
+  \end{multicols*}
+\end{document}
diff --git a/quad8/fiesta/homework/entrega3/main.tex b/quad8/fiesta/homework/entrega3/main.tex
new file mode 100644
index 0000000..f795bee
--- /dev/null
+++ b/quad8/fiesta/homework/entrega3/main.tex
@@ -0,0 +1,126 @@
+\documentclass[11pt,a4paper,dvipsnames]{article}
+\usepackage[utf8]{inputenc}
+
+\input{../preamble.tex}
+
+\title{Entrega 3 de problemes\\Física Estadística}
+\author{Adrià Vilanova Martínez}
+\date{21 de juny, 2021}
+
+\showcorrectionsfalse % Change "true" to "false" in order to show corrections as
+                      % if they weren't corrections (in black instead of red).
+
+\begin{document}
+
+\maketitle
+
+\begin{Problem}
+  Un sistema està format per dues partícules idèntiques sense interacció, que poden estar cadascuna d'elles en 4 estats monoparticulars d'energies $0$, $\varepsilon$, $2 \varepsilon$ i $3 \varepsilon$. Escriviu la funció de partició canònica del sistema en funció de la variable $x = e^{- \beta \varepsilon}$ en els casos següents:
+
+  \begin{enumerate}[(a)]
+    \item Les dues partícules són distingibles i no tenen degeneració d'espín.
+    \item Les dues partícules son indistingibles i tenen espín zero (estadística de Bose-Einstein).
+    \item Les dues partícules son indistingibles i tenen espín $1/2$ (estadística de Fermi-Dirac). Noteu que, en aquest cas, cal tenir en compte la orientació de l'espín per determinar els diferents micro-estats, així com la seva degeneració.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solució per (a):} \\
+Tenim:
+\[ Z_1(T) = e^{- \beta 0} + e^{- \beta} + e^{- 2 \beta} + e^{- 3 \beta} = 1 + x + x^2 + x^3. \]
+
+I en aquest cas, per ser dues partícules distingibles sense degeneració d'espín tenim:
+\[ Z_2(T) = (Z_1(T))^2 = (1 + x + x^2 + x^3)^2. \]
+
+\textbf{Solució per (b):} \\
+En aquest cas, pel fet de ser indstingibles, hem de restar al càlcul anterior els estats degenerats (només els hem de comptar un cop). Si representem els estats de les dues partícules amb la parella $(n_1, n_2)$, on $n_1, n_2 \in \{ 0, 1, 2, 3 \}$ són els estats de les dues partícules i pel fet que són indistingibles $(n_1, n_2) = (n_2, n_1)$, abans estàvem comptant 2 cops els següents estats: $(0, 1)$, $(0, 2)$, $(0, 3)$, $(1, 2)$, $(1, 3)$, $(2, 3)$. Aquests estats tenen energies $E_i = n_1 + n_2$. Així doncs, tenim:
+\[ Z(T) = (1 + x + x^2 + x^3)^2 - x - x^2 - 2x^3 - x^4 - x^5 = \]
+\[ = (1 + 2x + 3x^2 + 4x^3 + 3x^4 + 2x^5 + x^6) - x - x^2 - 2x^3 - x^4 - x^5 = \]
+\[ = 1 + x + 2x^2 + 2x^3 + 2x^4 + x^5 + x^6. \]
+
+\textbf{Solució per (c):} \\
+En aquest cas, si els dos fermions estan en el mateix estat, l'spin de les dues partícules ha de ser diferent i per tant els estats $(0, 0)$, $(1, 1)$, $(2, 2)$ i $(3, 3)$ tenen degeneració 1.
+
+En quant als altres estats --$(0, 1)$, $(0, 2)$, $(0, 3)$, $(1, 2)$, $(1, 3)$, $(2, 3)$-- en ser diferents els estats de les dues partícules, cada partícula pot tenir un estat de l'espín qualsevol, donant les combinacions $\uparrow \uparrow$, $\downarrow \uparrow$, $\uparrow \downarrow$ i $\downarrow \downarrow$ (és a dir, degeneració 4).
+
+Notem que aquí estem considerant tant $\downarrow \uparrow$ com $\uparrow \downarrow$, ja que tot i que les partícules siguin indistingibles, són diferents els estats $(0 \downarrow, 1 \uparrow)$ i $(0 \uparrow, 1 \downarrow)$.
+
+Això ens dona la següent funció de partició:
+\[ Z(T) = 1 + x^2 + x^4 + x^6 + 4(x + x^2 + 2x^3 + x^4 + x^5). \]
+
+\newpage
+
+\begin{Problem}
+  Els modes normals de vibració d'un sòlid format per $N$ àtoms en una xarxa tridimensional donen lloc, en determinades circumstàncies, a ones amb una relació de dispersió de la forma
+  \[ \omega = A | \vec{k} |^n, \]
+  amb 3 modes de vibració per a cada freqüència.
+
+  \begin{enumerate}[(a)]
+    \item Determineu la densitat d'estats $g(\omega)$.
+    \item Sabent que les freqüències estan acotades entre $0$ i $\omega_\text{max}$, determineu $\omega_\text{max}$.
+    \item Doneu una expressió per a la capacitat calorífica a volum constant (podeu deixar una integral numèrica indicada).
+    \item Trobeu i discutiu els límits d'alta i baixa temperatura.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solució per (a):} \\
+Tenim que:
+\[ d\omega = n A |k|^{n - 1} dk. \]
+Aleshores:
+\[ g(\omega) d\omega = g(k(\omega)) \frac{dk}{d\omega} d\omega = \frac{4 \pi V}{(2 \pi)^3} \frac{k^2}{n A k^{n - 1}} d\omega = \frac{3V}{2 n \pi^2} \frac{\omega^{\frac{3}{n} - 1}}{A^{\frac{3}{n}}} d\omega. \]
+
+\textbf{Solució per (b):} \\
+Tal com hem vist a teoria:
+\[ 3N = \int_{\omega_\text{min}}^{\omega_\text{max}} g(\omega) \, d\omega = \underbrace{\frac{3V}{2 n \pi^2} A^{- \frac{3}{n}}}_{:= C} \int_0^{\omega_\text{max}} \omega^{\frac{3}{n} - 1} d\omega = \]
+\[ = \frac{C}{\frac{3}{n}} \left[ \omega^{\frac{3}{n}} \right]_0^{\omega_\text{max}} = \frac{1}{3} Cn \omega_\text{max}^{3/n} \implies \]
+\[ \implies \omega_\text{max} = \left( \frac{9}{Cn} \right)^\frac{n}{3} = A \left( \frac{6 \pi^2 N}{V} \right)^\frac{n}{3}. \]
+
+\textbf{Solució per (c):} \\
+Tenint en compte que $\varepsilon = \hbar \omega$ podem calcular l'energia interna mitjana:
+\[ U = \int_0^{\omega_\text{max}} \frac{\hbar \omega}{e^{\beta \hbar \omega} - 1} g(\omega) \, d\omega. \]
+Aleshores, definint $s := \beta \hbar \omega$:
+\[ C_V = - \frac{1}{K_B T^2} \left( \frac{\partial U}{\partial \beta} \right)_V = \frac{9 N K_B}{n s_\text{max}^{3/n}} \underbrace{\int_0^{s_\text{max}} \frac{s^{1 + \frac{3}{n}} e^s}{(e^s - 1)^2} \, ds}_{:= I(s_\text{max})}. \]
+Desfent el canvi de variables:
+\[ C_V = \frac{9 N K_B}{n} \left( \frac{K_B T}{\hbar \omega_\text{max}} \right)^\frac{3}{n} I(s_\text{max}). \]
+
+\textbf{Solució per (d):} \\
+Per a temperatures baixes:
+\[ \lim_{T \to 0} C_V = \frac{9 N K_B}{n} \left( \frac{K_B}{\hbar \omega_\text{max}} \right)^\frac{3}{n} \lim_{T \to 0} (T^\frac{3}{n} I(s_\text{max})). \]
+A aquest límit tenim que $s_\text{max} \propto \frac{1}{T}$, així que $s_\text{max}$ tendeix a una constant i $I(s_\text{max})$ també (anomenem-la $I(T = 0)$). En aquest cas, veiem que la capacitat calorífica es fa zero, degut al fet que $T^\frac{3}{n} \to 0$.
+
+Per a temperatures altes, utilitzant Taylor a l'expressió de dins de la integral obtenim:
+\[ \lim_{T \to \infty} C_V = 3 N K_B, \]
+que coincideix amb el teorema d'equipartició que vam veure a la part clàssica de la teoria.
+
+\newpage
+
+\begin{Problem}
+  El grafè està format per una monocapa d'àtoms de carboni. Els electrons a la banda de conducció del material es mouen dins d'aquesta capa com un gas bidimensional amb una relació de dispersió lineal donada per:
+  \[ \varepsilon(k) = \hbar v k, \]
+  on $v$ és una velocitat constant. Per a una mostra de grafè d'àrea $A = L_x L_y$, els vectors d'ona permesos per les condicions de contorn són de la forma $\vec{k} = \frac{2 \pi}{L_x} m \hat{x} + \frac{2 \pi}{L_y} n \hat{y}$, amb $m, n \in \mathbb{Z}$ i $\hat{x}, \hat{y}$ vectors unitaris.
+
+  \begin{enumerate}[(a)]
+    \item Calculeu la densitat d'estats a la banda de conducció en termes d'energia, $g(\varepsilon)$, tenint en compte que cada electró contribueix, a més, amb un factor 2 degut a la degeneració del seu espí.
+    \item Si considerem que per a temperatures $T$ baixes el potencial químic del gas $\mu(T)$ és nul, trobeu una expressió de l'energia interna $U(T, A)$ dels electrons tenint en compte que l'energia de l'estat fonamental $U(T = 0, A) = U_0 = 0$. Expresseu el resultat en termes d'una integral adimensional $I$ que no cal que avalueu explícitament.
+    \item Determineu l'exponent $n$ característic de la dependència de la calor específica en la temperatura $C_A(T, A) \sim T^n$ a àrea constant i temperatures baixes per als electrons del grafè.
+  \end{enumerate}
+\end{Problem}
+
+\textbf{Solució per (a):} \\
+Tenim que:
+\[ \varepsilon = \hbar v k = \hbar v \sqrt{k_x^2 + k_y^2} = \hbar v 2 \pi \sqrt{ \left(\frac{m}{L_x}\right)^2 + \left(\frac{n}{L_y}\right)^2 }. \]
+Aleshores:
+\[ g(\varepsilon) \, d\varepsilon = 2 g(k) \frac{dk}{d\varepsilon} d\varepsilon = 2 \frac{A}{(2 \pi)^2} 4 \pi k \frac{1}{\hbar v} \, d\varepsilon = 2 \frac{A}{\pi (\hbar v)^2} \varepsilon. \]
+%\[ = 2A \sqrt{ \left(\frac{m}{L_x}\right)^2 + \left(\frac{n}{L_y}\right)^2 } \, d\varepsilon = \]
+%\[ = 2 \sqrt{(m L_y)^2 + (n L_x)^2}. \]
+
+\textbf{Solució per (b):}
+\[ U = \tilde{U_0} + \int_0^b \frac{g(\varepsilon)}{e^{\beta \varepsilon} - 1} \, d \varepsilon = \tilde{U_0} + 2 \frac{A}{\pi (\hbar v)^2} \int_0^b \frac{\varepsilon}{e^{\beta \varepsilon} - 1} \, d \varepsilon. \]
+Com $U(T = 0, A) = 0$, aleshores $\tilde{U_0} = 0$.
+
+\begin{Problem}
+  Considereu un sistema de $N$ fermions lliures. Els estats monoparticulars tenen energies $\varepsilon_n = (4n + 1) \varepsilon_0$ amb $n \in \mathbb{N}^*$ i degeneració $g_n = 2n - 1$. Determineu l'energia del nivell de Fermi i l'energia total del sistema per a $T = 0$.
+\end{Problem}
+
+Em sap greu, però no sé fer aquest exercici.
+
+\end{document}
diff --git a/quad8/gd/teoria/01.png b/quad8/gd/teoria/01.png
new file mode 100644
index 0000000..1c9359c
--- /dev/null
+++ b/quad8/gd/teoria/01.png
Binary files differ
diff --git a/quad8/gd/teoria/01_dibuix_banda_moebius.m b/quad8/gd/teoria/01_dibuix_banda_moebius.m
new file mode 100644
index 0000000..08e185f
--- /dev/null
+++ b/quad8/gd/teoria/01_dibuix_banda_moebius.m
@@ -0,0 +1,38 @@
+% Dibuix d'una banda de Moebius
+% (codi amb Matlab i apte també per a Octave)
+% Geometria Diferencial, FME, UPC
+% 2021/02/12
+
+% Paràmetres de la banda de Moebius
+r = 11; % radi de la banda
+t = linspace(0, 2*pi, 101);
+zor = linspace(-1, 1, 21); % ample de la banda
+
+% Taula de punts de la banda
+for k = 1:length(t)
+  A = [
+    cos(t(k)) -sin(t(k)) 0
+    sin(t(k)) cos(t(k)) 0
+    0 0 1
+  ];
+  B = [
+    1 0 0
+    0 cos(t(k)/2) -sin(t(k)/2)
+    0 sin(t(k)/2) cos(t(k)/2)
+  ];
+
+  for l = 1:length(zor)
+    phi = A*(B*[0; r; zor(l)] + [0; r; 0]);
+    x(k, l) = phi(1);
+    y(k, l) = phi(2);
+    z(k, l) = phi(3);
+  end
+end
+
+% Dibuixem la superfície
+%xlabel('x');
+%ylabel('y');
+%zlabel('z');
+surf(x, y, z);
+print("01.png", "-dpng")
+%axis equal
diff --git a/quad8/gd/teoria/02_problema_1_8/arc.m b/quad8/gd/teoria/02_problema_1_8/arc.m
new file mode 100644
index 0000000..e39cb1f
--- /dev/null
+++ b/quad8/gd/teoria/02_problema_1_8/arc.m
@@ -0,0 +1,3 @@
+function longs = arc(C)
+  arestes = C(:, 2:end) - C(:, 1:end-1);
+  longs = sqrt(sum(arestes.*arestes));
diff --git a/quad8/gd/teoria/02_problema_1_8/curv_centre.m b/quad8/gd/teoria/02_problema_1_8/curv_centre.m
new file mode 100644
index 0000000..0051a98
--- /dev/null
+++ b/quad8/gd/teoria/02_problema_1_8/curv_centre.m
@@ -0,0 +1,23 @@
+function [kappa, ccurv] = curv_centre(C)
+  d = size(C, 1); % Dimensió de l'ambient
+
+  % Arestes
+  ar01 = C(:, 2:end-1) - C(:, 1:end-2);
+  ar12 = C(:, 3:end) - C(:, 2:end-1);
+
+  % Mètrica
+  g11 = sum(ar01.*ar01);
+  g12 = sum(ar01.*ar12);
+  g22 = sum(ar12.*ar12);
+
+  % Centres de curvatura
+  detG = g11.*g22 - g12.*g12;
+  lambda1 = (0.5*g11.*g22 - g12.*g12 - 0.5*g12.*g22)./detG;
+  lambda2 = (0.5*g11.*g12 + 0.5*g11.*g22)./detG;
+  ccurv = C(:, 1:end-2) + (ones(d, 1)*lambda1).*ar01;
+  ccurv = ccurv + (ones(d, 1)*lambda2).*ar12;
+
+  % Curvatura com a invers del radi
+  vradi = C(:, 1:end-2) - ccurv;
+  radi = sqrt(sum(vradi.*vradi));
+  kappa = 1./radi;
diff --git a/quad8/gd/teoria/02_problema_1_8/gir.m b/quad8/gd/teoria/02_problema_1_8/gir.m
new file mode 100644
index 0000000..017c100
--- /dev/null
+++ b/quad8/gd/teoria/02_problema_1_8/gir.m
@@ -0,0 +1,9 @@
+function anggir = gir(C)
+  % Arestes i les seves longituds per la corba
+  arestes = C(:, 2:end) - C(:, 1:end-1);
+  longs = sqrt(sum(arestes.*arestes));
+
+  % Angles
+  prods = sum(arestes(:, 1:end-1).*arestes(:, 2:end));
+  cosanggir = prods./(longs(1:end-1).*longs(2:end));
+  anggir=acos(cosanggir);
diff --git a/quad8/gd/teoria/02_problema_1_8/main.m b/quad8/gd/teoria/02_problema_1_8/main.m
new file mode 100644
index 0000000..7e7903a
--- /dev/null
+++ b/quad8/gd/teoria/02_problema_1_8/main.m
@@ -0,0 +1,77 @@
+% Problema 1.8
+% Geometria Diferencial, FME, UPC
+% 2021/03/05
+
+% > 1.8. D'una corba gamma: [0, L] --> R^3 en coneixem un núvol de punts
+% > gamma(t_1), ..., gamma(t_n), que tenim emmagatzemats en ordre com a columnes
+% > d'una matriu C.
+
+% Figura 1: Circumferència de radi R=2
+R1 = 2;
+t1 = linspace(0, 2*pi, 361);
+x1 = R1*cos(t1);
+y1 = R1*sin(t1);
+gamma1 = [x1; y1];
+
+% Dibuix de verificació
+%figure(1)
+%p = plot(x1, y1);
+%axis equal
+
+% Figura 2: Hèlix amb R=2, c=1/3
+R2 = 2;
+c2 = 1/3;
+t2 = linspace(-4*pi, 8*pi, 601);
+gamma2 = [R2*cos(t2); R2*sin(t2); c2*t2];
+
+% Dibuix de verificació
+%figure(2)
+%plot3(gamma2(1, :), gamma2(2, :), gamma2(3, :));
+%axis equal
+%xlabel('x')
+%ylabel('y')
+%zlabel('z')
+
+%waitfor(p)
+
+% > (a) Escriviu una funció |arc| de Matlab que rebi com a argument la matriu C
+% >     i retorni un vector fila |longs| amb les longituds dels segments de la
+% >     corba poligonal bar{C} que uneix els punts de C.
+longs1 = arc(gamma1);
+longs2 = arc(gamma2);
+
+% > (b) Escriviu una funció |gir| de Matlab que calculi l'angle de gir de la
+% >     corba poligonal bar{C} en cada vèrtex interior, i retorni un vector
+% >     fila amb aquests angles.
+anggir1 = gir(gamma1);
+anggir2 = gir(gamma2);
+
+% > (c) Donat un vèrtex interior V, podem considerar com a pla osculador de la
+% >     poligonal en ell el determinat per les dues arestes de la corba que
+% >     passen per V, com a centre de curvatura el centre del cercle en aquest
+% >     pla que passa pels tres extrems de les dues arestes, i com a curvatura
+% >     l'invers del radi d'aquest cercle. Escriviu una funció de Matlab amb
+% >     capçalera |[kappa, ccurv] = curv_centre(C)| que rebi la llista de
+% >     vèrtexs C de la corba poligonal i retorni la llista de valors de la
+% >     curvatura com a vector fila |kappa|, i els centres de curvatura com a
+% >     columnes d'una matriu |ccurv|.
+[kappa1, ccurv1] = curv_centre(gamma1);
+max(kappa1)
+min(kappa1)
+max(ccurv1(1, :))
+min(ccurv1(1, :))
+max(ccurv1(2, :))
+min(ccurv1(2, :))
+
+[kappa2, ccurv2] = curv_centre(gamma2);
+max(kappa2)
+min(kappa2)
+
+% Aproximem la curvatura contínua de la corba?
+pseudocurvatura1 = anggir1./longs1(1:end-1);
+pseudocurvatura2 = anggir2./longs2(1:end-1);
+
+max(pseudocurvatura1 - 0.5)
+min(pseudocurvatura1 - 0.5)
+max(kappa1 - 0.5)
+min(kappa1 - 0.5)
diff --git a/quad8/gd/teoria/03_problema_1_21_b/main.m b/quad8/gd/teoria/03_problema_1_21_b/main.m
new file mode 100644
index 0000000..1ecd3c1
--- /dev/null
+++ b/quad8/gd/teoria/03_problema_1_21_b/main.m
@@ -0,0 +1,18 @@
+% Problema 1.21.b)
+% Geometria Diferencial, FME, UPC
+% 2021/03/05
+
+% > 1.21.b) Trobeu numèricament amb Octave, i representeu per s \in [-1, 1],
+% > una corba beta(s) tal que la seva curvatura sigui 0.5, la seva torsió sigui
+% > tau(s) = 1 + s, beta(0) = O i el seu triedre de Frenet per s = 0 sigui la
+% > base canònica.
+
+s0 = -1;
+s1 = 1;
+P = [0; 0; 0];
+Iden = eye(3);
+Y0 = [P; Iden(:)];
+
+% Integració del sistema dinàmic
+% @TODO: Afegir definicions de funcio_corba i les funcions dependents.
+[s, Y] = ode45(@funcio_corba, [s0, s1], Y0);