// Numbas version: exam_results_page_options {"name": "Euler's method", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Euler's method", "statement": "

Use Euler's method wjth a step size of \\(h=\\var{h}\\) to obtain a numerical solution for \\(y(\\simplify{{x0}+5*{h}})\\) where:

\n

\\(\\frac{dy}{dx}=\\frac{\\var{a}x^2+\\var{b}}{\\var{c}y^2+\\var{d}}\\)   given that \\(y(\\var{x0})=\\var{y0}\\)

", "preamble": {"css": "", "js": ""}, "rulesets": {}, "extensions": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "tags": [], "advice": "

\n

The formua for Euler's method is given by:    \\(y_{n+1}=y_n+h*(\\frac{dy}{dx})\\) where \\(h\\) is the step-size for the \\(x-\\)variable.

\n

\\(y_{n+1}=y_n+\\var{h}\\left(\\frac{\\var{a}x_n^2+\\var{b}}{\\var{c}y_n^2+\\var{d}}\\right)\\) 

\n

\\(x_0=\\var{x0}\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,y_0=\\var{y0}\\)

\n

\\(y_{1}=\\var{y0}+\\var{h}\\left(\\frac{\\simplify{{a}*{x0}^2+{b}}}{\\simplify{{c}*{y0}^2+{d}}}\\right)=\\var{y1}\\) 

\n

\\(x_1=\\var{x1}\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,y_1=\\var{y1}\\)

\n

\\(y_{2}=\\var{y1}+\\var{h}\\left(\\frac{\\simplify{{a}*{x1}^2+{b}}}{\\simplify{{c}*{y1}^2+{d}}}\\right)=\\var{y2}\\) 

\n

\\(x_2=\\var{x2}\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,y_2=\\var{y2}\\)

\n

\\(y_{3}=\\var{y2}+\\var{h}\\left(\\frac{\\simplify{{a}*{x2}^2+{b}}}{\\simplify{{c}*{y2}^2+{d}}}\\right)=\\var{y3}\\) 

\n

\\(x_3=\\var{x3}\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,y_3=\\var{y3}\\)

\n

\\(y_{4}=\\var{y3}+\\var{h}\\left(\\frac{\\simplify{{a}*{x3}^2+{b}}}{\\simplify{{c}*{y3}^2+{d}}}\\right)=\\var{y4}\\) 

\n

\\(x_4=\\var{x4}\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,y_4=\\var{y4}\\)

\n

\\(y_{5}=\\var{y4}+\\var{h}\\left(\\frac{\\simplify{{a}*{x4}^2+{b}}}{\\simplify{{c}*{y4}^2+{d}}}\\right)=\\var{y5}\\) 

\n

\\(x_5=\\var{x5}\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,y_5=\\var{y5}\\)

", "variable_groups": [], "variables": {"c": {"name": "c", "definition": "random(2..6#1)", "description": "", "templateType": "randrange", "group": "Ungrouped variables"}, "y0": {"name": "y0", "definition": "random(0..1.8#0.2)", "description": "", "templateType": "randrange", "group": "Ungrouped variables"}, "x5": {"name": "x5", "definition": "x4+h", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "y5": {"name": "y5", "definition": "y4+h*(a*x4^2+b)/(c*y4^2+d)", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "x0": {"name": "x0", "definition": "random(2..6#1)", "description": "", "templateType": "randrange", "group": "Ungrouped variables"}, "y1": {"name": "y1", "definition": "y0+h*(a*x0^2+b)/(c*y0^2+d)", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "x4": {"name": "x4", "definition": "x3+h", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "x2": {"name": "x2", "definition": "x1+h", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "y4": {"name": "y4", "definition": "y3+h*(a*x3^2+b)/(c*y3^2+d)", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "h": {"name": "h", "definition": "random(0.1..0.5#0.1)", "description": "", "templateType": "randrange", "group": "Ungrouped variables"}, "y2": {"name": "y2", "definition": "y1+h*(a*x1^2+b)/(c*y1^2+d)", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "b": {"name": "b", "definition": "random(7..12#1)", "description": "", "templateType": "randrange", "group": "Ungrouped variables"}, "d": {"name": "d", "definition": "random(8..14#1)", "description": "", "templateType": "randrange", "group": "Ungrouped variables"}, "a": {"name": "a", "definition": "random(2..5#1)", "description": "", "templateType": "randrange", "group": "Ungrouped variables"}, "x3": {"name": "x3", "definition": "x2+h", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "y3": {"name": "y3", "definition": "y2+h*(a*x2^2+b)/(c*y2^2+d)", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "x1": {"name": "x1", "definition": "x0+h", "description": "", "templateType": "anything", "group": "Ungrouped variables"}}, "variablesTest": {"maxRuns": 100, "condition": ""}, "functions": {}, "ungrouped_variables": ["x0", "h", "a", "b", "c", "d", "y0", "x1", "x2", "x3", "x4", "x5", "y1", "y2", "y3", "y4", "y5"], "parts": [{"showFeedbackIcon": true, "marks": 0, "type": "gapfill", "variableReplacements": [], "scripts": {}, "gaps": [{"allowFractions": false, "precision": "2", "showPrecisionHint": true, "marks": "0.5", "precisionPartialCredit": 0, "variableReplacements": [], "mustBeReduced": false, "precisionType": "dp", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFeedbackIcon": true, "minValue": "y1", "strictPrecision": false, "correctAnswerStyle": "plain", "type": "numberentry", "maxValue": "y1", "precisionMessage": "You have not given your answer to the correct precision.", "scripts": {}, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst"}, {"allowFractions": false, "precision": "1", "showPrecisionHint": false, "marks": "0.2", "precisionPartialCredit": 0, "variableReplacements": [], "mustBeReduced": false, "precisionType": "dp", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFeedbackIcon": true, "minValue": "x1", "strictPrecision": false, "correctAnswerStyle": "plain", "type": "numberentry", "maxValue": "x1", "precisionMessage": "You have not given your answer to the correct precision.", "scripts": {}, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst"}, {"allowFractions": false, "precision": "1", "showPrecisionHint": false, "marks": "0.2", "precisionPartialCredit": 0, "variableReplacements": [], "mustBeReduced": false, "precisionType": "dp", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFeedbackIcon": true, "minValue": "x2", "strictPrecision": false, "correctAnswerStyle": "plain", "type": "numberentry", "maxValue": "x2", "precisionMessage": "You have not given your answer to the correct precision.", "scripts": {}, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst"}, {"allowFractions": false, "precision": "2", "showPrecisionHint": true, "marks": "0.5", "precisionPartialCredit": 0, "variableReplacements": [], "mustBeReduced": false, "precisionType": "dp", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFeedbackIcon": true, "minValue": "y2", "strictPrecision": false, "correctAnswerStyle": "plain", "type": "numberentry", "maxValue": "y2", "precisionMessage": "You have not given your answer to the correct precision.", "scripts": {}, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst"}, {"allowFractions": false, "precision": "1", "showPrecisionHint": false, "marks": "0.2", "precisionPartialCredit": 0, "variableReplacements": [], "mustBeReduced": false, "precisionType": "dp", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFeedbackIcon": true, "minValue": "x3", "strictPrecision": false, "correctAnswerStyle": "plain", "type": "numberentry", "maxValue": "x3", "precisionMessage": "You have not given your answer to the correct precision.", "scripts": {}, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst"}, {"allowFractions": false, "precision": "2", "showPrecisionHint": true, "marks": "0.5", "precisionPartialCredit": 0, "variableReplacements": [], "mustBeReduced": false, "precisionType": "dp", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFeedbackIcon": true, "minValue": "y3", "strictPrecision": false, "correctAnswerStyle": "plain", "type": "numberentry", "maxValue": "y3", "precisionMessage": "You have not given your answer to the correct precision.", "scripts": {}, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst"}, {"allowFractions": false, "precision": "1", "showPrecisionHint": false, "marks": "0.2", "precisionPartialCredit": 0, "variableReplacements": [], "mustBeReduced": false, "precisionType": "dp", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFeedbackIcon": true, "minValue": "x4", "strictPrecision": false, "correctAnswerStyle": "plain", "type": "numberentry", "maxValue": "x4", "precisionMessage": "You have not given your answer to the correct precision.", "scripts": {}, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst"}, {"allowFractions": false, "precision": "2", "showPrecisionHint": true, "marks": "0.5", "precisionPartialCredit": 0, "variableReplacements": [], "mustBeReduced": false, "precisionType": "dp", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFeedbackIcon": true, "minValue": "y4", "strictPrecision": false, "correctAnswerStyle": "plain", "type": "numberentry", "maxValue": "y4", "precisionMessage": "You have not given your answer to the correct precision.", "scripts": {}, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst"}, {"allowFractions": false, "precision": "1", "showPrecisionHint": false, "marks": "0.2", "precisionPartialCredit": 0, "variableReplacements": [], "mustBeReduced": false, "precisionType": "dp", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFeedbackIcon": true, "minValue": "x5", "strictPrecision": false, "correctAnswerStyle": "plain", "type": "numberentry", "maxValue": "x5", "precisionMessage": "You have not given your answer to the correct precision.", "scripts": {}, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst"}, {"allowFractions": false, "precision": "2", "showPrecisionHint": true, "marks": "0.5", "precisionPartialCredit": 0, "variableReplacements": [], "mustBeReduced": false, "precisionType": "dp", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFeedbackIcon": true, "minValue": "y5", "strictPrecision": false, "correctAnswerStyle": "plain", "type": "numberentry", "maxValue": "y5", "precisionMessage": "You have not given your answer to the correct precision.", "scripts": {}, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst"}], "showCorrectAnswer": true, "prompt": "

\\(x_0=\\var{x0}\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,y_0=\\var{y0}\\)

\n

\\(x_1=\\) [[1]]      \\(y_1=\\) [[0]]

\n

\\(x_2=\\) [[2]]      \\(y_2=\\) [[3]]

\n

\\(x_3=\\) [[4]]      \\(y_3=\\) [[5]]

\n

\\(x_4=\\) [[6]]      \\(y_4=\\) [[7]]

\n

\\(x_5=\\) [[8]]      \\(y_5=\\) [[9]]

\n

 

", "variableReplacementStrategy": "originalfirst"}], "type": "question", "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}]}], "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}