// Numbas version: exam_results_page_options {"name": "Simon's copy of Find directional derivative of a scalar field,", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"type": "question", "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "pickQuestions": 0, "name": ""}], "variable_groups": [], "variables": {"lenu": {"group": "Ungrouped variables", "name": "lenu", "definition": "abs(u)", "templateType": "anything", "description": ""}, "q": {"group": "Ungrouped variables", "name": "q", "definition": "vector(repeat(random(1..2)*sign(random(-1,1)),3))", "templateType": "anything", "description": ""}, "gradfq": {"group": "Ungrouped variables", "name": "gradfq", "definition": "vector(p1*a1*q[0]^(p1-1)*q[1]^p2*q[2]^p3+p4*b1*q[0]^(p4-1)*q[1]^p5*q[2]^p6,p2*a1*q[0]^p1*q[1]^(p2-1)*q[2]^p3+p5*b1*q[0]^p4*q[1]^(p5-1)*q[2]^p6,p3*a1*q[0]^p1*q[1]^p2*q[2]^(p3-1)+p6*b1*q[0]^p4*q[1]^p5*q[2]^(p6-1))", "templateType": "anything", "description": ""}, "p4": {"group": "Ungrouped variables", "name": "p4", "definition": "random(0..2 except p1)", "templateType": "anything", "description": ""}, "p6": {"group": "Ungrouped variables", "name": "p6", "definition": "random(0..2 except p3)", "templateType": "anything", "description": ""}, "p2": {"group": "Ungrouped variables", "name": "p2", "definition": "random(0..2)", "templateType": "anything", "description": ""}, "p5": {"group": "Ungrouped variables", "name": "p5", "definition": "random(0..2 except p2)", "templateType": "anything", "description": ""}, "u": {"group": "Ungrouped variables", "name": "u", "definition": "vector(repeat(random(1..9)*sign(random(-1,1)),3))", "templateType": "anything", "description": ""}, "b1": {"group": "Ungrouped variables", "name": "b1", "definition": "random(2..9)*sign(random(-1,1))", "templateType": "anything", "description": ""}, "p1": {"group": "Ungrouped variables", "name": "p1", "definition": "random(0..2)", "templateType": "anything", "description": ""}, "uhat": {"group": "Ungrouped variables", "name": "uhat", "definition": "vector(u[0]/lenu,u[1]/lenu,u[2]/lenu)", "templateType": "anything", "description": ""}, "a1": {"group": "Ungrouped variables", "name": "a1", "definition": "random(2..9)*sign(random(-1,1))", "templateType": "anything", "description": ""}, "p3": {"group": "Ungrouped variables", "name": "p3", "definition": "random(0..2)", "templateType": "anything", "description": ""}, "uhatdotgradfq": {"group": "Ungrouped variables", "name": "uhatdotgradfq", "definition": "precround(uhat[0]*gradfq[0]+uhat[1]*gradfq[1]+uhat[2]*gradfq[2],3)", "templateType": "anything", "description": ""}}, "showQuestionGroupNames": false, "preamble": {"js": "", "css": ""}, "tags": ["checked2015", "MAS1603", "MAS2104"], "name": "Simon's copy of Find directional derivative of a scalar field,", "rulesets": {}, "statement": "

You are given the scalar field $f=\\simplify{{a1}*x^{p1}*y^{p2}*z^{p3}+{b1}*x^{p4}*y^{p5}*z^{p6}}$.

", "ungrouped_variables": ["a1", "b1", "gradfq", "lenu", "p1", "p2", "p3", "p4", "p5", "p6", "q", "u", "uhat", "uhatdotgradfq"], "functions": {}, "parts": [{"type": "gapfill", "prompt": "

Calculate $\\boldsymbol{\\nabla}f$.

\n

$\\boldsymbol{\\nabla}f=($[[0]]$,$[[1]]$,$[[2]]$)$.

", "marks": 0, "variableReplacements": [], "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "gaps": [{"vsetrangepoints": 5, "answer": "{p1*a1}*x^{p1-1}*y^{p2}*z^{p3}+{p4*b1}*x^{p4-1}*y^{p5}*z^{p6}", "type": "jme", "vsetrange": [0, 1], "showCorrectAnswer": true, "checkingaccuracy": 0.001, "answersimplification": "all", "showpreview": true, "checkvariablenames": true, "checkingtype": "absdiff", "variableReplacements": [], "expectedvariablenames": ["x", "y", "z"], "marks": 1, "scripts": {}, "variableReplacementStrategy": "originalfirst"}, {"vsetrangepoints": 5, "answer": "{p2*a1}*x^{p1}*y^{p2-1}*z^{p3}+{p5*b1}*x^{p4}*y^{p5-1}*z^{p6}", "type": "jme", "vsetrange": [0, 1], "showCorrectAnswer": true, "checkingaccuracy": 0.001, "answersimplification": "all", "showpreview": true, "checkvariablenames": true, "checkingtype": "absdiff", "variableReplacements": [], "expectedvariablenames": ["x", "y", "z"], "marks": 1, "scripts": {}, "variableReplacementStrategy": "originalfirst"}, {"vsetrangepoints": 5, "answer": "{p3*a1}*x^{p1}*y^{p2}*z^{p3-1}+{p6*b1}*x^{p4}*y^{p5}*z^{p6-1}", "type": "jme", "vsetrange": [0, 1], "showCorrectAnswer": true, "checkingaccuracy": 0.001, "answersimplification": "all", "showpreview": true, "checkvariablenames": true, "checkingtype": "absdiff", "variableReplacements": [], "expectedvariablenames": ["x", "y", "z"], "marks": 1, "scripts": {}, "variableReplacementStrategy": "originalfirst"}]}, {"type": "gapfill", "prompt": "

Calculate $\\boldsymbol{\\nabla}f$ at the point $\\boldsymbol{q}=\\pmatrix{\\var{q[0]},\\var{q[1]},\\var{q[2]}}$.

\n

$\\boldsymbol{\\nabla}f\\pmatrix{\\var{q[0]},\\var{q[1]},\\var{q[2]}}=($[[0]]$,$[[1]]$,$[[2]]$)$.

", "marks": 0, "variableReplacements": [], "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "maxValue": "gradfq[0]", "variableReplacements": [], "correctAnswerFraction": false, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "gradfq[0]", "showPrecisionHint": false}, {"allowFractions": false, "maxValue": "gradfq[1]", "variableReplacements": [], "correctAnswerFraction": false, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "gradfq[1]", "showPrecisionHint": false}, {"allowFractions": false, "maxValue": "gradfq[2]", "variableReplacements": [], "correctAnswerFraction": false, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "gradfq[2]", "showPrecisionHint": false}]}, {"type": "gapfill", "prompt": "

Calculate the unit vector $\\boldsymbol{\\hat{u}}$ in the direction of $\\boldsymbol{u}=\\pmatrix{\\var{u[0]},\\var{u[1]},\\var{u[2]}}$.

\n

$\\boldsymbol{\\hat{u}}=($[[0]]$,$[[1]]$,$[[2]]$)$.  (Enter your answers to 3d.p.)

", "marks": 0, "variableReplacements": [], "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "maxValue": "precround(uhat[0],3)+0.001", "variableReplacements": [], "correctAnswerFraction": false, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "precround(uhat[0],3)-0.001", "showPrecisionHint": false}, {"allowFractions": false, "maxValue": "precround(uhat[1],3)+0.001", "variableReplacements": [], "correctAnswerFraction": false, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "precround(uhat[1],3)-0.001", "showPrecisionHint": false}, {"allowFractions": false, "maxValue": "precround(uhat[2],3)+0.001", "variableReplacements": [], "correctAnswerFraction": false, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "precround(uhat[2],3)-0.001", "showPrecisionHint": false}]}, {"type": "gapfill", "prompt": "

Calculate the directional derivative $\\frac{\\partial f}{\\partial\\boldsymbol{u}}$, of the scalar field $f$, in the direction of $\\boldsymbol{u}$, at the point $\\boldsymbol{q}$.

\n

$\\frac{\\partial f}{\\partial\\boldsymbol{u}}\\pmatrix{\\var{q[0]},\\var{q[1]},\\var{q[2]}}=$ [[0]].  (Enter your answer to 3d.p., and be sure to use the full calculator display from any previous parts in calculating your answer.)

\n

", "marks": 0, "variableReplacements": [], "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "maxValue": "uhatdotgradfq+0.001", "variableReplacements": [], "correctAnswerFraction": false, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "uhatdotgradfq-0.001", "showPrecisionHint": false}]}], "variablesTest": {"maxRuns": 100, "condition": ""}, "metadata": {"description": "

Directional derivative of a scalar field.

", "licence": "Creative Commons Attribution 4.0 International", "notes": ""}, "advice": "

Note that in this advice, the full calculator display is used in the calculation of each step; any rounding is purely for display clarity.

\n

a)

\n

The gradient of $f$ is given by

\n

\\[\\begin{align}\\boldsymbol{\\nabla}f&=\\pmatrix{\\frac{\\partial f}{\\partial x},\\frac{\\partial f}{\\partial y},\\frac{\\partial f}{\\partial z}}\\\\&=\\pmatrix{\\simplify{{p1*a1}*x^{p1-1}*y^{p2}*z^{p3}+{p4*b1}*x^{p4-1}*y^{p5}*z^{p6}},\\simplify{{p2*a1}*x^{p1}*y^{p2-1}*z^{p3}+{p5*b1}*x^{p4}*y^{p5-1}*z^{p6}},\\simplify{{p3*a1}*x^{p1}*y^{p2}*z^{p3-1}+{p6*b1}*x^{p4}*y^{p5}*z^{p6-1}}},\\end{align}\\]

\n

by straight forward partial differentiation.

\n

 

\n

b)

\n

The gradient of $f$ at the point $\\boldsymbol{q}=\\pmatrix{\\var{q[0]},\\var{q[1]},\\var{q[2]}}$ is found by substituting $\\boldsymbol{q}$ into $\\boldsymbol{\\nabla}f$, hence

\n

\\[\\boldsymbol{\\nabla}f\\pmatrix{\\var{q[0]},\\var{q[1]},\\var{q[2]}}=\\pmatrix{\\var{gradfq[0]},\\var{gradfq[1]},\\var{gradfq[2]}}.\\]

\n

 

\n

c)

\n

The unit vector $\\boldsymbol{\\hat{u}}$ in the direction of $\\boldsymbol{u}$ is given by

\n

\\[\\begin{align}\\boldsymbol{\\hat{u}}=\\frac{\\boldsymbol{u}}{\\lvert\\boldsymbol{u}\\rvert}&=\\frac{1}{\\sqrt{(\\var{u[0]})^2+(\\var{u[1]})^2+(\\var{u[2]})^2}}\\pmatrix{\\var{u[0]},\\var{u[1]},\\var{u[2]}}\\\\&=\\frac{1}{\\var{precround(lenu,3)}}\\pmatrix{\\var{u[0]},\\var{u[1]},\\var{u[2]}}\\\\&=\\pmatrix{\\var{precround(uhat[0],3)},\\var{precround(uhat[1],3)},\\var{precround(uhat[2],3)}}.\\end{align}\\]

\n

 

\n

d)

\n

The directional derivative $\\frac{\\partial f}{\\partial\\boldsymbol{u}}$, of the scalar field $f$, in the direction of $\\boldsymbol{u}$, at the point $\\boldsymbol{q}$ is given by

\n

\\[\\begin{align}\\frac{\\partial f}{\\partial\\boldsymbol{u}}\\pmatrix{\\var{u[0]},\\var{u[1]},\\var{u[2]}}&=\\boldsymbol{\\hat{u}\\cdot\\nabla}f\\pmatrix{\\var{q[0]},\\var{q[1]},\\var{q[2]}}\\\\&=\\pmatrix{\\var{precround(uhat[0],3)},\\var{precround(uhat[1],3)},\\var{precround(uhat[2],3)}}\\boldsymbol{\\cdot}\\pmatrix{\\var{gradfq[0]},\\var{gradfq[1]},\\var{gradfq[2]}}\\\\&=\\var{uhatdotgradfq}\\;\\text{to 3d.p., using the full calculator display for the answers in the previous part.}\\end{align}\\]

", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}