// Numbas version: exam_results_page_options {"name": "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": [{"name": "Find directional derivative of a scalar field", "tags": ["checked2015"], "metadata": {"description": "

Directional derivative of a scalar field.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

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

", "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}\\]

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"p4": {"name": "p4", "group": "Ungrouped variables", "definition": "random(0..2 except p1)", "description": "", "templateType": "anything", "can_override": false}, "q": {"name": "q", "group": "Ungrouped variables", "definition": "vector(repeat(random(1..2)*sign(random(-1,1)),3))", "description": "", "templateType": "anything", "can_override": false}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(0..2)", "description": "", "templateType": "anything", "can_override": false}, "b1": {"name": "b1", "group": "Ungrouped variables", "definition": "random(2..9)*sign(random(-1,1))", "description": "", "templateType": "anything", "can_override": false}, "u": {"name": "u", "group": "Ungrouped variables", "definition": "vector(repeat(random(1..9)*sign(random(-1,1)),3))", "description": "", "templateType": "anything", "can_override": false}, "a1": {"name": "a1", "group": "Ungrouped variables", "definition": "random(2..9)*sign(random(-1,1))", "description": "", "templateType": "anything", "can_override": false}, "lenu": {"name": "lenu", "group": "Ungrouped variables", "definition": "abs(u)", "description": "", "templateType": "anything", "can_override": false}, "p5": {"name": "p5", "group": "Ungrouped variables", "definition": "random(0..2 except p2)", "description": "", "templateType": "anything", "can_override": false}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "random(0..2)", "description": "", "templateType": "anything", "can_override": false}, "p3": {"name": "p3", "group": "Ungrouped variables", "definition": "random(0..2)", "description": "", "templateType": "anything", "can_override": false}, "uhat": {"name": "uhat", "group": "Ungrouped variables", "definition": "vector(u[0]/lenu,u[1]/lenu,u[2]/lenu)", "description": "", "templateType": "anything", "can_override": false}, "gradfq": {"name": "gradfq", "group": "Ungrouped variables", "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))", "description": "", "templateType": "anything", "can_override": false}, "p6": {"name": "p6", "group": "Ungrouped variables", "definition": "random(0..2 except p3)", "description": "", "templateType": "anything", "can_override": false}, "uhatdotgradfq": {"name": "uhatdotgradfq", "group": "Ungrouped variables", "definition": "precround(uhat[0]*gradfq[0]+uhat[1]*gradfq[1]+uhat[2]*gradfq[2],3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a1", "b1", "gradfq", "lenu", "p1", "p2", "p3", "p4", "p5", "p6", "q", "u", "uhat", "uhatdotgradfq"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

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

\n

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

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{p1*a1}*x^{p1-1}*y^{p2}*z^{p3}+{p4*b1}*x^{p4-1}*y^{p5}*z^{p6}", "answerSimplification": "all", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}, {"name": "z", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{p2*a1}*x^{p1}*y^{p2-1}*z^{p3}+{p5*b1}*x^{p4}*y^{p5-1}*z^{p6}", "answerSimplification": "all", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}, {"name": "z", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{p3*a1}*x^{p1}*y^{p2}*z^{p3-1}+{p6*b1}*x^{p4}*y^{p5}*z^{p6-1}", "answerSimplification": "all", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}, {"name": "z", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "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]]$)$.

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "gradfq[0]", "maxValue": "gradfq[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "gradfq[1]", "maxValue": "gradfq[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "gradfq[2]", "maxValue": "gradfq[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "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.)

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "precround(uhat[0],3)-0.001", "maxValue": "precround(uhat[0],3)+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "precround(uhat[1],3)-0.001", "maxValue": "precround(uhat[1],3)+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "precround(uhat[2],3)-0.001", "maxValue": "precround(uhat[2],3)+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "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

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "uhatdotgradfq-0.001", "maxValue": "uhatdotgradfq+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}