{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Solutions Q1 - 24"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# import all python add-ons etc that will be needed later on\n",
"%matplotlib inline\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from sympy import *\n",
"\n",
"init_printing() # allows printing of SymPy results in typeset maths format\n",
"plt.rcParams.update({'font.size': 16}) # set font size for plots"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Q1 answer\n",
"Let vector OP be the vector 2 km due north, with length $a = 2$, and PQ the vector north-east, which is at $45^\\text{o}$ to north, and of length $b = 3$. The vector $OQ = OP + PQ$. The angle sought is $P-O-Q$ and the length of vector $O$Q is the distance the crow flies, $c$, see figure 56.\n",
"\n",
"One way of solving the problem is to draw a diagram, measuring the angle $POQ$ and the length of the line $OQ$. Analytically we can use the cosine formula to obtain the length $OP$ knowing that the angle $OPQ$, which is\n",
"$\\chi = 90 + 45^\\text{o}$. To use this formula to calculate the third side, the other two sides and the enclosed angle must be known, therefore,\n",
"\n",
"$$\\displaystyle c^2=a^2+b^2-2ab\\cos(\\chi)=4+9-12\\cos(135\\pi/180)=13+6\\sqrt{2}$$\n",
"\n",
"giving $c=4.64$ km. This formula can be used again to find $\\angle POQ = \\beta$ or the law of sines rearranged as\n",
"\n",
"$$\\displaystyle \\frac{\\sin(\\alpha)}{a}=\\frac{\\sin(\\beta)}{b}=\\frac{\\sin(\\chi)}{c}$$\n",
"\n",
"and as $\\chi$ is known $\\sin(\\beta)=0.458$ and $\\beta = 27.29^\\text{o}$. The direction home $Q \\to O$ is $27.29^\\text{o} \\equiv 27^\\text{o} 17'$ west of south or $207^\\text{o} 17'$. ( $0.29$ degrees is $0.29\\cdot 60 = 17$ minutes, approximately.) \n",
"\n",
"![Drawing](vectors-fig56.png)\n",
"\n",
"Figure 56 Sketch representing the vectors.\n",
"______\n",
"\n",
"Converting into matrix - vector form involves calculating the components of the vectors. Vector $OP = [0\\; a]$ because it lies on the y-axis and vector \n",
"\n",
"$$\\displaystyle PQ = \\begin{bmatrix}b\\cos(45^\\text{o})& a + b\\sin(45^\\text{o}) - a\\end{bmatrix}$$\n",
"\n",
"The $x$ (first) term is the projection of $\\vec b$ on the x-axis and $\\vec b\\sin(45^\\text{o}) = b/ \\sqrt{2}$ is the projection on the y-axis. Vector $\\vec c$ is \n",
"\n",
"$$\\vec c=OP+PQ=\\begin{bmatrix}b/\\sqrt{2}& a+b/\\sqrt{2}\\end{bmatrix}$$\n",
"\n",
"and its length using equation 9 is \n",
"\n",
"$$\\displaystyle |\\vec c|^2=\\begin{bmatrix}b/\\sqrt{2} & a+b/\\sqrt{2}\\end{bmatrix} \\begin{bmatrix}b/\\sqrt{2} \\\\ a+b/\\sqrt{2}\\end{bmatrix}=b^2+a^2+ab\\sqrt{2}$$\n",
"\n",
"which gives $c^2=13+6\\sqrt{2}$ and is the same result as above but without having to know the cosine rule. \n",
"\n",
"The angle $\\beta$ is calculated from the dot product between vectors $OP$ and $OQ$ which is\n",
"\n",
"$$\\displaystyle \\cos(\\beta)=\\frac{1}{|\\vec c|}\\begin{bmatrix}0 & a\\end{bmatrix} \\begin{bmatrix}b/\\sqrt{2} \\\\ a+b/\\sqrt{2}\\end{bmatrix}=\\frac{a^2+ab/\\sqrt{2}}{a\\sqrt{a^2+b^2+ab\\sqrt{2}}}=\\frac{2+3/\\sqrt{2}}{\\sqrt{13+6\\sqrt{2}}}$$\n",
"\n",
"and the angle $\\beta$ can be evaluated this time without knowing the sine rule.\n",
"\n",
"## Q2 answer\n",
"Suppose the forces are $f_1 \\cdot f_6$ then the resultant force is $ R= f_1 +f_2 +f_3 +f_4 +f_5 +f_6$. If the body does not move,then the total of all forces must be zero and therefore the applied force is $-R$. Let us choose six randomly arranged forces and add them up in any order; the result is the same, because vector addition is commutative; $\\vec A + \\vec B = \\vec B + \\vec A$ and also associative: $\\vec A + (\\vec B + \\vec C) = (\\vec A + \\vec B) + \\vec C$. The vectors are shown in figure 57. Vector $OA$ is $f_1$, and the addition carried out in a clockwise fashion starting with $O$A. The resultant vector is $\\vec R$ and to maintain the position of the body at O a vector, of the same direction and magnitude as $\\vec -R$, has to be applied to it.\n",
"\n",
"![Drawing](vectors-fig57.png)\n",
"\n",
"Figure 57. Resultant, $\\vec R$, of six vectors; the force $-\\vec R$ is applied to hold the body stationary.\n",
"________\n",
"\n",
"## Q3 answer\n",
"The plane travels along the vector $\\vec v_0$ when there is no wind with a ground speed $|\\vec V_0 | = 200$ mph (| | means use the absolute value). The $50$ mph wind from the west will push the plane towards the north and east if the pilot does not compensate for this. Consequently the pilot has to fly the plane with its nose pointing a little into the wind along the vector $\\vec V$, and therefore the wind vector is reversed and the resultant is $\\vec V = \\vec V_0 -\\vec W$, see figure 58.\n",
"\n",
"The angle between $\\vec V_0$ and $\\vec W$ is $180- 45= 135^\\text{o}$ because $\\vec W$ is due west and using the cosine formula gives\n",
"\n",
"$$\\displaystyle V^2 = 200^2 + 50^2 - 2 \\cdot 10^4\\cos(135\\pi /180)$$\n",
"\n",
"and $|\\vec V| = 238$ mph. Using the law of sines the angle $ROP$ is given by \n",
"\n",
"$$\\displaystyle \\sin^{-1}\\left(\\frac{50\\sin(135\\pi/180)}{V} \\right)=8.5^\\text{o}$$\n",
"\n",
"The plane travels at an angle west of north by $45 + 8.5 = 53.5^\\text{o}$. Note that the magnitude $|\\vec V_0| = 200$ and $|\\vec W | = 50$ is used in the calculation. The picture on the right shows how the plane might look from the ground as it travels from $O$ to $R$, its nose pointing along vector $\\vec V$. On a windy day, it is possible to observe this type of behaviour as a small plane takes off or comes into land. A small yacht carried along on an ebb tide and tacking into a cross-wind will also not have its bow pointing in the direction of travel.\n",
"\n",
"![Drawing](vectors-fig58.png)\n",
"\n",
"Figure 58. vectors for plane travel.\n",
"_______\n",
"\n",
"## Q4 answer\n",
"The vector triangle indicates that $\\vec A+\\vec C=\\vec B$,therefore, $\\vec C = \\vec B - \\vec A$. To prove the cosine law find $\\vec{C}\\,^2$ and therefore calculate the dot product of $\\vec C$ with itself which is\n",
"$\\vec C\\cdot\\vec C = |\\vec C |^2 = c^2$. Also\n",
"\n",
"$$\\displaystyle \\vec C\\cdot\\vec C = (\\vec B - \\vec A)\\cdot(\\vec B - \\vec A) = \\vec B\\cdot\\vec B + \\vec A\\cdot\\vec A - 2\\vec B\\cdot\\vec A$$\n",
"\n",
"because, by definition, $\\vec B\\cdot\\vec B = b^2,\\; \\vec C\\cdot\\vec C = c^2$ and $\\vec B\\cdot\\vec A = ab\\cos(\\chi)$. \n",
"\n",
"Combining these terms gives $c^2 = a^2 + b^2 - 2ab\\cos(\\chi)$, which is the cosine formula.\n",
"\n",
"## Q5 answer\n",
"That $2\\theta =\\varphi$ can be shown quite easily using geometry, it is a little more difficult but not hard using vectors. \n",
"\n",
"The geometric solution can be seen by noting that the internal angles of a triangle add to $180^\\text{o}$. The triangle $AOC$ is equilateral thus $2\\theta+ \\angle AOC=180$ and also $\\varphi+\\angle AOC =180$ hence $\\varphi=2\\theta$. The angle $ABC$ is $90^\\text{o}$ as shown in a particular case by making $\\varphi = 90^\\text{o}$ then $\\theta = 45^\\text{o}$ and by symmetry so is $\\angle ABC$. In the general case $\\angle OCB = (180-\\varphi)/2=90-\\theta$, and $\\angle ACB = \\theta+90-\\theta=90^\\text{o}$.\n",
"\n",
"In the vector solution we find the coordinates of points $A$ and $B$ which are $A=(-r,0),\\; B=(r,0)$. Point $C$ is restricted to lie on the circle where $x^2 +y^2 =r^2$, therefore point $C$ has coordinates $(x, r^2 -x^2)$ and the vector from $C \\to A, \\;\\overrightarrow{CA}$ is, in the $i,j$ basis \n",
"\n",
"$$\\displaystyle \\overrightarrow{CA} = -(r+x)\\;\\boldsymbol i -\\sqrt{r^2 -x^2}\\;\\boldsymbol j$$\n",
"\n",
"and vector \n",
"\n",
"$$\\displaystyle \\overrightarrow{CB}=(r-x)\\;\\boldsymbol i-\\sqrt{r^2-x^2}\\;\\boldsymbol j$$\n",
"\n",
"The dot product is \n",
"\n",
"$$\\displaystyle \\overrightarrow{CA}\\cdot\\overrightarrow{CB}=-(r^2-x^2-r^2+x^2)=0$$\n",
"\n",
"so the vectors are at right angles and the result is general as $x$ can be any point on the circumference.\n",
"\n",
"In matrix vector form the calculation is some what clearer using basis set $\\begin{bmatrix}1&0\\\\0&1\\\\ \\end{bmatrix}$,\n",
"\n",
"$$\\displaystyle \\overrightarrow{CA}\\cdot\\overrightarrow{CB}=-\\begin{bmatrix}r+x& \\sqrt{r^2-x^2} \\end{bmatrix}\\begin{bmatrix} r-x\\\\- \\sqrt{r^2-x^2}\\end{bmatrix}=0$$\n",
"\n",
"## Q6 answer\n",
"The vector $\\overrightarrow{AB}$ is made from the coordinates of $B$ minus those of $A$; $\\displaystyle \\overrightarrow{AB} = 2r\\boldsymbol i + 0\\boldsymbol j$,\n",
"\n",
"in the $(i, j)$ basis and in matrix-vector form is $\\displaystyle \\overrightarrow{AB} = \\begin{bmatrix}2r & 0\\end{bmatrix}$.\n",
"\n",
"The dot product to find $\\theta$ is\n",
"\n",
"$$\\displaystyle \\overrightarrow{AB}\\cdot\\overrightarrow{AC}= \\begin{bmatrix}2r& 0 \\end{bmatrix}\\begin{bmatrix}r+x\\\\ \\sqrt{r^2-x^2}\\end{bmatrix}=2r(r+x)$$\n",
"\n",
"The dot product is equivalently given by\n",
"\n",
"$$\\displaystyle |\\overrightarrow{AB}||\\overrightarrow{AC}|\\cos(\\theta) = 2r(\\sqrt{(x+r)^2+r^2-x^2}) = 2r\\sqrt{2r(r+x)}\\cos(\\theta)$$\n",
"\n",
"and so $\\cos(\\theta)=\\sqrt{(r+x)/2r}$. \n",
"\n",
"Repeating the calculation for triangle $COB$ we find that $\\cos(\\varphi)=xx/r$, which could also have been determined directly from the definition of the cosine in this particular case. If $\\varphi = 2\\theta$ then $\\cos(2\\theta) = 2 \\cos^2(\\theta) - 1 \\equiv \\cos(\\varphi)$ should be true. Substituting for the cosines gives $2\\cos^2(\\theta) - 1 =(r+x)/r-1=x/r$ which shows that $\\varphi=2\\theta$. \n",
"\n",
"## Q7 answer\n",
"(a) The dot product is zero when the vectors are perpendicular because $\\cos(90^\\text{o}) = 0$. The dot product is \n",
"\n",
"$$\\displaystyle (a\\boldsymbol i+2\\boldsymbol j-\\boldsymbol k)\\cdot(3a\\boldsymbol i+a\\boldsymbol j+11\\boldsymbol k)=3a^2 +2a-11=0$$\n",
"\n",
"therefore $a=(-1\\pm\\sqrt{34})/3$. In vector-matrix notation \n",
"\n",
"$$\\displaystyle \\vec A\\cdot \\vec B= \\begin{bmatrix}a&2&-1 \\end{bmatrix}\\begin{bmatrix}3a\\\\a\\\\11 \\end{bmatrix} = 3a^2 + 2a - 11 = 0$$\n",
"\n",
"(b) When the vectors are parallel $\\cos(0)=1$ and then $\\vec A\\cdot\\vec B = |\\vec A ||\\vec B |$. Solving for $a$ produces an imaginary number, therefore the two vectors cannot be made parallel.\n",
"\n",
"This result can also be appreciated without resorting to calculation. If two vectors are parallel then the ratio of their components must be in a constant ratio because one is displaced from other. The two vectors have components in the ratios, $a/b$ of $1/3 : 2/a : -1/11$, so no real value of $a$ will make the vectors parallel because the ratio will change with the value of $a$.\n",
"\n",
"## Q8 answer\n",
"The dot product between $\\vec A$ and $\\vec B$ is $\\vec A\\cdot\\vec B=9-10-6 =-7$ and as \n",
"\n",
"$$\\displaystyle \\vec A\\cdot\\vec B=|\\vec A||\\vec B\\cos(\\theta)=-\\sqrt{14}\\sqrt{ 70}\\cos(\\theta)$$\n",
"\n",
"therefore $\\theta = \\cos^{-1}(-7/\\sqrt{980})$, which is $102.9^\\text{o}$.\n",
"\n",
"The vector triangle as drawn, is $\\vec A + \\vec C = \\vec B$, because the vectors point out from the origin; let us choose the third side to be the vector $\\vec C=\\vec B - \\vec A=\\begin{bmatrix}0 &-7& 7\\end{bmatrix}$. Notice that if this vector is drawn on the graph it has to start at the end of $\\vec A$; drawing it as $\\begin{bmatrix}0 &-7& 7\\end{bmatrix}$ will be a line from the origin to coordinate $\\begin{bmatrix}0 &-7& 7\\end{bmatrix}$ which will be parallel to $\\vec C$.\n",
"\n",
"Let the other angle between $\\vec B$ and $\\vec C$ be $\\varphi$, then, $\\displaystyle \\varphi =\\cos^{-1}\\left(\\frac{\\vec B\\cdot\\vec C}{\\sqrt{\\vec B\\cdot\\vec B}\\sqrt{\\vec C\\cdot\\vec C}} \\right)=21.6^\\text{o}$\n",
"\n",
"and the third angle is therefore $55.46^\\text{o}$.\n",
"\n",
"## Q9 answer\n",
"As $\\vec A \\cdot \\vec B = |\\vec A||\\vec B|\\cos(\\theta )$, the dot product $\\displaystyle \\vec A \\cdot \\vec B=\\begin{bmatrix}2\\\\3\\\\4\\end{bmatrix}\\begin{bmatrix}4&3&2\\end{bmatrix}=25$\n",
"\n",
"therefore $|\\vec A|=\\sqrt{4+9+16}=\\sqrt{29}$ and this is also the length of $\\vec B$. The angle is therefore $\\theta=\\cos^{-1}25/29)$ radians. In python the calculation is"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"angle in degrees = 30.45\n"
]
}
],
"source": [
"A = np.array([2,3,4])\n",
"B = np.array([4,3,2])\n",
"theta_rads = np.arccos(np.dot(A,B)/(np.sqrt(np.dot(A,A))*np.sqrt(np.dot(B,B))))\n",
"print('{:s}{:8.5}'.format('angle in degrees =', theta_rads*180/np.pi) )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Q10 answer\n",
"The O-C-CA angle is found from the dot product of $\\overrightarrow {CO}$ and $\\overrightarrow {CC_A}$. Vector $\\overrightarrow {CO}$ is calculated as the coordinates of atom O minus those of atom C, and $\\overrightarrow {CC_A}$ similarly.\n",
"\n",
"$$\\displaystyle \\begin{align} \\overrightarrow=&\\begin{bmatrix}41.688 - 41.412 & 42.322 - 41.542 & 6.632 - 7.455\\end{bmatrix}=\\begin{bmatrix}0.276& 0.870&-0.823\\end{bmatrix}\\\\\n",
"\\overrightarrow =&\\begin{bmatrix}-0.270& 0.395& 1.463\\end{bmatrix}\\end{align}$$\n",
"\n",
"The cosine of the angle, using equation 2 or 6, is $-0.4944$ giving an angle of $119.61^\\text{o}$ which is a typical value for an sp$^2$ type C-CO bond angle. The CO bond length is $\\sqrt{\\vec{CO}\\cdot\\vec{CO}} =1.229$ angstrom.\n",
"\n",
"Calculating the C-CA-N bond angle using Python ,defining the coordinates first as vectors, gives"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CN bond = 1.466 CC bond = 1.539 C-Ca_N angle = 109.4\n"
]
}
],
"source": [
"C = np.array([41.412,41.452,7.455]) # coordinate vectors in Angstrom\n",
"CA = np.array([ 41.142, 41.847, 8.918 ])\n",
"N = np.array([42.193,41.289,9.774]) \n",
"CAC = C - CA # bond vectors \n",
"CAN = N - CA \n",
"CN_bond = np.sqrt(np.dot(CAN,CAN) ); # bondlength angstrom\n",
"CC_bond = np.sqrt(np.dot(CAC,CAC) ); # bondlength\n",
"dCN = np.dot(CAC,CAN)\n",
"dCC = np.dot(CAC,CAC)\n",
"dNN = np.dot(CAN,CAN)\n",
"\n",
"angle = np.arccos(dCN/(np.sqrt(dCC)*np.sqrt(dNN )))*180/np.pi # angle in degrees\n",
"\n",
"print('{:s}{:6.3f}{:s}{:6.3f}{:s}{:6.1f}'.format( \n",
" 'CN bond =', CN_bond,' CC bond =',CC_bond, ' C-Ca_N angle =',angle))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Exercise:** Calculate the CB-CA-N angle and the length of the CO and C$_A$N bonds.\n",
"\n",
"## Q11 answer\n",
"Let $\\vec A=\\begin{bmatrix}2 &3 &-6\\end{bmatrix}$ and $B=\\begin{bmatrix}3 &-2 &4\\end{bmatrix}$ then the line is either $\\vec A-\\vec B$ or $\\vec B-\\vec A$; both are acceptable until the angle to an axis is determined, one will produce an angle of 180° minus the other. The direction cosine with the x-axis base vector $\\vec x$ is \n",
"\n",
"$$\\displaystyle \\cos(\\theta_x)= \\frac{ \\vec x\\cdot(\\vec A - \\vec B)}{|\\vec x||\\vec A-\\vec B|}$$\n",
"\n",
"which is the cosine of the angle of the line to the $x$-axis; see figure 3. Vector $ \\vec A -\\vec B = \\begin{bmatrix}-1& 5 &-10\\end{bmatrix}$ and this has a magnitude $\\sqrt{126}$.\n",
" \n",
"Base vector $\\vec x = \\begin{bmatrix}1& 0& 0\\end{bmatrix}$ because it is the $x$-axis and is normalized to $1$. The dot product with $\\vec A\\vec B$ is $-1$ because two terms in $x$ are zero; the direction cosine is $-1/\\sqrt{126}$. The full calculation is\n",
"\n",
"$$\\displaystyle \\cos(\\theta_x)=\\frac{1}{\\sqrt{126}}\\begin{bmatrix}1& 0& 0\\end{bmatrix}\\begin{bmatrix}-1\\\\ 5\\\\ -10\\end{bmatrix}=-\\frac{1}{\\sqrt{126}}$$\n",
"\n",
"The direction cosines with the other axes are $5/\\sqrt{126} $ and $-10/\\sqrt{126}$ for $y$ and $z$ respectively.\n",
"\n",
"![Drawing](vectors-fig59.png)\n",
"\n",
"Figure 59. The x-direction cosine is the cosine of the angle $\\theta_x$ between the vector and the $x$-axis.\n",
"_______\n",
"The angles are the inverse cosines of these values or $180$ minus the angle if not acute. With the $x$-axis the angle is $95.11^\\text{o}$, with $y, 63.55^\\text{o}$ and with $z, 152.99^\\text{o}$, but as acute angles these must be $84.88, 63.55$, and $27.02$ degrees respectively.\n",
"\n",
"## Q12 answer\n",
"The dot product is that between vectors $\\overrightarrow{OB}$ and $\\overrightarrow{AC}$. The coordinates of $A$ are $(d, 0 0)$ so that the vectors can be written as \n",
"\n",
"$$\\displaystyle \\overrightarrow{OA} = d\\boldsymbol i + 0\\boldsymbol j + 0\\boldsymbol k = d\\boldsymbol i$$\n",
"\n",
"or in matrix vector form as \n",
"\n",
"$$\\displaystyle \\overrightarrow{OA} = \\begin{bmatrix}d &0& 0\\end{bmatrix}$$\n",
"\n",
"either will do. The other vectors are \n",
"\n",
"$$\\displaystyle \\overrightarrow{OC}= 0\\boldsymbol i + d\\boldsymbol j + d\\boldsymbol k; \\quad \\overrightarrow{OB} = d\\boldsymbol i + d\\boldsymbol j + d\\boldsymbol k$$\n",
"\n",
"The vector $\\vec{AC}$ is therefore $\\overrightarrow{AC} = \\overrightarrow{OC} - \\overrightarrow{OA} = -d\\boldsymbol i + d\\boldsymbol j + d\\boldsymbol k$. \n",
"\n",
"The length of the diagonal, the square root of the sum of the square of each term in the vector, is $3d$. The angle is found using the dot product\n",
"\n",
"$$\\displaystyle \\overrightarrow{OB}\\cdot\\overrightarrow{AC}=(d\\boldsymbol i + d\\boldsymbol j + d\\boldsymbol k)\\cdot(-d\\boldsymbol i + d\\boldsymbol j + d\\boldsymbol k) = d^2$$\n",
"\n",
"and \n",
"\n",
"$$\\displaystyle\\overrightarrow{OB} \\cdot\\overrightarrow{AC} =|\\overrightarrow{OB}||\\overrightarrow{AC}|\\cos(\\theta)=9d^2\\cos(\\theta)$$\n",
"\n",
"therefore the angle is $\\theta = \\cos^{-1}(1/3) = 70.52^\\text{o}$ which is $70^\\text{o} 31'$. The obtuse angle can be calculated by reversing one of the vectors or by geometry with the calculation $180 - \\theta$ ; the angle is $109.47^\\text{o}$, which is the tetrahedral bond angle.\n",
"\n",
"![Drawing](vectors-fig60.png)\n",
"\n",
"Figure 60. The tetrahedral angle is $180-\\theta$\n",
"_____\n",
"\n",
"## Q13 answer\n",
"As the bond is drawn within a cube, figure 10, the angle $\\phi = 45^\\text{o}$. Letting the cube have a side of $1$ unit, then the vector \n",
"\n",
"$$\\displaystyle \\overrightarrow{Og}= \\begin{bmatrix}0& 1& 0\\end{bmatrix},\\; \\overrightarrow {Oa} =\\begin{bmatrix}1& 1 &0\\end{bmatrix}, \\; \\vec{Og} =\\begin{bmatrix} 1& 1& 1\\end{bmatrix}$$\n",
"\n",
"Using the equation for dot products with the normalized vectors gives \n",
"\n",
"$$\\displaystyle \\cos(\\theta)=\\frac{1}{\\sqrt{2}}\\begin{bmatrix}1& 1 &0\\end{bmatrix}\\frac{1}{\\sqrt{3}}\\begin{bmatrix}1\\\\ 1 \\\\1\\end{bmatrix}=\\frac{2}{\\sqrt{6}}$$\n",
"\n",
"then $\\theta=35.26^\\text{o}$. The angle$\\chi$ is the angle from the y-axis to the diagonal and is\n",
"\n",
"$$\\displaystyle \\cos(\\chi)=\\begin{bmatrix}0& 1 &0\\end{bmatrix}\\frac{1}{\\sqrt{3}}\\begin{bmatrix}1\\\\ 1 \\\\1\\end{bmatrix}=\\frac{1}{\\sqrt{3}}$$\n",
"\n",
"then $\\chi=54.7^\\text{o}$.\n",
"\n",
"The angle $\\alpha$ is most easily found by making point $g$ the origin and recalculating vectors $\\overrightarrow{gO}$ and $\\overrightarrow{gf}$. The recalculated vectors are $\\overrightarrow{gO} = \\begin{bmatrix}-1 &-1& -1\\end{bmatrix},\\;\\overrightarrow{gf} = \\begin{bmatrix}-1& 1& 1 \\end{bmatrix}$, therefore,\n",
"\n",
"$$\\displaystyle \\cos(\\alpha)=\\frac{1}{\\sqrt{3}}\\begin{bmatrix}-1& -1 &-1\\end{bmatrix}\\frac{1}{\\sqrt{3}}\\begin{bmatrix}-1\\\\ 1 \\\\1\\end{bmatrix}=-\\frac{1}{\\sqrt{3}}$$\n",
"\n",
"and the angle $109.47^\\text{o}$, the normal sp$^3$ bond angle.\n",
"\n",
"## Q14 answer\n",
"(a) If the coordinates of the carbon are selected to be at $(0, 0, 0)$ the H atom, top right, is at position $(a, a, a)$, bottom middle at $(a,-a,-a)$,and the other two atoms at $(-a, -a, a)$ and $(-a, a, -a)$.\n",
"Now calculate the bond length in terms of $a$. By Pythagoras' theorem the length of the CH bond is calculated with distances as shown in figure 62, where $m$ is the middle of the base of the cube and the distance from the C atom to $m$ is $a$. The distance $mH$ is half the length of the diagonal of the cube and is $\\sqrt{2a^2} = a\\sqrt{2}$, therefore the length CH, the bond length, is $\\sqrt{a^2 + 2a^2} = a\\sqrt{3}$. As the bond length is\n",
"$0.157$ nm, then the side of the cube, of length $2a$, is $0.181$ nm. The distance between H atoms is $2 mH$,\n",
"which is $2a\\sqrt{2}$ or $0.256$ nm.\n",
"\n",
"![Drawing](vectors-fig61-62.png)\n",
"\n",
"Left Figure 61, Right fig 62. Left. Methane is shown drawn inside a tetrahedron and in the conventional perspective way. The axes are shown as dashed lines. Right. Bond length calculation.\n",
"______\n",
"\n",
"(b) To use the dot product to work out the bond angles, allow any two CH bonds to be vectors and call them $\\vec B_1$ and $\\vec B_2$, then $\\vec B_1\\cdot\\vec B_2 = |\\vec B_1 ||\\vec B_2 |\\cos(\\theta)$, which immediately presents us with a problem because we need to work out $\\vec B_1\\cdot\\vec B_2$. Let $\\vec B_1$ be the vector from the carbon to the H atom at $(a, -a, -a)$ and let $\\vec B_2$ be that to the H atom at $(a,a,a)$. Any pair can be chosen because the result will be the same by symmetry. The next step is to write each vector in its basis-set as a list of numbers to represent the vector as a one-dimensional row or column matrix. If a row vector is written $\\vec B_1 = \\begin{bmatrix}a &-a& -a\\end{bmatrix}$ in the basis of $(x, y, z)$, the corresponding column vector is clearly\n",
"\n",
"$$\\displaystyle \\begin{bmatrix}a\\\\a\\\\a\\end{bmatrix}$$\n",
"\n",
"Then using matrix multiplication rules, \n",
"\n",
"$$\\displaystyle \\vec B_1\\cdot\\vec B_2 = \\begin{bmatrix}a&-a&-a\\end{bmatrix}\\begin{bmatrix}a\\\\a\\\\a\\end{bmatrix}=-a^2$$\n",
"\n",
"in which the first entry of each column or row is multiplied together and similarly for the second and third, and the sum of the three products is then made. In a dot product, the left hand of the two vectors is always a row; the right hand always a column. Using the dot product, the angle $\\theta$ in the tetrahedron is given by\n",
"\n",
"$$\\displaystyle \\cos(\\theta)=\\frac{\\vec B_1\\cdot\\vec B_2}{|\\vec B_1||\\vec B_2|}=\\frac{-a^2}{3a^2}$$\n",
"\n",
"as the magnitude of each vector is $a\\sqrt{3}$. The angle is therefore $\\theta=\\cos^{-1}(-1/3)=1.9106$ radian which corresponds to $109.47^\\text{o}$. The calculation done symbolically using Python/Sympy is"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAACgAAAAUCAYAAAD/Rn+7AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy89olMNAAAACXBIWXMAABJ0AAASdAHeZh94AAAB1ElEQVR4nM3WPWgVURAF4C+inZGYgD+QIGqRLlY2ksKfSiwMNgZRwVKxEgsDwjAWQholhWktRNDaThJMp/hDIgQFUbFKRJAgpFBQnsW+hc0mIgsP8gYWlpl7zz3MPecyPa1WSzfH1s08PDMncAbD+IUXmIiIxXLNlk3iVsZRTOMIjuM3ZjKzv1zQ001XnJnb8QNjEfGEze9gPXoVnFbKRLcRnMICnpeJTTVJNTLzDkYxGhF/ynzHCWbmOZzCYexVCP8jpiPi/j/23MU4jkXE52qtoybJzF6Ffl7hHb5hF05jADciYrK2Zwpn2+Te1zE73cEWBiPia43ETXzAJUxW8vdwAWNYycw97dJqRKzSYZNExGqdXDu/jCX010pXFM6dxXLlu14uWNPBzPyCfQ04PYyI85X9O3FVocFh7LC2CfM14j3/O6B+xZ/wswHBpQq5ETzFbrzEI3xXmGQ/LuJtA+z1BCPiRFOASjxAn0Lsc9VCZt5q/75uCtoRDWbmEEYwtwG5PoU54E1T7E6ZpJTFgczcViYzcwCPMai46oWmwB17BzNzVjGRzGNG8UifxDPFSLUYEYea4nbymRlX6HAIl3EQ13C7fU5j/dFl49ZG0W3TzLr4C1Dykq92p8/TAAAAAElFTkSuQmCC\n",
"text/latex": [
"$\\displaystyle - a^{2}$"
],
"text/plain": [
" 2\n",
"-a "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a = symbols('a')\n",
"\n",
"B1 = Matrix([a,-a,-a])\n",
"B2 = Matrix([a,a,a])\n",
"dot_prod = B1.dot(B2)\n",
"dot_prod"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAADIAAAASCAYAAAAZk42HAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy89olMNAAAACXBIWXMAABJ0AAASdAHeZh94AAACPElEQVR4nN3WTWhVVxAH8F9URKhfYG2kEIRgsxK04KYiVQpCWyI14rJQN25EF0I2lsJ0kPqxsyKupRIXLhpdFEstCKXoQkgwy1CJggaDieJClFKNi3ufPF985j175YF/uJx758zMPf8zc2ZO1+zsrPcBi6p0lpm7sRUbsQHLMBQR37Zg241JnI6IA6XsODahDx/iCW7jAk5FxEzNfkGVRPAD9iuI3G3T9ptyPb/WyQ7iA1zGzxjCf/gRY5nZU1OsNCLlj+/gH0VkrrRhO4AZ/FUnWx4RTxsVM/MnfI9D2EfFRCLi5cIzs2W7zFyOL3AuIp7V+ZtDosR5BZFPaoKqU+tt0Y/FGG5Rf0c5jtUEVafW22IAj/HH6yYzcxBLsUJx+LcoSByr6XScSGYuwZe49IZUGkR33ffv2BMR92uCV4hk5i2sbWMdLZXWebBdsdtN0yoi1vCyRG9WRGI0M/sjYoS5EbmJZrvyOky2s+Im2IV/8dt8ihExheHMHME4fsF66HpXnT0ztynKb9OoZeZCTOF6RHzVpv9RRb9aHRHTna5an2OV1qtVPT4ux2d0/rAP4DkuNk5kZh+mIuJRg3wBDuMjXI2Ih1R/19qJneXnmnL8LDPPlO/TETFY6naVutfK3G/E1ziamX9jQtH1uxU3hl7cw96actUR2YjvGmS95UNx4Rss3zehByea+PoT6xQ941OsVPSacZzFyYh4UFN+Z4d9PmTmEcVdqTciJv6vv04e9gHcqIIEHYxI1XgBfZ+tiRJLJm8AAAAASUVORK5CYII=\n",
"text/latex": [
"$\\displaystyle - \\frac{1}{3}$"
],
"text/plain": [
"-1/3"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"angle = dot_prod/( sqrt(B1.dot(B1))*sqrt( B2.dot(B2) ) )\n",
"angle"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Finally, a simpler way to work out the bond length is to calculate the length of one of the CH vectors. The nearest H atom figure 61 has a vector from the origin $\\begin{bmatrix}a &-a &-a\\end{bmatrix}$ and its length squared is $\\displaystyle \\begin{bmatrix}a &-a &-a\\end{bmatrix}\\begin{bmatrix}a \\\\-a \\\\-a\\end{bmatrix}=3a^2$. The H-H distance is the difference between two CH vectors, for example, the nearest and top right $\\begin{bmatrix}a &-a &-a\\end{bmatrix}-\\begin{bmatrix}a &a &a\\end{bmatrix}=8a^2$ or a length $2a\\sqrt{2}$. \n",
"\n",
"## Q15 answer\n",
"The bond is made into a vector and its length calculated using equation 3 and 4. The bond angles are calculated with equation 2. The O-H$_1$ and O-H$_2$ bond vectors are the difference between the atom's coordinates. By symmetry, the bond lengths must be the same but may be slightly different due to experimental uncertainty in determining the coordinates."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"bond 1 = 0.0943 nm, bond 2 = 0.0943 nm, angle = 105.97 degrees\n"
]
}
],
"source": [
"Oatom = np.array([2.0317, -1.1893, -1.0464])\n",
"H1 = np.array([1.1374, -1.0385, -0.7880 ])\n",
"H2 = np.array([2.5201, -0.4437, -0.7383 ])\n",
"dot11 = np.dot( (Oatom-H1),(Oatom-H1))\n",
"dot22 = np.dot( (Oatom-H2),(Oatom-H2))\n",
"bond1 = np.sqrt(dot11 ) # eqn 4\n",
"bond2 = np.sqrt(dot22 )\n",
"angle = np.arccos(np.dot( (Oatom-H1),(Oatom-H2)/(bond1*bond2)) ) \n",
"\n",
"print('{:s}{:6.4f}{:s}{:6.4f}{:s}{:8.2f}{:s}'.\n",
" format('bond 1 = ',bond1/10,' nm, bond 2 = ', bond2/10,' nm, angle = ', angle*180/np.pi,' degrees' ) )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Q16 answer\n",
"Define vectors for each atom in NH$_3$; use the dot product of the difference of two atom vectors to calculate the bond length; equation 9."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"bond length/angstrom 1.0010 1.0072 1.0004\n",
"bond angles/degree 108.04 107.65 107.75\n"
]
}
],
"source": [
"N = np.array([-0.0200,-0.9149,0.1781])\n",
"H1= np.array([0.5390, -0.08866, 0.09569])\n",
"H2= np.array([0.1972, -1.5122, -0.6032 ])\n",
"H3= np.array([-0.9788, -0.6416, 0.09542])\n",
"\n",
"dotNH1 = np.dot(N-H1,N-H1)\n",
"dotNH2 = np.dot(N-H2,N-H2)\n",
"dotNH3 = np.dot(N-H3,N-H3)\n",
"\n",
"bond1 = np.sqrt(dotNH1)\n",
"bond2 = np.sqrt(dotNH2)\n",
"bond3 = np.sqrt(dotNH3)\n",
"angle1= np.arccos( np.dot(N-H1,N-H2)/bond1*bond2 )*180/np.pi\n",
"angle2= np.arccos( np.dot(N-H1,N-H3)/bond1*bond3 )*180/np.pi\n",
"angle3= np.arccos( np.dot(N-H2,N-H3)/bond2*bond3 )*180/np.pi\n",
"print('{:s}{:8.4f}{:8.4f}{:8.4f}'.format( 'bond length/angstrom', bond1,bond2,bond3) )\n",
"print('{:s} {:8.2f} {:8.2f} {:8.2f}'.format( 'bond angles/degree',angle1,angle2,angle3) )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"which produces an average bond length of $1.003 \\pm 0.004$ angstrom. The mean angle is $107.8 \\pm 0.2$ degrees using $\\bar x=(\\sum_i x_i)/n$, and $ \\sigma^2=(\\sum_i(x_i-\\bar x)^2)/(n-1)$.\n",
"\n",
"(b) Ammonia has a three fold symmetry (C$_{3V}$ point group). Bond angles and distances confirm this within the experimental error. The distance from the plane of the hydrogen atoms to the nitrogen can therefore be calculated by finding the mid-point of the three H atoms and calculating the distance of this point from the N atom."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"N to mean H distance 0.3623 angstrom\n"
]
}
],
"source": [
"Hav = (H1 + H2 + H3)/3\n",
"dist= np.sqrt( np.dot(Hav - N,Hav - N) )\n",
"print('{:s} {:6.4f} {:s}'.format('N to mean H distance', dist, ' angstrom') ) "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This distance $0.36$ angstrom, is slightly smaller than the $0.38$ measured by microwave spectroscopy (Gordy et al. 1953, p. 128). A general method of finding the distance of an atom from a plane is described in section 16.3.\n",
"\n",
"## Q17 answer \n",
"Suppose that two points $(0,u,v)$ and $(0,u,-v)$} are chosen arbitrarily. To find the angle, make $\\vec B_1$ and $\\vec B_2$ the vectors from the centre to these two vertices and calculate the dot product. The angle between them is \n",
"\n",
"$$\\displaystyle \\cos(\\theta)=\\frac{\\vec B_1\\cdot \\vec B_2}{|\\vec B_1||\\vec B_2|}$$\n",
"\n",
"Expanding the dot product in the $(x,y,z)$ basis as vectors gives\n",
"\n",
"$$\\displaystyle \\vec B_1\\cdot \\vec B_2=\\begin{bmatrix}0&u&v\\end{bmatrix}\\begin{bmatrix}0\\\\u\\\\-v\\end{bmatrix}=u^2-v^2$$\n",
"\n",
" ![Drawing](vectors-fig61b.png)\n",
" _____\n",
"\n",
"As the magnitude of each vector is $\\sqrt{u^2 + v^2}$, the enclosed angle is $\\displaystyle \\theta =\\cos^{-1}\\left( \\frac{u^2 - v^2}{u^2 + v^2} \\right)$. substituting for the values given in the question produces $\\displaystyle \\theta =\\cos^{-1}\\left( \\frac{\\gamma^2 - 1}{\\gamma^2 + 1} \\right)$ and as $\\gamma= (1+\\sqrt{5})/2$, $\\theta= 1.107$ radians or $63.43^\\text{o}$. \n",
"\n",
"**Exercise:** Take other pairs of vertices and find angles of $180^\\text{o}$ and $116.56^\\text{o}$; identify these angles from the centre of the icosahedron to the vertices.\n",
"\n",
"## Q18 answer \n",
"From the sketch in the question $\\vec p$ can represent many vectors if the only condition imposed upon it is that it has to be perpendicular to $\\vec v$. Choosing the point $(1, 1, 0)$ to be the base (origin) of the vector, then $\\vec v$ is the difference between coordinates of the atoms it connects; $\\vec v = \\begin{bmatrix}0 &0& 1\\end{bmatrix}$ and this means that it points in the +$z$-direction, and its origin has been changed; the origin $(0, 0, 0)$ of vector $\\vec v$ is now at its foot. Alternatively, you may consider that $\\vec v$ runs along the z-axis, but either way the dot product is \n",
"\n",
"$$\\displaystyle \\vec v\\cdot\\vec p =\\begin{bmatrix}0 &0& 1\\end{bmatrix}\\begin{bmatrix}p1\\\\ p2\\\\p3\\end{bmatrix}=p_3$$\n",
"\n",
"and $p_3$ must be zero because the vectors $\\vec p$ and $\\vec v$ are at right angles and therefore $\\vec v\\cdot\\vec p = 0$, which means that $p_1$ and $p_2$ can take any values. The vector is therefore $\\vec p = \\begin{bmatrix}p_1& p_2& 0\\end{bmatrix}$ . However, this is not with respect to the axis drawn on the figure because the vector carries its own axes with it, which are parallel to $x, y, z$ on the diagram. All that can be concluded is that $\\vec p$ lies in the $x-y$ plane. The diagram appears therefore somewhat confusing, because the axes as labelled do not refer to the vectors as drawn; $\\vec p$ does lie parallel to the $x-y$ plane in the figure but in its own coordinates with $z = 0$.\n",
"\n",
"## Q19 answer\n",
"The vectors to points $A, B$ and $C$ from the centre are $\\begin{bmatrix}u &v& w\\end{bmatrix},\\begin{bmatrix}u &w &v\\end{bmatrix}$, and $\\begin{bmatrix} w&v&u\\end{bmatrix}$ since the centre of the hexahedron is at $(0, 0, 0)$. The angle $\\theta$ between $A$ and $B$ is defined in the triangle below, left.\n",
"\n",
"![Drawing](vectors-fig63.png)\n",
"\n",
"Figure 63. Section of truncated cube.\n",
"_______\n",
"\n",
"The dot product should be used to find the angle between vectors $\\overrightarrow{OA}$ and $\\overrightarrow{OB}$, which must be normalized or their length determined. This angle is given by \n",
"\n",
"$$\\displaystyle \\theta=\\cos^{-1}\\left(\\frac{\\overrightarrow{OA}\\cdot \\overrightarrow{OB} }{|\\overrightarrow{OA}| |\\overrightarrow{OB}|} \\right)$$\n",
"\n",
"The length of $\\overrightarrow{OA}$ is the same as that of $\\displaystyle \\overrightarrow{OB}$ or $|\\overrightarrow{OA}|^2= \\begin{bmatrix}u&v&w\\end{bmatrix} \\begin{bmatrix}u\\\\v\\\\w\\end{bmatrix}$ hence $|\\overrightarrow{OA}|= u^2+v^2+w^2$ and $\\overrightarrow{OA}\\cdot \\overrightarrow{OB}= \\begin{bmatrix} u&v&w\\end{bmatrix} \\begin{bmatrix}u\\\\w\\\\v\\end{bmatrix} = u^2+2vw$ making the angle \n",
"\n",
"$$\\displaystyle \\theta= \\cos^{-1}\\left( \\frac{u^2+2vw}{u^2+v^2+w^2}\\right)$$\n",
"\n",
"Using values $u=0.6786,\\;v=u,\\; w=0.2811$ produces an angle $\\theta = 32.65^\\text{o}$.\n",
"\n",
"(b) By symmetry the three points $A, B, C$ form an equilateral triangle because they are at an equal distance from the centre of the cube, each distance being $\\sqrt{u^2 + v^2 + w^2}$ and the lengths of the sides of the\n",
"triangle are the same. One side is the vector $OA - OB$ or $\\begin{bmatrix}0& v - w& w-v\\end{bmatrix}$ which has length $(v-w)^2 +(w-v)^2= (v - w)^2$ and because $u = v$, the internal angles must all be $60^\\text{o}$. The triangle is therefore also isosceles (equilateral being a special case of an isosceles triangle). The point $p$ is at the centre of the triangle therefore this has coordinates that must be the average of those of $A, B, C$ and which are\n",
"\n",
"$$\\displaystyle \\left(\\frac{2u+w}{3},\\frac{2v+w}{3},\\frac{u+v+w}{3}\\right)$$\n",
"\n",
"To show that the plane of the triangle is perpendicular to the line from $O$ to $p$, which seems obvious from the figure, form a vector from $A \\to p$ that must lie in the plane of the triangle $ABC$, and find its dot product with $O$p; see the right hand of Fig. 6.63. (We could also have chosen point $B$ or $C$).\n",
"\n",
"The vector\n",
"\n",
"$$\\displaystyle \\overrightarrow{Op}=\\begin{bmatrix}\\displaystyle\\frac{2u+w}{3} &\\displaystyle\\frac{2v+w}{3} &\\displaystyle\\frac{u+v+w}{3} \\end{bmatrix}$$\n",
"\n",
"and from $a$ to $p$ is \n",
"\n",
"$$\\displaystyle \\overrightarrow{Ap}=\\begin{bmatrix}\\displaystyle\\frac{2u+w}{3}-u &\\displaystyle\\frac{2v+w}{3}-v &\\displaystyle\\frac{u+v+w}{3}-w \\end{bmatrix}$$\n",
"\n",
"which is $\\overrightarrow{Op}-\\overrightarrow{Ap}$.\n",
"\n",
"The dot product is easier to calculate if first simplified with $u = v$ to remove $v$. The fact that the dot product is zero, can be seen by inspecting the terms, as the column vector has equal elements and the sum of the first two entries of the row vector are equal but opposite to the third.\n",
"\n",
"$$\\displaystyle \\frac{1}{9}\\begin{bmatrix}-u+w &-u+w &2(u-w) \\end{bmatrix}\\begin{bmatrix}2u+w \\\\2u+w \\\\2u+w \\end{bmatrix}=0$$\n",
"\n",
"Because this product is zero $\\overrightarrow{Op}$ and $\\overrightarrow{Ap}$ are perpendicular.\n",
"\n",
"## Q20 answer\n",
"(a) The vectors of the rays $AB$ and $CD$ are subtracted, as shown below. The dotted line is the resultant vector of length $n\\lambda$; the vector equation is $|\\overrightarrow{AB}|-|\\overrightarrow{CD}|=n\\lambda$.\n",
"\n",
"![Drawing](vectors-fig64.png)\n",
"\n",
"Figure 64. The resultant vector (dotted) has length $n\\lambda$.\n",
"_______\n",
"\n",
"The distance $AB$ is $d\\cos(\\theta)$ and distance $CD$ is $d\\cos(\\phi)$ and their difference must be $n\\lambda$, therefore $d(\\cos(\\theta) - \\cos(\\phi) = n\\lambda$, which is the Laue equation. The zero order angle is the condition, $\\theta = \\phi$. The first order angles occur at $\\theta_{\\pm 1} = \\cos^{-1}(\\pm \\lambda /d + \\cos(\\phi))$ and the second order at $\\theta_{\\pm 2} = \\cos^{-1}(\\pm 2\\lambda/d + cos(\\phi))$.\n",
"\n",
"(b) Using the last two equations, plotting a graph for the zeroth, first, and second orders, n, produced figure 65. \n",
"\n",
"![Drawing](vectors-fig65.png)\n",
"\n",
"Figure 65. Graph of $0, \\pm 1, \\pm 2, \\pm 3$ diffraction orders from a line of atoms separated by $0.4$ nm with Cu K$_{\\alpha 1}$ radiation. $\\phi$ is the incident and $\\theta$ the diffracted angle in degrees.\n",
"________\n",
"\n",
"The zeroth order scattering occurs when the incident X-ray is at any angle to the line of atoms and the scattering occurs at the same angle, i.e. in the direction of the X-rays. This is clearly not very useful.\n",
"\n",
"The first or second, and higher positive order scattering only happens when the diffracted angle $\\theta$, satisfies\n",
"$\\cos(\\theta) - \\cos(\\phi) = n\\lambda/d$. From the graph, the minimum diffracted angle occurs when $\\theta = 0$, i.e. diffraction along the line of atoms; the incident angle is then $\\cos(\\phi) = 1 - n\\lambda/d$ which is $\\approx 52.0^\\text{o}$ for the $+1$ order and $76.7^\\text{o}$ for the $+2$ order. In practice, a larger incident angle would have to be used. The $-1$ and $-2$ orders occur only when $\\phi$ is between its maximum value, which is about $103^\\text{o}$ for the $-2$ order, and zero.\n",
"\n",
"**Exercise:** Calculate the exact limits $\\theta,\\; \\phi$ as appropriate for the $\\pm 1,\\; \\pm 2$ order diffraction."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Q21 answer\n",
"(a) One of each of the planes $(1\\;1\\;2)$ and $(2\\;2\\;4)$ are shown on the figure. The $(1\\;1\\;2)$ shown has lattice points $a = 4, b = 4, c = 2$ making the fractions $1/4, 1/4, 1/2$. Clearing fractions produces the Miller indices. The other two mentioned in the question can easily be added.\n",
"\n",
"![Drawing](vectors-fig66.png)\n",
"\n",
"Figure 66. lattice planes\n",
"________\n",
"\n",
"To prove that the planes are parallel, the $(1\\;1\\;2)$ and $(2\\;2\\;4)$ are chosen. One plane is parallel to another if the angle between their normal vectors is zero, the normal being the cross product of two vectors in the same plane. The plane $(1\\;1\\;2)$ is described in reciprocal space by the vectors $\\vec p=\\begin{bmatrix}1& 0 &0\\end{bmatrix}, \\vec q=\\begin{bmatrix}0 &1& 0\\end{bmatrix}$ and $\\vec r=\\begin{bmatrix}0 &0& 2\\end{bmatrix}$. Two vectors in this plane are therefore $\\vec p - \\vec q = \\begin{bmatrix}1 &-1& 0\\end{bmatrix}$ and $\\vec p - \\vec r = \\begin{bmatrix}1 &0& -2\\end{bmatrix}$ and by definition their cross product must be normal to the plane. This normal vector $\\vec n_1 =(\\vec p-\\vec q)\\times (\\vec p-\\vec r)$ can be formed in the basis set of the reciprocal axes $\\vec {a^*},\\vec {b^*},\\vec{c^*}$ and calculated as the determinant,\n",
"\n",
"$$\\displaystyle \\vec n_1=\\begin{vmatrix}\\vec{a^*} & \\vec{b^*} & \\vec{c^*} \\\\ 1& - 1&0 \\\\1 & 0 & -2 \\end{vmatrix} = 2\\vec{a^*} + 2\\vec{b^*} + \\vec{c^*}$$\n",
"\n",
"The starred axes labels are conventionally used to denote the reciprocal axes. In matrix-vector form, this vector is\n",
"$\\vec n_1 = \\begin{bmatrix}2 &2 &1\\end{bmatrix}$. The similar vectors for the plane $(2\\;2\\;4)$ are $\\vec p=\\begin{bmatrix}2 &0 &0\\end{bmatrix}, q=\\begin{bmatrix}0 &2& 0\\end{bmatrix}$ and $\\vec r=\\begin{bmatrix}0& 0 &4\\end{bmatrix}$, consequently\n",
"\n",
"$$\\displaystyle \\vec n_2=\\begin{vmatrix}\\vec{a^*} & \\vec{b^*} & \\vec{c^*} \\\\ 2& - 2&0 \\\\2 & 0 & -4 \\end{vmatrix} = 8\\vec{a^*} + 8\\vec{b^*} + 4\\vec{c^*}$$\n",
"\n",
"or in vector form $\\vec n_2=\\begin{bmatrix}8&8&4\\end{bmatrix}$. The normalization constants for the two vectors $\\vec n_1$ and $\\vec n_2$ are respectively $3$ and $12$ and the dot product of these two normalised vectors is\n",
"unity.\n",
"\n",
"$$\\displaystyle \\frac{1}{36}\\begin{bmatrix}2&2&1\\end{bmatrix}\\begin{bmatrix}8\\\\8\\\\4\\end{bmatrix}=1$$\n",
"\n",
"The angle between the two normal vectors is zero because $\\cos(0) = 1$, and therefore these planes are parallel.\n",
"\n",
"(b) Following part(a) but now using the Miller indices, the vectors of the first plane are $\\begin{bmatrix}h&0&0\\end{bmatrix}, \\begin{bmatrix}0&k&0\\end{bmatrix}, \\begin{bmatrix}0&0&l\\end{bmatrix}$; the two vectors in the plane are then the differences $\\begin{bmatrix}h&-k&0\\end{bmatrix}, \\begin{bmatrix}h&0&-l\\end{bmatrix}$ and their cross product the vector $\\vec v=\\begin{bmatrix}kl&hl&hk\\end{bmatrix}$, and similarly for another plane the vector must be $\\vec{v'}=\\begin{bmatrix}k'l'&h'l'&h'k'\\end{bmatrix}$.\n",
"\n",
"To obtain the dot product, the vectors must be normalised; the constants are \n",
"\n",
"$$\\displaystyle |\\vec v|=\\sqrt{(kl)^2+(hl)^2+(hk)^2},\\quad\\text{and}\\quad |\\vec {v'}|=\\sqrt{(k'l')^2+(h'l')^2+(h'k')^2}$$\n",
"\n",
"and the angle obtained from the dot product\n",
"\n",
"$$\\displaystyle \\cos(\\theta)=\\frac{\\vec v\\cdot\\vec{v'}}{|\\vec v||\\vec{v'}|}$$\n",
"\n",
"The calculation in Python is"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"planes parallel \n",
"planes at angle 54.74 degrees\n"
]
}
],
"source": [
"# Algorithm Testing for parallel planes.\n",
"#------------------------\n",
"def parl_planes(h,k,ell,h1,k1,ell1): # input hkl, for each plane \n",
"\n",
" p = np.array([h,0,0])\n",
" q = np.array([0,k,0])\n",
" r = np.array([0,0,ell])\n",
" \n",
" p1 = np.array([h1,0,0])\n",
" q1 = np.array([0,k1,0])\n",
" r1 = np.array([0,0,ell1])\n",
" \n",
" cp = np.cross(p-q, p-r)\n",
" cp1= np.cross(p1-q1,p1-r1)\n",
" \n",
" dotp = np.dot(cp1,cp)/( np.sqrt(np.dot(cp,cp))*np.sqrt( np.dot(cp1,cp1) ) )\n",
" if (dotp == 1):\n",
" print('planes parallel ')\n",
" else:\n",
" print('{:s}{:8.2f}{:s}'.format('planes at angle',np.arccos(dotp)*180/np.pi,' degrees' ) )\n",
"#----------------------- \n",
"parl_planes(1,1,2,3,3,6)\n",
"parl_planes(1,1,1,2,2,0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You will have noticed that parallel planes in reciprocal space have indices that are each integer multiples of one another. \n",
"\n",
"(c) The larger of the two planes in the diagram, has intercepts $a/2, b/4$ and $3c/4$. The Miller indices are therefore $(2\\; 4 \\;4/3)$ which has to be simplified further to $(6\\; 12\\; 4)$ and this is parallel to $(3\\; 6\\; 2)$.\n",
"\n",
"(d) If a plane is perpendicular to $(h\\;k\\;l)$,then the dot product of the normal to each plane must be zero. In this case, from the equation giving the angle between the planes $\\cos(\\theta) = \\cdots$ , it must follow that $klk'l' + hlh'l' + khk'h' = 0$. As only $h, k, l$ are known a _unique_ plane perpendicular to our victim plane cannot be found. Only when two indices are known is the third uniquely defined.\n",
"\n",
"## Q22 answer\n",
"(a) The equation for the perpendicular (shortest) distance from the origin to the plane is\n",
"\n",
"$$\\displaystyle d_0=\\frac{1}{\\sqrt{(1/p)^2+(1/q)^2+(1/r)^2}}$$\n",
"\n",
"when the plane has intercepts, $p,q,r$. \n",
"\n",
"(b) The intercepts of the plane $(1\\;1\\;0)$ are $p=a,q=b,r=\\infty$ thus the perpendicular distance from the origin is $d_0=ab/\\sqrt{a^2+b^2}$. The plane $(2\\;2\\;0)$ has intercepts $p=a/2,q=b/2,r=\\infty$ and thus $d_0=ab/2\\sqrt{a^2+b^2}$ and the separation between then is the difference.\n",
"\n",
"The values for other planes are calculated in a similar way; for example, plane $(\\bar 3\\; 2 \\;0)$ has intercepts $h = -a/3, k=b/2, l=\\infty$.\n",
"\n",
"(c) The distance between consecutive planes is calculated by taking a lattice point $(h \\;k\\;l)$ and doubling the values, for example $(1\\;1\\;1)$ is parallel to $(2\\;2\\;2)$ and so forth. The distance to a general plane $(h \\;k\\;l)$ from the origin is\n",
"\n",
"$$\\displaystyle d_0=\\frac{1}{\\sqrt{(h/a)^2+(k/b)^2+(l/c)^2}}$$\n",
"\n",
"and the distance to the next plane is obtained as $a\\to 2a$ etc., then \n",
"\n",
"$$\\displaystyle d_1=\\frac{2}{\\sqrt{(h/a)^2+(k/b)^2+(l/c)^2}}$$\n",
"\n",
"and the difference is \n",
"\n",
"$$\\displaystyle d= d_1-d_0=\\frac{1}{\\sqrt{(h/a)^2+(k/b)^2+(l/c)^2}}$$\n",
"\n",
"which is more usually written as \n",
"\n",
"$$\\displaystyle \\frac{1}{d^2}=\\left(\\frac{h}{a}\\right)^2+\\left(\\frac{k}{b}\\right)^2+\\left(\\frac{l}{c}\\right)^2$$\n",
"\n",
"**Exercise:** Calculate the distance $d$ (part c) for a hexagonal lattice.\n",
"\n",
"## Q23 answer\n",
"If the origin $(0, 0, 0)$ is at O, the vector $\\vec S_0$ has coordinates $(x, y) = (1/\\lambda, 0)$ and therefore $\\vec S_0 = \\begin{bmatrix}1/\\lambda & 0\\end{bmatrix}$. Using the projection of $\\vec S$ onto the line OB, see Fig. 3 for an example, the coordinates of point $P$ define the vector\n",
"\n",
"$$\\displaystyle \\vec S=\\begin{bmatrix}\\cos(2\\theta)/\\lambda &\\sin(2\\theta)/\\lambda\\end{bmatrix}$$\n",
"\n",
"Because $\\vec h\\cdot \\vec h=|\\vec S-\\vec S_0|^2$,\n",
"\n",
"$$\\displaystyle \\vec h\\cdot \\vec h=\\frac{1}{d^2}=\\frac{1}{\\lambda^2}\\left((1-\\cos(2\\theta))^2+\\sin^2(2\\theta) \\right)$$\n",
"\n",
"and simplifying using $2\\sin^2(\\theta) = 1 - \\cos(2\\theta)$ gives\n",
"\n",
"$$\\displaystyle \\frac{1}{d^2}=\\frac{2}{\\lambda^2}(1-\\cos(2\\theta))=\\frac{4\\sin^2(\\theta)}{\\lambda^2}$$\n",
"\n",
"which, by simplifying and rearranging, gives Bragg's Law; $\\lambda = 2d\\sin(\\theta)$.\n",
"\n",
"## Q24 answer\n",
"(a) Follow the pattern to complete all the labels!\n",
"\n",
"(b) This separation is the reciprocal of the distance from the origin of the lattice to $(Q\\;3\\;0)$ on the Ewald diagram. This distance is $\\sqrt{(3b^*)^2 + a^*} = 48\\;\\mathrm{nm^{-1}}$, which makes the separation $0.144$ nm. The angle is calculated as the dot product of the vector, call this $\\vec B_1$ from $(Q;1\\;0) \\to (Q\\;3;0)$ and that of $\\vec B_2$, from $(Q\\;1;0) \\to (0;0;0)$. To make the calculation easier, move the vectors' origin to the point $(Q \\;1\\;0)$, at the centre of the sphere, then the vector $\\vec B_1$ is $\\vec B_1=\\begin{bmatrix}0&2b^*& 0\\end{bmatrix}$ and when normalised is $\\vec B_1=\\begin{bmatrix}0&2b^*& 0\\end{bmatrix}/2b^* =\\begin{bmatrix}0&1& 0\\end{bmatrix} $.\n",
"\n",
"Vector $\\vec B_2=\\begin{bmatrix}a^*&-b^*& 0\\end{bmatrix}$. and when normalised is $\\vec B_2=\\begin{bmatrix}a^*&-b^*& 0\\end{bmatrix}/\\sqrt{a^{*2}+b^{*2}}$. The angle between the vectors is calculated using the dot product\n",
"\n",
"$$\\displaystyle \\cos(\\theta)=\\frac{\\vec b_1\\cdot\\vec B_2}{|\\vec B_1||\\vec B_2|}=\\begin{bmatrix}0&1& 0\\end{bmatrix}\\begin{bmatrix}a^*\\\\-b^*\\\\ 0\\end{bmatrix}\\frac{1}{\\sqrt{a^{*2}+b^{*2}}}=-\\frac{b^*}{\\sqrt{a^{*2}+b^{*2}}} $$\n",
"\n",
"Substituting in values gives $\\cos(\\theta) = -1/2$ and the angle is $120^\\text{o}$.\n",
"\n",
"(c) The wavelength to observe a lattice plane $(0\\;1\\;0)$ at the same crystal angle, is $1/a^*$ which is $1/(2\\sqrt{3}) = 0.288$ nm. To observe the planes at $(1\\;2\\;0)$ the radius of the Ewald sphere has to be $\\sqrt{(2a^*)^2 + (2b^*)^2} = 8\\;\\mathrm{nm^{-1}}$ and therefore an X-ray wavelength of $0.125$ nm is required.\n",
"\n",
"(d) The crystal is rotated about the origin of the reciprocal space. The point $(1\\;2\\;0)$ has then to intersect the sphere, or circle, in our diagram. From the diagram, the point $(1\\;2\\;0)$ rotates about the origin with a circle of radius $\\sqrt{(2b^*)^2 + a^{*2}}$ because this reciprocal lattice plane is at coordinates $(a^*, 2b^*)$. The calculation now becomes one of calculating the intersection of two circles, the second of radius $1/\\lambda$ or $4\\;\\mathrm{ nm^{-1}}$ but centred at $(\\bar 1\\;1\\;0)$, and then finding the angle moved from the initial position.\n",
"The equation of a circle of radius $r$ centred at points $p$ and $q$ is $(x - p)^2 + (y - q)^2 = r^2$ therefore the larger circle centred at the origin is $x^2 + y^2 = a^{*2} + 2b^{*2}$ and that centred at $(\\bar 1\\;1\\;0)$ is $(x-a^*)^2 +(y+a^*)^2 =1/\\lambda^2$. For simplicity $y$ is the vertical axis, $x$ the horizontal. At the intersection of the circles these two equations are equal. The simplest way to do this is to use Python/Sympy to solve the equations,\n",
"but to do this by hand substitute $x$ in to the second equation and solve for $y$ then substitute this answer\n",
"again to find $x$.\n",
"\n",
"![Drawing](vectors-fig67.png)\n",
"\n",
"Figure 67. The construction shows the angle $\\theta$ moved by point $(1\\;2\\;0)$ to intersect with the Ewald sphere centred at $(\\bar 1\\;1\\;0)$. The smaller grey circle describes the rotation of point $(0\\;1\\;0)$ about the origin.\n",
"_____"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"x,y= -5.015 -1.687 x,y= -1.047 5.187\n"
]
}
],
"source": [
"x, y = symbols('x, y') # use Sympy, define unknowns x, y\n",
"\n",
"a = 2*np.sqrt(3)\n",
"b = 2\n",
"lamb = 0.25\n",
"c1 = x**2 + y**2 - a**2 - (2*b)**2\n",
"c2 = (x+a)**2 + (y-b)**2 - 1/lamb**2\n",
"\n",
"ans = solve([c1,c2],(x,y))\n",
"\n",
"print('{:s}{:6.3f} {:6.3f}{:s}{:6.3f} {:6.3f}'.format('x,y= ', ans[0][0], ans[0][1],' x,y= ', ans[1][0],ans[1][1] ))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The initial point $(1\\;2\\;0)$ has coordinates $(a^*, 2b^*)$ and the angle between this and the points of intersection are found using a dot product. The vector to $(\\bar 1\\;1\\;0)$ is $\\bar v_1 =\\begin{bmatrix}2\\sqrt{3} &4\\end{bmatrix}$ and to the upper intersection $\\vec v_2 = \\begin{bmatrix}-1.04678& 5.1869\\end{bmatrix}$. The smaller angle to the diffraction position is $52.3^\\text{o}$, as calculated"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"angle = 52.31 degrees\n"
]
}
],
"source": [
"v1 = np.array([a,2*b])\n",
"v2 = np.array([-1.047,5.186])\n",
"dotp= np.dot(v1,v2)/(np.sqrt(np.dot(v1,v1))*np.sqrt(np.dot(v2,v2)) ) \n",
"theta=np.arccos(dotp)\n",
"print('{:s}{:8.2f}{:s}'.format('angle = ', theta*180/np.pi,' degrees'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The crystal has to be rotated anticlockwise by $52.3^\\text{o}$ to cause diffraction from the $(1\\;2\\;0)$ plane; the crystal could also be turned by $108.6^\\text{o}$. The $(0\\;1\\;0)$ plane has coordinates $(0, b^*)$ and has to be rotated clockwise by a small angle to reach the Ewald sphere. The equation of its circle is $x^2 + y^2 = b^{*2}$ and the intersection points, calculated in the same way as for point $(1\\;2\\;0)$, gives a clockwise rotation angle of $15.5^\\text{o}$ or anticlockwise of $135.5^\\text{o}$."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}