// Numbas version: finer_feedback_settings {"name": "Min_max_v2", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {}, "steps": [{"extendBaseMarkingAlgorithm": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "useCustomName": false, "customName": "", "type": "information", "showFeedbackIcon": true, "prompt": "
Give an advice about calculating some points...
\nAlternatively, give them the graph of this function
", "variableReplacements": [], "customMarkingAlgorithm": ""}], "customName": "", "marks": 0, "displayColumns": 0, "type": "1_n_2", "showFeedbackIcon": true, "choices": ["Choice 1Which of the following graphs represents the function
\n${f(x)=e^{-x/{\\var{exp1}}}({\\var{p1}}x^3 -{\\var{p2}}x^2)}$
\nRoots (they are defined as the main variables. The ones above are calucated based on them. Find it easier to control the polynomial):
\n${\\var{b1}},{\\var{b2}}$
\nNotes:
\nRemember the product rule:
\n\\[\\frac{d}{dx}(uv)=u\\frac{dv}{dx}+v\\frac{du}{dx}=uv'+vu'\\]
\nDecide which function is $u$ and which function is $v$.
\nWrite it like this first:
\n\nu = _____________, v = _____________
\nAnd then calculate appropriate derivatives:
\n\nu' = _____________, v' = _____________
\nFinally, input your values in the formulae
", "variableReplacements": [], "customMarkingAlgorithm": ""}], "customName": "", "marks": 0, "displayColumns": 0, "type": "1_n_2", "showFeedbackIcon": true, "choices": ["Choice 1 - should be correct (no simplification)(In order to find minumum and/or maximum) Calculate the derivative of the function
\n${f(x)=e^{-x/{\\var{exp1}}}({\\var{p1}}x^3 -{\\var{p2}}x^2)}$
\nNote:
\n\n(In order to find minumum and/or maximum) Calculate the derivative of the function
\n${f(x)=e^{-x/{\\var{exp1}}}({\\var{p1}}x^3 -{\\var{p2}}x^2)}$
\n
$\\frac{df(x)}{dx} = $[[0]]
In order to find the stationary points you must solve the following equation
\n${\\frac{df(x)}{dx}=0}$
\n", "variableReplacements": [], "customMarkingAlgorithm": ""}], "customName": "", "marks": 0, "displayColumns": 0, "type": "1_n_2", "showFeedbackIcon": true, "choices": ["Choice 1 - correctWhat are the stationary points of $f(x)$?
\n", "unitTests": [], "variableReplacementStrategy": "originalfirst", "maxMarks": 0, "showCorrectAnswer": true, "showCellAnswerState": true, "useCustomName": false, "distractors": ["", "", "", ""], "shuffleChoices": false, "matrix": ["2", 0, 0, 0], "variableReplacements": []}, {"extendBaseMarkingAlgorithm": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "useCustomName": false, "customName": "", "sortAnswers": false, "type": "gapfill", "gaps": [{"extendBaseMarkingAlgorithm": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "showFractionHint": true, "marks": 1, "useCustomName": false, "notationStyles": ["plain", "en", "si-en"], "customName": "", "mustBeReduced": false, "type": "numberentry", "maxValue": "{x1}+0.2", "showFeedbackIcon": true, "minValue": "{x1}-0.2", "allowFractions": true, "correctAnswerFraction": false, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "variableReplacements": [], "customMarkingAlgorithm": ""}, {"extendBaseMarkingAlgorithm": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "showFractionHint": true, "marks": 1, "useCustomName": false, "notationStyles": ["plain", "en", "si-en"], "customName": "", "mustBeReduced": false, "type": "numberentry", "maxValue": "f_x1 + 0.2", "showFeedbackIcon": true, "minValue": "f_x1 - 0.2", "allowFractions": true, "correctAnswerFraction": false, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "variableReplacements": [], "customMarkingAlgorithm": ""}], "showFeedbackIcon": true, "prompt": "The function has a minimum point at: $x = $ [[0]] and the value of the function is : $f(x) = $ [[1]]
\nNote (correct answer): ${\\var{f_x1}}$ - to be deleted
", "variableReplacements": [], "customMarkingAlgorithm": ""}, {"extendBaseMarkingAlgorithm": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "useCustomName": false, "customName": "", "sortAnswers": false, "type": "gapfill", "gaps": [{"extendBaseMarkingAlgorithm": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "showFractionHint": true, "marks": 1, "useCustomName": false, "notationStyles": ["plain", "en", "si-en"], "customName": "", "mustBeReduced": false, "type": "numberentry", "maxValue": "x2 + 0.2", "showFeedbackIcon": true, "minValue": "x2 - 0.2", "allowFractions": true, "correctAnswerFraction": false, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "variableReplacements": [], "customMarkingAlgorithm": ""}, {"extendBaseMarkingAlgorithm": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "showFractionHint": false, "marks": 1, "useCustomName": false, "notationStyles": ["plain", "en", "si-en"], "customName": "", "mustBeReduced": false, "type": "numberentry", "maxValue": "f_x2 + 0.2", "showFeedbackIcon": true, "minValue": "f_x2 - 0.2", "allowFractions": true, "correctAnswerFraction": false, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "variableReplacements": [], "customMarkingAlgorithm": ""}], "showFeedbackIcon": true, "prompt": "The function has a local maximum point at: $x = $ [[0]] and the value of the function is $f(x)=$ [[1]]
\nIf the function $f(x)$ does not have a local maximum leave the gaps blank?
\nNote (correct answer): ${\\var{f_x2}}$ - to be deleted
", "variableReplacements": [], "customMarkingAlgorithm": ""}], "advice": "", "variable_groups": [{"name": "For polynomial", "variables": ["b1", "b2", "p1", "p2", "exp1", "p13", "p1_positive", "p2_positive", "s1", "s2", "p22", "x1", "x2", "f_x1", "f_x2", "fake_1", "fake_2", "fake_3", "fake_4", "fake_5", "fake_6"]}], "metadata": {"description": "Write down the Newton-Raphson formula for finding a numerical solution to the equation $e^{mx}+bx-a=0$. If $x_0=1$ find $x_1$.
\nIncluded in the Advice of this question are:
\n6 iterations of the method.
\nGraph of the NR process using jsxgraph. Also user interaction allowing change of starting value and its effect on the process.
", "licence": "Creative Commons Attribution 4.0 International"}, "variables": {"m": {"definition": "random(1.5..2#0.1)", "name": "m", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "p22": {"definition": "2*p2", "name": "p22", "group": "For polynomial", "templateType": "anything", "description": ""}, "maxy_poly": {"definition": "ceil({a1}^3)+5", "name": "maxy_poly", "group": "Ungrouped variables", "templateType": "anything", "description": "{\\var{a1}}x^3-{\\var{a2}}x^2+{\\var{a3}}x-{\\var{a4}}
"}, "as3": {"definition": "random(2..9 except as1)", "name": "as3", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "maxy": {"definition": "ceil(e^(2*m)+2*b-a)+5", "name": "maxy", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "ANSas3": {"definition": "as2+as3*as1", "name": "ANSas3", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "as1": {"definition": "random(2 .. 9#1)", "name": "as1", "group": "Ungrouped variables", "templateType": "randrange", "description": ""}, "p1_positive": {"definition": "-p1", "name": "p1_positive", "group": "For polynomial", "templateType": "anything", "description": ""}, "a3": {"definition": "random(11 .. 19#1)", "name": "a3", "group": "Ungrouped variables", "templateType": "randrange", "description": ""}, "p2": {"definition": "b1*b2", "name": "p2", "group": "For polynomial", "templateType": "anything", "description": ""}, "f_x1": {"definition": "e^(-{x1}/{exp1})({p1}*{x1}^3 -{p2}*{x1}^2)", "name": "f_x1", "group": "For polynomial", "templateType": "anything", "description": ""}, "f_min": {"definition": "e^(inv_tan_sol1/as1)(as2*sin(inv_tan_sol1)-as3*cos(inv_tan_sol1))", "name": "f_min", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "results": {"definition": "nr(m,b,a,2,10,[])", "name": "results", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "p2_positive": {"definition": "-p2", "name": "p2_positive", "group": "For polynomial", "templateType": "anything", "description": "p2
"}, "fake_2": {"definition": "((3*exp1*p1/2+p2)+sqrt((3*exp1*p1/2+p2)^2-4*2*p2*exp1*p1/2))/(p1)", "name": "fake_2", "group": "For polynomial", "templateType": "anything", "description": ""}, "ANSas2": {"definition": "-as3+as2*as1", "name": "ANSas2", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "b2": {"definition": "random(5..9)", "name": "b2", "group": "For polynomial", "templateType": "anything", "description": ""}, "tol": {"definition": "0", "name": "tol", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "as2": {"definition": "random(2..9 except as3)", "name": "as2", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "inv_tan_sol3": {"definition": "arctan(as3/as2)", "name": "inv_tan_sol3", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "p13": {"definition": "3*(p1)", "name": "p13", "group": "For polynomial", "templateType": "anything", "description": ""}, "exp1": {"definition": "random(7 .. 9#1)", "name": "exp1", "group": "For polynomial", "templateType": "randrange", "description": ""}, "inv_tan_sol2": {"definition": "inv_tan_sol1+3.14", "name": "inv_tan_sol2", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "b": {"definition": "random((a+1)..9)", "name": "b", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "x2": {"definition": "(s1+sqrt(s1^2-4*s2*p1))/(2*p1)", "name": "x2", "group": "For polynomial", "templateType": "anything", "description": ""}, "maxysincos": {"definition": "ceil({as2}*3)", "name": "maxysincos", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "a2": {"definition": "random(11 .. 19#1)", "name": "a2", "group": "Ungrouped variables", "templateType": "randrange", "description": ""}, "s1": {"definition": "3*exp1*p1+p2", "name": "s1", "group": "For polynomial", "templateType": "anything", "description": "simplified constant for the derivative
"}, "fake_5": {"definition": "((3*exp1*p1+p2/2)-sqrt((3*exp1*p1+p2/2)^2-4*2*p2/2*exp1*p1))/(2*p1)", "name": "fake_5", "group": "For polynomial", "templateType": "anything", "description": ""}, "f_max": {"definition": "e^(inv_tan_sol2/as1)(as2*sin(inv_tan_sol2)-as3*cos(inv_tan_sol2))", "name": "f_max", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "ans1": {"definition": "precround(results[6],4)", "name": "ans1", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "fake_3": {"definition": "((3*exp1*p1*2+p2)-sqrt((3*exp1*p1*2+p2)^2-4*2*p2*exp1*p1*2))/(4*p1)", "name": "fake_3", "group": "For polynomial", "templateType": "anything", "description": "fake_3
"}, "inv_tan_sol4": {"definition": "inv_tan_sol3-3.14", "name": "inv_tan_sol4", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "b1": {"definition": "random(0.1 .. 0.9#0.1)", "name": "b1", "group": "For polynomial", "templateType": "randrange", "description": ""}, "f_x2": {"definition": "e^(-{x2}/{exp1})({p1}*{x2}^3 -{p2}*{x2}^2)", "name": "f_x2", "group": "For polynomial", "templateType": "anything", "description": "e^{-x/{\\var{exp1}}}({\\var{p1}}x^3 -{\\var{p2}}x^2)
"}, "a1": {"definition": "random(2 .. 9#0.1)", "name": "a1", "group": "Ungrouped variables", "templateType": "randrange", "description": ""}, "fake_4": {"definition": "((3*exp1*p1*2+p2)+sqrt((3*exp1*p1*2+p2)^2-4*2*p2*exp1*p1*2))/(4*p1)", "name": "fake_4", "group": "For polynomial", "templateType": "anything", "description": ""}, "p1": {"definition": "b1", "name": "p1", "group": "For polynomial", "templateType": "anything", "description": "p1
"}, "inv_tan_sol1": {"definition": "arctan(-ANSas2/ANSas3)", "name": "inv_tan_sol1", "group": "Ungrouped variables", "templateType": "anything", "description": "Solution to stationary points
"}, "a": {"definition": "random(2..15)", "name": "a", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "x1": {"definition": "(s1-sqrt(s1^2-4*s2*p1))/(2*p1)", "name": "x1", "group": "For polynomial", "templateType": "anything", "description": ""}, "ans": {"definition": "precround(tans,4)", "name": "ans", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "minysincos": {"definition": "floor(-{as2})-5", "name": "minysincos", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "fake_1": {"definition": "((3*exp1*p1/2+p2)-sqrt((3*exp1*p1/2+p2)^2-4*2*p2*exp1*p1/2))/(p1)", "name": "fake_1", "group": "For polynomial", "templateType": "anything", "description": "fake_stationary point
"}, "tans": {"definition": "((2*m-1)*exp(2*m)+a)/(m*exp(2*m)+b)", "name": "tans", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "s2": {"definition": "p22*exp1", "name": "s2", "group": "For polynomial", "templateType": "anything", "description": "simplified constant for the derivative
"}, "a4": {"definition": "random(0.1 .. 0.9#0.1)", "name": "a4", "group": "Ungrouped variables", "templateType": "randrange", "description": ""}, "fake_6": {"definition": "((3*exp1*p1+p2/2)+sqrt((3*exp1*p1+p2/2)^2-4*2*p2/2*exp1*p1))/(2*p1)", "name": "fake_6", "group": "For polynomial", "templateType": "anything", "description": ""}}, "functions": {"fun": {"parameters": [["m", "number"], ["b", "number"], ["a", "number"], ["c", "number"]], "definition": "((m*c-1)*e^(m*c)+a)/(m*e^(m*c)+b)", "language": "jme", "type": "number"}, "poly1": {"parameters": [["p1", "number"], ["p2", "number"], ["exp1", "number"], ["f_x2", "number"], ["x2", "number"], ["f_x1", "number"]], "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('600px','400px', {boundingbox:[-2,f_x2+5,x2+5,f_x1-5], axis:false});\n var brd=div.board;\n // boundingbox xmin, ymax, xmax, ymin\n // Initial function term\n var poly = function(x){ return Math.exp(-x/exp1)*(p1*x*x*x-p2*x*x); };\n// it does not like when you write x^3\n \n var graph_poly = function(x) { return poly(x); };\n \n var i;\n var ax = brd.create('axis', [[0,0], [1,0]], {strokeColor: 'black'});\n var ay = brd.create('axis', [[0,0], [0,1]], {strokeColor: 'black'});\n \n var g = brd.create('functiongraph', [function(x){return graph_poly(x);}],{strokeWidth: 2, dash:0});\n \n \t\n return div;", "language": "javascript", "type": "html"}, "test": {"parameters": [["m", "number"], ["b", "number"], ["a", "number"], ["maxy", "number"]], "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('600px','400px', {boundingbox:[0,maxy,3,-30], axis:false});\n var brd=div.board;\n // Initial function term\n var term = function(x) { return Math.exp(m*x)+b*x-a; };\n var graph = function(x) { return term(x); };\n // Recursion depth\n var steps = 4;\n // Start value\n var s = 2;\n \n //for (i = 0; i < steps; i++) {\n //document.write('Consider the following function
\n${e^{-x/{\\var{exp1}}}({\\var{p1}}x^3 -{\\var{p2}}x^2)}$
\n${\\var{b1}},{\\var{b2}}$
\nThe constants should be fine now -
\nWe could change it to a quadratic or limit the range so they only have to calculate one min and one max - as at this point there are two local max (without 0 so they have to claculate it?) - easier for answers
\n\n", "type": "question", "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Anna Strzelecka", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2945/"}, {"name": "Mario Stevanovski", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2979/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Anna Strzelecka", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2945/"}, {"name": "Mario Stevanovski", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2979/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}