// Numbas version: finer_feedback_settings {"name": "Harry's copy of Calculate divergence of vector fields", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"prompt": "
$\\boldsymbol{u}=\\pmatrix{(\\simplify[std]{{a1}*x+{b1}*y+{c1}*z})(\\simplify[std]{{b1}*y-{c1}*z}),(\\simplify[std]{{a1}*y+{b1}*z+{c1}*x})(\\simplify[std]{{b1}*z-{c1}*x}),(\\simplify[std]{{a1}*z+{b1}*x+{c1}*y})(\\simplify[std]{{b1}*x-{c1}*y})}$.
\n$\\boldsymbol{\\nabla\\cdot u}=$ [[0]].
", "scripts": {}, "type": "gapfill", "marks": 0, "gaps": [{"showpreview": true, "checkingaccuracy": 0.001, "scripts": {}, "vsetrangepoints": 5, "answersimplification": "all", "vsetrange": [0, 1], "checkvariablenames": true, "showCorrectAnswer": true, "checkingtype": "absdiff", "answer": "{a1*b1-a1*c1}*x+{a1*b1-a1*c1}*y+{a1*b1-a1*c1}*z", "type": "jme", "marks": 1, "expectedvariablenames": ["x", "y", "z"]}], "showCorrectAnswer": true}, {"prompt": "$\\boldsymbol{u}=\\pmatrix{\\left(x^\\var{p1}+y^\\var{p1}\\right)\\left(\\simplify{{a2}*y^{p1-1}-{a2}*z^{p1-1}}\\right),\\left(y^\\var{p1}+z^\\var{p1}\\right)\\left(\\simplify{{a2}*z^{p1-1}-{a2}*x^{p1-1}}\\right),\\left(z^\\var{p1}+x^\\var{p1}\\right)\\left(\\simplify{{a2}*x^{p1-1}-{a2}*y^{p1-1}}\\right)}$.
\n$\\boldsymbol{\\nabla\\cdot u}=$ [[0]].
", "scripts": {}, "type": "gapfill", "marks": 0, "gaps": [{"showpreview": true, "checkingaccuracy": 0.001, "scripts": {}, "vsetrangepoints": 5, "answersimplification": "all", "vsetrange": [0, 1], "checkvariablenames": true, "showCorrectAnswer": true, "checkingtype": "absdiff", "answer": "0", "type": "jme", "marks": 1, "expectedvariablenames": ["x", "y", "z"]}], "showCorrectAnswer": true}, {"prompt": "$\\boldsymbol{u}=\\pmatrix{\\simplify{{a3}*x}+f_1(y,z),\\simplify{{b3}*y}+f_2(x,z),\\simplify{{c3}*z}+f_3(x,y)}$, for any general functions $f_1$, $f_2$, and $f_3$.
\n$\\boldsymbol{\\nabla\\cdot u}=$ [[0]].
", "scripts": {}, "type": "gapfill", "marks": 0, "gaps": [{"showpreview": true, "checkingaccuracy": 0.001, "scripts": {}, "vsetrangepoints": 5, "answersimplification": "all", "vsetrange": [0, 1], "checkvariablenames": true, "showCorrectAnswer": true, "checkingtype": "absdiff", "answer": "{a3+b3+c3}", "type": "jme", "marks": 1, "expectedvariablenames": ["x", "y", "z"]}], "showCorrectAnswer": true}], "variables": {"b1": {"definition": "random(1..9)*sign(random(-1,1))", "group": "Ungrouped variables", "name": "b1", "templateType": "anything", "description": ""}, "a1": {"definition": "random(1..9)*sign(random(-1,1))", "group": "Ungrouped variables", "name": "a1", "templateType": "anything", "description": ""}, "b3": {"definition": "random(1..9)*sign(random(-1,1))", "group": "Ungrouped variables", "name": "b3", "templateType": "anything", "description": ""}, "p1": {"definition": "random(2..9)", "group": "Ungrouped variables", "name": "p1", "templateType": "anything", "description": ""}, "a3": {"definition": "random(1..9)*sign(random(-1,1))", "group": "Ungrouped variables", "name": "a3", "templateType": "anything", "description": ""}, "c1": {"definition": "random(1..9)*sign(random(-1,1))", "group": "Ungrouped variables", "name": "c1", "templateType": "anything", "description": ""}, "c3": {"definition": "random(1..9)*sign(random(-1,1))", "group": "Ungrouped variables", "name": "c3", "templateType": "anything", "description": ""}, "a2": {"definition": "random(1..9)*sign(random(1,1))", "group": "Ungrouped variables", "name": "a2", "templateType": "anything", "description": ""}}, "question_groups": [{"name": "", "pickQuestions": 0, "pickingStrategy": "all-ordered", "questions": []}], "preamble": {"css": "", "js": ""}, "showQuestionGroupNames": false, "advice": "The divergence of a vector field $\\boldsymbol{u}=\\pmatrix{u_1,u_2,u_3}$ is given by
\n\\[\\boldsymbol{\\nabla\\cdot u}=\\frac{\\partial u_1}{\\partial x}+\\frac{\\partial u_2}{\\partial y}+\\frac{\\partial u_3}{\\partial z}.\\]
\na)
\nThe variables $x$, $y$, and $z$ appear in a cyclical manner in each of the three components of $\\boldsymbol{u}$. Once you have calculated $\\frac{\\partial u_1}{\\partial x}$, you can use cyclic permutations to determine the other two derivatives. Hence
\n\\[\\begin{align}\\frac{\\partial u_1}{\\partial x}&=\\frac{\\partial}{\\partial x}\\left(\\simplify{({a1}*x+{b1}*y+{c1}*z)*({b1}*y-{c1}*z)}\\right)\\\\&=\\simplify{{a1}*({b1}*y-{c1}*z)},\\end{align}\\]
\nand so, cyclically permuting the variables,
\n\\[\\frac{\\partial u_2}{\\partial y}=\\simplify{{a1}*({b1}*z-{c1}*x)}\\]
\nand
\n\\[\\frac{\\partial u_3}{\\partial z}=\\simplify{{a1}*({b1}*x-{c1}*y)}.\\]
\nFinally, adding the components together gives the divergence
\n\\[\\boldsymbol{\\nabla\\cdot u}=\\simplify[std]{{a1}*({b1}*y-{c1}*z)+{a1}*({b1}*z-{c1}*x)+{a1}*({b1}*x-{c1}*y)}=\\simplify{{a1*b1-a1*c1}*x+{a1*b1-a1*c1}*y+{a1*b1-a1*c1}*z}.\\]
\n\n
b)
\nAs in part a) the variables $x$, $y$, and $z$ appear cyclically in each component of $\\boldsymbol{u}$, so we only need calculate one derivative explicitly, then use cyclic permutations to calculate the other two. Hence
\n\\[\\begin{align}\\frac{\\partial u_1}{\\partial x}&=\\frac{\\partial}{\\partial x}\\left\\{\\left(x^\\var{p1}+y^\\var{p1}\\right)\\left(\\simplify{{a2}*y^{p1-1}-{a2}*z^{p1-1}}\\right)\\right\\}\\\\&=\\simplify{{p1}*x^{p1-1}}\\left(\\simplify{{a2}*y^{p1-1}-{a2}*z^{p1-1}}\\right),\\end{align}\\]
\nand by symmetry
\n\\[\\frac{\\partial u_2}{\\partial y}=\\simplify{{p1}*y^{p1-1}}\\left(\\simplify{{a2}*z^{p1-1}-{a2}*x^{p1-1}}\\right),\\]
\nand
\n\\[\\frac{\\partial u_3}{\\partial z}=\\simplify{{p1}*z^{p1-1}}\\left(\\simplify{{a2}*x^{p1-1}-{a2}*y^{p1-1}}\\right).\\]
\nFinally, adding the derivatives together gives the divergence
\n\\[\\boldsymbol{\\nabla\\cdot u}=\\simplify{{p1}*x^{p1-1}}\\left(\\simplify{{a2}*y^{p1-1}-{a2}*z^{p1-1}}\\right)+\\simplify{{p1}*y^{p1-1}}\\left(\\simplify{{a2}*z^{p1-1}-{a2}*x^{p1-1}}\\right)+\\simplify{{p1}*z^{p1-1}}\\left(\\simplify{{a2}*x^{p1-1}-{a2}*y^{p1-1}}\\right)=0.\\]
\n\n
c)
\nFirst note that $f_1$ does not depend on $z$, $f_2$ does not depend on $y$, and $f_3$ does not depend on $z$. This makes the differentiation very straight forward, and hence
\n\\[\\begin{align}\\boldsymbol{\\nabla\\cdot u}&=\\frac{\\partial}{\\partial x}\\left(\\simplify{{a3}*x}+f_1(y,z)\\right)+\\frac{\\partial}{\\partial y}\\left(\\simplify{{b3}*y}+f_1(x,z)\\right)+\\frac{\\partial}{\\partial z}\\left(\\simplify{{c3}*z}+f_1(x,y)\\right)\\\\&=\\simplify[all,!collectNumbers]{{a3}+{b3}+{c3}}\\\\&=\\var{a3+b3+c3}.\\end{align}\\]
", "functions": {}, "rulesets": {"std": ["all", "!noLeadingMinus", "!collectNumbers"]}, "ungrouped_variables": ["p1", "a1", "a3", "a2", "b1", "b3", "c3", "c1"], "tags": ["checked2015", "MAS2104"], "type": "question", "metadata": {"notes": "29/11/2013
\nRemove the restriction a2 not equal to p1. The whole point of part b) is that the divergence is always zero. (AJY)
\n26/11/2013
\nFix du/dx typo in advice.
\nSet a2 not equal to p1 to avoid divergence equal to zero.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Divergence of vector fields.
"}, "variable_groups": [], "statement": "For each of the following vector fields $\\boldsymbol{u}$, find the divergence $\\boldsymbol{\\nabla\\cdot u}$.
", "variablesTest": {"condition": "", "maxRuns": 100}, "name": "Harry's copy of Calculate divergence of vector fields", "contributors": [{"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}]}], "contributors": [{"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}