// Numbas version: exam_results_page_options {"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...

\n

Alternatively, give them the graph of this function

", "variableReplacements": [], "customMarkingAlgorithm": ""}], "customName": "", "marks": 0, "displayColumns": 0, "type": "1_n_2", "showFeedbackIcon": true, "choices": ["Choice 1
{poly1(p1,p2,exp1,f_x2,x2,f_x1)}", "Choice 2
{poly1(p1/2,p2,exp1,f_x2/2,x2*2,f_x1*2.5)}", "Choice 3
{poly1(2*p1,p2,exp1,3*f_x2,x2,f_x1-5)}", "Choice 4
{poly1(p1,p2/2,exp1,2*f_x2,1.5*x2,f_x1-5)}"], "stepsPenalty": 0, "displayType": "radiogroup", "minMarks": 0, "prompt": "

Which of the following graphs represents the function

\n

${f(x)=e^{-x/{\\var{exp1}}}({\\var{p1}}x^3 -{\\var{p2}}x^2)}$

\n

Roots (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}}$

\n

Notes:

\n
    \n
  1. Make sure min/max is ok with current definitions
  2. \n
  3. Add some hints
  4. \n
\n

", "unitTests": [], "variableReplacementStrategy": "originalfirst", "maxMarks": 0, "showCorrectAnswer": true, "showCellAnswerState": true, "useCustomName": false, "distractors": ["", "", "", ""], "shuffleChoices": false, "matrix": ["2", 0, 0, 0], "variableReplacements": []}, {"extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {}, "steps": [{"extendBaseMarkingAlgorithm": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "useCustomName": false, "customName": "", "type": "information", "showFeedbackIcon": true, "prompt": "

Remember the product rule:

\n

\\[\\frac{d}{dx}(uv)=u\\frac{dv}{dx}+v\\frac{du}{dx}=uv'+vu'\\]

\n

Decide which function is $u$ and which function is $v$.

\n

Write it like this first:

\n

\n

 u = _____________, v = _____________

\n

And then calculate appropriate derivatives:

\n

\n

 u' = _____________, v' = _____________

\n

Finally, 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)
${\\frac{df(x)}{dx}=-\\frac{1}{{\\var{exp1}}}e^{-x/{\\var{exp1}}}(\\var{p1}x^3 -{\\var{p2}}x^2)+e^{-x/{\\var{exp1}}}(\\var{p13}x^2- {\\var{p22}}x)}$", "Choice 2 - incorrect
${\\frac{df(x)}{dx}=-\\frac{1}{{\\var{exp1}}}e^{-x/{\\var{exp1}}}(\\var{p13}x^2- {\\var{p22}}x)}$", "Choice 3 - the simplified version here which could (should) also be correct - tricky with constants signs - solved?
${\\frac{df(x)}{dx}=-\\frac{1}{{\\var{exp1}}}e^{-x/{\\var{exp1}}}({\\var{p1}}x^3 -{\\var{s1}}x^2+ {\\var{s2}}x)}$", "Choice 4
Another incorrect choice"], "stepsPenalty": 0, "displayType": "radiogroup", "minMarks": 0, "prompt": "

(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

Note:

\n

\n
    \n
  1. Prompt - you must use the product rule
  2. \n
  3. Use the table?
  4. \n
  5. This could be as a choice question or gapfill (the other below)
  6. \n
  7. I don't understand how choices work...
  8. \n
", "unitTests": [], "variableReplacementStrategy": "originalfirst", "maxMarks": 0, "showCorrectAnswer": true, "showCellAnswerState": true, "useCustomName": false, "distractors": ["", "", "", ""], "shuffleChoices": false, "matrix": [0, "1", "1", 0], "variableReplacements": []}, {"extendBaseMarkingAlgorithm": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "useCustomName": false, "customName": "", "sortAnswers": false, "type": "gapfill", "gaps": [{"extendBaseMarkingAlgorithm": true, "vsetRange": [0, 1], "answerSimplification": "all", "customMarkingAlgorithm": "", "scripts": {}, "checkingType": "absdiff", "customName": "", "marks": 1, "type": "jme", "showFeedbackIcon": true, "answer": "-1/{exp1}e^(-x/{exp1})({p1}x^3 -{s1}*x^2+ {s2}*x)", "showPreview": false, "unitTests": [], "variableReplacementStrategy": "originalfirst", "vsetRangePoints": 5, "showCorrectAnswer": false, "useCustomName": false, "failureRate": 1, "valuegenerators": [{"value": "", "name": "x"}], "checkingAccuracy": 0.001, "checkVariableNames": false, "variableReplacements": []}], "showFeedbackIcon": true, "prompt": "

(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]]

\n

\n

", "variableReplacements": [], "customMarkingAlgorithm": ""}, {"extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {}, "steps": [{"extendBaseMarkingAlgorithm": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "useCustomName": false, "customName": "", "type": "information", "showFeedbackIcon": true, "prompt": "

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 - correct
There are three stationary points:
${x_1=0 ,x_2=\\var{x1}, x_3=\\var{x2}}$
Note: how can we limit this to 3-4 sf?", "Choice 2 - incorrect connected to choice 2 graph
There are three stationary points:
${x_1=0 ,x_2=\\var{fake_1}, x_3=\\var{fake_2}}$
Note: how can we limit this to 3-4 sf?", "Choice 3 - incorrect connected to choice 3 graph
There are three stationary points:
${x_1=0 ,x_2=\\var{fake_3}, x_3=\\var{fake_4}}$
Note: how can we limit this to 3-4 sf?", "Choice 4 incorrect connected to choice 4 graph
There are three stationary points:
${x_1=0 ,x_2=\\var{fake_5}, x_3=\\var{fake_6}}$
Note: how can we limit this to 3-4 sf?"], "stepsPenalty": 0, "displayType": "radiogroup", "minMarks": 0, "prompt": "

What 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]]

\n

Note (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]]

\n

If the function $f(x)$ does not have a local maximum leave the gaps blank?

\n

Note (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$.

\n

Included in the Advice of this question are:

\n

6 iterations of the method.

\n

Graph 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('x' + i + ' = ');\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(x);}],{strokeWidth: 2, dash:0});\n // var x = brd.create('glider',[s,0,ax], {name: 'x_{0}', strokeColor: 'magenta', fillColor: 'yellow'});\n \n // newton(x, steps, brd);\t\n \n //function xval() {\n //for (i = 0; i < steps; i++)\n //document.getElementById('xv' + i).innerHTML = (brd.select('x_{' + i + '}').X()).toFixed(14);\n //}\n \n //brd.addHook(xval);\n \n function newton(p, i, board) {\t\n board.suspendUpdate();\t\n if(i>0) {\n var f = board.create('glider',[function(){return p.X();}, function(){return graph(p.X())},g], {name: '', style: 3, strokeColor: 'green', fillColor: 'yellow'});\n var l = board.create('line', [p,f],{strokeWidth: 0.5, dash: 1, straightFirst: false, straightLast: false, strokeColor: 'black'});\n // var t = board.create('tangent',[f],{strokeWidth: 0.5, strokeColor: '#0080c0', dash: 0});\n //var x = board.create('intersection',[ax,t,0],{name: 'x_{'+(steps-i+1) + '}', style: 4, strokeColor: 'magenta', fillColor: 'yellow'});\n // newton(x,--i, board);\n }\n board.unsuspendUpdate(); \n \n \n }\t\n return div;", "language": "javascript", "type": "html"}, "tan": {"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;", "language": "javascript", "type": "html"}, "sincos": {"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 xmin, ymax, xmax, ymin\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;", "language": "javascript", "type": "html"}, "nr": {"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]))", "language": "jme", "type": "list"}, "funfornr": {"parameters": [], "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('600px','200px',{boundingBox:[0,10,1,-8],grid:false});\n var board = div.board;\n var m = Numbas.jme.unwrapValue(scope.variables.m);\n var be = Numbas.jme.unwrapValue(scope.variables.b);\n var al = Numbas.jme.unwrapValue(scope.variables.a);\n var ans = Numbas.jme.unwrapValue(scope.variables.ans1)\n var a = board.create('point',[ans,0],'$A$');\n \n var graph = board.create('functiongraph',function(x){return Math.exp(m*x)+be*x-al});\n \n return div;\n ", "language": "javascript", "type": "html"}}, "preamble": {"js": "", "css": ""}, "rulesets": {"std": ["all", "!collectNumbers", "!noLeadingMinus"]}, "variablesTest": {"condition": "", "maxRuns": 100}, "name": "Min_max_v2", "tags": [], "extensions": ["jsxgraph"], "ungrouped_variables": ["a", "maxy", "ans1", "m", "results", "b", "tol", "ans", "tans", "a1", "a2", "a3", "a4", "maxy_poly", "maxysincos", "as1", "as2", "as3", "minysincos", "ANSas2", "ANSas3", "inv_tan_sol1", "inv_tan_sol2", "inv_tan_sol3", "inv_tan_sol4", "f_min", "f_max"], "statement": "

Consider the following function

\n

${e^{-x/{\\var{exp1}}}({\\var{p1}}x^3 -{\\var{p2}}x^2)}$

\n

${\\var{b1}},{\\var{b2}}$

\n

The constants should be fine now - 

\n

We 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

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