// Numbas version: finer_feedback_settings {"name": "Min_max_v1", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"": {"language": "jme", "type": "number", "parameters": [], "definition": ""}, "poly1": {"language": "javascript", "type": "html", "parameters": [["a1", "number"], ["a2", "number"], ["a3", "number"], ["a4", "number"], ["maxy_poly", "number"]], "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('600px','400px', {boundingbox:[-2,100,10,-10], axis:false});\n var brd=div.board;\n \n // Initial function term\n var poly = function(x){ return a1*x*x*x-a2*x*x+a3*x+a4; };\n //var poly = function(x){ return a1*Math.sin(x)*Math.exp(3*x)+a2*Math.cos(x)*Math.exp(3*x); };\n //var poly = function(x){ return a1*Math.exp(x)*a2*Math.log(2*x, 2.71); };\n //var poly = function(x){ return a1*x*x*x*Math.exp(x/3)-a2*x*x*Math.exp(x/3)+a3*x*Math.exp(x/3)+a4*Math.exp(x/3); };\n var graph_poly = function(x) { return poly(x); };\n \n // Start value\n var s = 2;\n \n \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;"}, "tan": {"language": "javascript", "type": "html", "parameters": [], "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('600px','400px', {boundingbox:[-3.5,5,3.5,-5], axis:false});\n var brd=div.board;\n\n// boundingbox\n\n // Initial function term\n //var poly = function(x){ return a1*x*x*x-a2*x*x+a3*x+a4; };\n var func = function(x){ return Math.tan(x); };\n //var poly = function(x){ return a1*Math.exp(x)*a2*Math.log(2*x, 2.71); };\n //var poly = function(x){ return a1*x*x*x*Math.exp(x/3)-a2*x*x*Math.exp(x/3)+a3*x*Math.exp(x/3)+a4*Math.exp(x/3); };\n var graph_func = function(x) { return func(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_func(x);}],{strokeWidth: 2, dash:0});\n \n \t\n return div;"}, "fun": {"language": "jme", "type": "number", "parameters": [["m", "number"], ["b", "number"], ["a", "number"], ["c", "number"]], "definition": "((m*c-1)*e^(m*c)+a)/(m*e^(m*c)+b)"}, "sincos": {"language": "javascript", "type": "html", "parameters": [["as1", "number"], ["as2", "number"], ["as3", "number"], ["minysincos", "number"], ["maxysincos", "number"]], "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('600px','400px', {boundingbox:[-3.5,maxysincos,3.5,minysincos], axis:false});\n var brd=div.board;\n\n// boundingbox\n\n // Initial function term\n //var poly = function(x){ return a1*x*x*x-a2*x*x+a3*x+a4; };\n var func = function(x){ return as2*Math.sin(x)*Math.exp(x/as1)-as3*Math.cos(x)*Math.exp(x/as1); };\n //var poly = function(x){ return a1*Math.exp(x)*a2*Math.log(2*x, 2.71); };\n //var poly = function(x){ return a1*x*x*x*Math.exp(x/3)-a2*x*x*Math.exp(x/3)+a3*x*Math.exp(x/3)+a4*Math.exp(x/3); };\n var graph_func = function(x) { return func(x); };\n \n // Start value\n var s = 2;\n \n \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_func(x);}],{strokeWidth: 2, dash:0});\n \n \t\n return div;"}, "nr": {"language": "jme", "type": "list", "parameters": [["m", "number"], ["b", "number"], ["a", "number"], ["c", "number"], ["n", "number"], ["l", "list"]], "definition": "if(n=5,l+[fun(m,b,a,c)]+[fun(m,b,a,fun(m,b,a,c))],nr(m,b,a,fun(m,b,a,c),n-1,l+[c]))"}, "test": {"language": "javascript", "type": "html", "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('
Test for ${e^{x/\\var{as1}}}({\\var{as2}}sin(x)-{\\var{as3}cos(x))}$
\nFind local extrema in the range $-\\pi \\le x \\le \\pi$
\nThink about constants as they are important for the stationary points (unless it is possible to put a condition (whether to add or substract pi - see below)
\nCheck whether the ymin and ymax work
\n\n", "parts": [{"marks": 0, "useCustomName": false, "choices": ["Choice 1Which of the following graphs represent the function
\n${e^{x/\\var{as1}}}({\\var{as2}}sin(x)-{\\var{as3}cos(x))}$
\nNotes:
\nGive an advice about calculating some points...
", "showCorrectAnswer": true, "adaptiveMarkingPenalty": 0, "customName": "", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true}], "displayColumns": 0, "scripts": {}, "distractors": ["", "", "", ""], "customName": "", "extendBaseMarkingAlgorithm": true}, {"marks": 0, "useCustomName": false, "maxMarks": 0, "showFeedbackIcon": true, "variableReplacements": [], "minMarks": 0, "choices": ["Choice 1(In order to find minumum and/or maximum) Calculate the derivative of the function
\n${f(x)=e^{x/\\var{as1}}}({\\var{as2}}sin(x)-{\\var{as3}cos(x))}$
\nNote:
\n(In order to find minumum and/or maximum) Calculate the derivative of the function
\n${f(x)=e^{x/\\var{as1}}}({\\var{as2}}sin(x)-{\\var{as3}cos(x))}$
\nSimplify your answer and present it in a form: (what form would be the best?)
\n${\\frac{df(x)}{dx}=\\frac{A}{B}e^{x/\\var{as1}}(Csin(x)+Dcos(x))}$, where A, B, C and D are any real constants
\n[[0]]
\n(there's something wrong with this gap number) - if does not compile - change the number to 0 or 1, compile again, maybe change agian
\n", "showCorrectAnswer": true, "adaptiveMarkingPenalty": 0, "customName": "", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true}, {"marks": 0, "useCustomName": false, "choices": ["Choice 1What are the stationary points of $f(x)$?
\n", "customMarkingAlgorithm": "", "unitTests": [], "shuffleChoices": false, "showCellAnswerState": true, "displayType": "radiogroup", "matrix": ["2", 0, 0], "type": "1_n_2", "variableReplacementStrategy": "originalfirst", "steps": [{"variableReplacements": [], "unitTests": [], "marks": 0, "useCustomName": false, "showFeedbackIcon": true, "type": "information", "variableReplacementStrategy": "originalfirst", "scripts": {}, "prompt": "In order to find the stationary points you must solve the following equation
\n${\\frac{df(x)}{dx}=0}$
\nOnce you solve this you might find the graph of $g(x) = tan(x)$ useful
\n{tan()}
", "showCorrectAnswer": true, "adaptiveMarkingPenalty": 0, "customName": "", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true}], "displayColumns": 0, "scripts": {}, "distractors": ["", "", ""], "customName": "", "extendBaseMarkingAlgorithm": true}, {"variableReplacements": [], "unitTests": [], "marks": 0, "useCustomName": false, "sortAnswers": false, "gaps": [{"marks": 1, "useCustomName": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "mustBeReduced": false, "unitTests": [], "showFractionHint": true, "correctAnswerStyle": "plain", "minValue": "inv_tan_sol1 - 0.2", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "scripts": {}, "maxValue": "inv_tan_sol1 + 0.2", "customName": "", "extendBaseMarkingAlgorithm": true}, {"marks": 1, "useCustomName": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "mustBeReduced": false, "unitTests": [], "showFractionHint": true, "correctAnswerStyle": "plain", "minValue": "f_min - 0.2", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "scripts": {}, "maxValue": "f_min + 0.2", "customName": "", "extendBaseMarkingAlgorithm": true}], "showFeedbackIcon": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "scripts": {}, "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_min}}$ - to be deleted
", "showCorrectAnswer": true, "adaptiveMarkingPenalty": 0, "customName": "", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true}, {"variableReplacements": [], "unitTests": [], "marks": 0, "useCustomName": false, "sortAnswers": false, "gaps": [{"marks": 1, "useCustomName": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "mustBeReduced": false, "unitTests": [], "showFractionHint": true, "correctAnswerStyle": "plain", "minValue": "inv_tan_sol2 - 0.2", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "scripts": {}, "maxValue": "inv_tan_sol2 + 0.2", "customName": "", "extendBaseMarkingAlgorithm": true}, {"marks": 1, "useCustomName": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "mustBeReduced": false, "unitTests": [], "showFractionHint": true, "correctAnswerStyle": "plain", "minValue": "f_max - 0.2", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "scripts": {}, "maxValue": "f_max + 0.2", "customName": "", "extendBaseMarkingAlgorithm": true}], "showFeedbackIcon": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "scripts": {}, "prompt": "The function has a maximum point at: $x = $ [[0]] and the value of the function is $f(x)=$ [[1]]
\nNote (correct answer): ${\\var{f_max}}$ - to be deleted
", "showCorrectAnswer": true, "adaptiveMarkingPenalty": 0, "customName": "", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true}], "metadata": {"description": "Calculate the local extrema of a function ${f(x) = e^{x/C1}(C2sin(x)-C3cos(x))}$
The graph of f(x) has to be identified.
The first derivative of f(x) has to be calculated.
The min max points have to be identified using the graph and/or calculated using the first derivative method. Requires solving trigonometric equation
", "licence": "Creative Commons Attribution 4.0 International"}, "name": "Min_max_v1", "rulesets": {"std": ["all", "!collectNumbers", "!noLeadingMinus"]}, "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"maxy_poly": {"definition": "ceil({a1}^3)+5", "templateType": "anything", "description": "{\\var{a1}}x^3-{\\var{a2}}x^2+{\\var{a3}}x-{\\var{a4}}
", "name": "maxy_poly", "group": "Ungrouped variables"}, "a4": {"definition": "random(0.1 .. 0.9#0.1)", "templateType": "randrange", "description": "", "name": "a4", "group": "Ungrouped variables"}, "ans1": {"definition": "precround(results[6],4)", "templateType": "anything", "description": "", "name": "ans1", "group": "Ungrouped variables"}, "a2": {"definition": "random(11 .. 19#1)", "templateType": "randrange", "description": "", "name": "a2", "group": "Ungrouped variables"}, "inv_tan_sol1": {"definition": "arctan(-ANSas2/ANSas3)", "templateType": "anything", "description": "Solution to stationary points
", "name": "inv_tan_sol1", "group": "Ungrouped variables"}, "inv_tan_sol2": {"definition": "inv_tan_sol1+3.14", "templateType": "anything", "description": "", "name": "inv_tan_sol2", "group": "Ungrouped variables"}, "minysincos": {"definition": "floor(-{as2})-5", "templateType": "anything", "description": "", "name": "minysincos", "group": "Ungrouped variables"}, "m": {"definition": "random(1.5..2#0.1)", "templateType": "anything", "description": "", "name": "m", "group": "Ungrouped variables"}, "ANSas3": {"definition": "as2+as3*as1", "templateType": "anything", "description": "", "name": "ANSas3", "group": "Ungrouped variables"}, "as2": {"definition": "random(2..9 except as3)", "templateType": "anything", "description": "", "name": "as2", "group": "Ungrouped variables"}, "a": {"definition": "random(2..15)", "templateType": "anything", "description": "", "name": "a", "group": "Ungrouped variables"}, "a3": {"definition": "random(11 .. 19#1)", "templateType": "randrange", "description": "", "name": "a3", "group": "Ungrouped variables"}, "results": {"definition": "nr(m,b,a,2,10,[])", "templateType": "anything", "description": "", "name": "results", "group": "Ungrouped variables"}, "a1": {"definition": "random(2 .. 9#0.1)", "templateType": "randrange", "description": "", "name": "a1", "group": "Ungrouped variables"}, "f_min": {"definition": "e^(inv_tan_sol1/as1)(as2*sin(inv_tan_sol1)-as3*cos(inv_tan_sol1))", "templateType": "anything", "description": "", "name": "f_min", "group": "Ungrouped variables"}, "as1": {"definition": "random(2 .. 9#1)", "templateType": "randrange", "description": "", "name": "as1", "group": "Ungrouped variables"}, "ANSas2": {"definition": "-as3+as2*as1", "templateType": "anything", "description": "", "name": "ANSas2", "group": "Ungrouped variables"}, "maxy": {"definition": "ceil(e^(2*m)+2*b-a)+5", "templateType": "anything", "description": "", "name": "maxy", "group": "Ungrouped variables"}, "f_max": {"definition": "e^(inv_tan_sol2/as1)(as2*sin(inv_tan_sol2)-as3*cos(inv_tan_sol2))", "templateType": "anything", "description": "", "name": "f_max", "group": "Ungrouped variables"}, "as3": {"definition": "random(2..9 except as1)", "templateType": "anything", "description": "", "name": "as3", "group": "Ungrouped variables"}, "tol": {"definition": "0", "templateType": "anything", "description": "", "name": "tol", "group": "Ungrouped variables"}, "ans": {"definition": "precround(tans,4)", "templateType": "anything", "description": "", "name": "ans", "group": "Ungrouped variables"}, "tans": {"definition": "((2*m-1)*exp(2*m)+a)/(m*exp(2*m)+b)", "templateType": "anything", "description": "", "name": "tans", "group": "Ungrouped variables"}, "b": {"definition": "random((a+1)..9)", "templateType": "anything", "description": "", "name": "b", "group": "Ungrouped variables"}, "maxysincos": {"definition": "ceil({as2}*3)", "templateType": "anything", "description": "", "name": "maxysincos", "group": "Ungrouped variables"}, "inv_tan_sol3": {"definition": "arctan(as3/as2)", "templateType": "anything", "description": "", "name": "inv_tan_sol3", "group": "Ungrouped variables"}, "inv_tan_sol4": {"definition": "inv_tan_sol3-3.14", "templateType": "anything", "description": "", "name": "inv_tan_sol4", "group": "Ungrouped variables"}}, "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/"}]}