Skip to content

Commit

Permalink
Update test_christoffel_stepbystep.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoalopez committed Jul 3, 2024
1 parent 0eb0b4f commit 48a7239
Showing 1 changed file with 46 additions and 17 deletions.
63 changes: 46 additions & 17 deletions src/test_christoffel_stepbystep.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The goal of PyRockWave's Christoffel module is to estimate various seismic properties as a function of direction using the Christoffel equation (Christoffel, 1877). These properties include the $V_p$ (compressional), $V_{s1}$, $V_{s2}$ (shear) wave velocities (phase and group) in km/s, the polarisation directions of the sound waves, the shear wave splitting, the coordinates or the ray surface, the power flow angle and the enhancement factor. We will define all these parameters throughout this notebook.\n",
"\n",
"> _Other material properties unrelated to seismic waves are Young modulus, shear modulus, Poisson's ratio, linear compresibility and Debye temperature._\n",
"The goal of PyRockWave's Christoffel module is to estimate various seismic properties as a function of propagation direction using the Christoffel equation (Christoffel, 1877). These properties include the $V_p$ (compressional), $V_{s1}$, $V_{s2}$ (shear) phase and group sound wave velocities in km/s, the polarisation directions of the sound waves, the shear wave splitting, the coordinates of the ray surface, the power flow angle and the enhancement factor. We will define all these parameters throughout this notebook.\n",
"\n",
"## Input data\n",
"\n",
"The necessary input data to estimate the seismic and material properties in any direction of a given material using the Christoffel equation are the density and the stiffness tensor of the material.\n",
"The necessary input data to estimate the seismic properties in any direction of a given material using the Christoffel equation are the density and the stiffness tensor of the material.\n",
"\n",
"The stiffness tensor $C$ is a fundamental property of a material that generalises Hooke's law in three dimensions, relating strains to stresses in the elastic regime. This is usually given (or abbreviated) in a 6x6 matrix ($C_{ij}$) using Voigt's notation with values given in $GPa$. Density is usually given in $g/cm^3$.\n",
"\n",
"The stiffness tensor $C$ is a fundamental property of a material that generalises Hooke's law in three dimensions, relating strains to stresses in the elastic regime. This is usually given (or abbreviated) in a 6x6 matrix ($C_{ij}$) using Voigt's notation, and values are in $GPa$. Density is usually given in $g/cm^3$."
"> _Other material properties unrelated to seismic waves that can be derived from these data are: Young modulus, shear modulus, Poisson's ratio, linear compresibility and Debye temperature._"
]
},
{
Expand All @@ -61,9 +61,11 @@
"source": [
"## Step 0: create an array with wave vectors\n",
"\n",
"For most materials, the seismic properties are anisotropic, i.e. they depend on the direction. In such cases, the Christoffel equation must be solved for any propagation direction of interest, defined as wave vectors or $q$...\n",
"For most materials, the seismic properties are anisotropic, i.e. they depend on the direction. Accordingly, the Christoffel equation must be solved for each propagation direction of interest, and we must first define such a direction, denoted as wave vectors or $q$. Wave vectors can be defined in spherical coordinates (polar and azimuthal angles) or in Cartesian coordinates ($x, y, z$) normalised to the unit sphere (i.e. vector of size 1). Cartesian coordinates are used for calculations. In this case we will use the following procedure:\n",
"\n",
"Wave vectors can be defined using spherical coordinates (polar and azimuthal angles) or in Cartesian coordinates ($x, y, z$) normalized to unit sphere (i.e., vector of size 1). For calculations Cartesian coordinates will be used."
"- Create equispaced wavevectors in spherical coordinates\n",
"- Convert from spherical to 3D Cartesian unit vectors\n",
"- Store the wavevectors in a single array with three columns ($x, y, z$) for calculations"
]
},
{
Expand Down Expand Up @@ -130,9 +132,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 1: rearrange to a tensor $Cij → Cijkl$\n",
"## Step 1: Rearrange to a tensor $Cij → Cijkl$\n",
"\n",
"The operations to solve the Christoffel equation require the stiffness tensor to be in its tensor format, i.e. with rank 4 and shape 3x3x3x3x3, and not as a 6x6 matrix as it is normally provided, so it is necessary to convert $C_{ij}$ to $C_{ijkl}$. "
"The operations to solve the Christoffel equation require the stiffness tensor to be in its tensor format, i.e. with its original form 3x3x3x3 (rank 4, dimension 3), rather than as a 6x6 matrix as normally provided, so it is necessary to convert $C_{ij}$ to $C_{ijkl}$."
]
},
{
Expand Down Expand Up @@ -161,7 +163,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 2: Estimate the Christoffel matrices for each wavevector\n",
"## Step 2: Estimate the Christoffel matrices for each wavevector $\\vec{q}$\n",
"\n",
"TODO\n",
"\n",
Expand Down Expand Up @@ -249,7 +251,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 4: Estimate the eigenvalues $\\lambda$ and eigenvectors\n",
"## Step 4: Estimate the eigenvalues $\\lambda$ and eigenvectors $\\vec{v}$\n",
"\n",
"TODO"
]
Expand Down Expand Up @@ -282,7 +284,7 @@
"source": [
"## Step 5: Calculate phase velocities ($v_p$)\n",
"\n",
"The eigenvalues $\\lambda_1$, $\\lambda_2$ and $\\lambda_3$ of the Christoffel tensor $M_{ij}$ are always real, positive and related to the wave velocities $V_p$, $V_{s1}$, $V_{s2}$ propagating in the direction $\\vec{n}$ by the formulae\n",
"The eigenvalues $\\lambda_1$, $\\lambda_2$ and $\\lambda_3$ of the Christoffel tensor $M_{ij}$ are always real, positive and related to the phase wave velocities $V_p$, $V_{s1}$, $V_{s2}$ propagating in the direction $\\vec{n}$ by the formulae\n",
"\n",
"$$\n",
"V_p = \\sqrt{ \\frac{\\lambda_1}{\\rho} }, \\quad V_{s1} = \\sqrt{ \\frac{\\lambda_2}{\\rho} }, \\quad V_{s2} = \\sqrt{ \\frac{\\lambda_3}{\\rho} }\n",
Expand All @@ -294,7 +296,9 @@
"v_p = \\sqrt{\\lambda_n}, \\quad \\lambda_n = v^2_p\n",
"$$\n",
"\n",
"where $v_p$ denotes phase velocities. TODO -> define phase velocities"
"where $v_p$ denotes phase velocities and $\\lambda_n$ the various eigenvalues. Due to this, the output will be an array of shape $(n, 3)$, where $n$ represents the number of wavevectors (orientations) considered.\n",
"\n",
"> TODO -> define phase velocities"
]
},
{
Expand Down Expand Up @@ -347,7 +351,20 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 6: Calculate the derivatives of the Christoffel matrices ($∇M_{ijk}$)"
"## Towards group velocities ($v_g$)\n",
"\n",
"> TODO -> Explain group velocities\n",
"\n",
"$$\n",
"v_g = \\vec{\\varDelta} v_p = \\vec{\\varDelta} \\sqrt{\\lambda} = \\frac{\\vec{\\varDelta} \\lambda}{2 \\sqrt{\\lambda}} = \\frac{\\vec{\\varDelta} \\lambda}{2 v_p}\n",
"$$\n",
"\n",
"\n",
"## Step 6: Calculate the derivatives of the Christoffel matrices ($∇M_{ij}$)\n",
"\n",
"$$\n",
"\\frac{\\partial M_{ij}}{\\partial q_k} = \\sum_m (C_{ikmj} + C_{imkj}) q_m\n",
"$$"
]
},
{
Expand Down Expand Up @@ -376,7 +393,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 7: Calculate the derivative of the eigenvalues"
"## Step 7: Calculate the derivative of the eigenvalues\n",
"\n",
"The first derivative of an eigenvalue $\\lambda$ of a matrix $M$ is given by:\n",
"\n",
"$$\n",
"\\frac{\\partial \\lambda_i}{\\partial q_k} = \\hat{s}_i \\cdot \\frac{\\partial M_{ij}}{\\partial q_k} \\cdot \\hat{s}_i\n",
"$$\n",
"\n",
"where $\\hat{s}_i$ is the normalized eigenvector corresponding to eigenvalue $\\lambda_i$."
]
},
{
Expand Down Expand Up @@ -408,7 +433,11 @@
"## Step 8: Calculate the Group velocities ($v_g$)\n",
"\n",
"\n",
"### Step 8.1: Calculate group velocity matrices"
"### Step 8.1: Calculate group velocity matrices\n",
"\n",
"$$\n",
"v_g = \\vec{\\varDelta} v_p = \\vec{\\varDelta} \\sqrt{\\lambda} = \\frac{\\vec{\\varDelta} \\lambda}{2 \\sqrt{\\lambda}} = \\frac{\\vec{\\varDelta} \\lambda}{2 v_p}\n",
"$$"
]
},
{
Expand Down Expand Up @@ -540,7 +569,7 @@
"TODO\n",
"\n",
"$$\n",
"V_p = V_g \\, cos(\\psi)\n",
"v_p = v_g \\, cos(\\psi)\n",
"$$\n"
]
},
Expand Down

0 comments on commit 48a7239

Please sign in to comment.