// Numbas version: exam_results_page_options {"name": "Fourier Series square wave function.", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"maxRuns": 100, "condition": ""}, "functions": {}, "advice": "
\\(f(t)=\\left[\\begin{array}{cc}\\,\\,0 &\\,\\,-\\pi<t<0\\\\\\,\\,\\var{a}&\\,\\,\\,\\,\\pi/2<t<\\pi/2\\\\\\,\\,0&\\,\\,\\,\\,\\pi/2<t<\\pi\\end{array}\\right] \\)
\n\\(a_0=\\frac{1}{\\pi}\\int_{\\frac{-\\pi}{2}}^{\\frac{\\pi}{2}}3dx\\) the average value of the wave over one complete cycle
\nAs the function is even
\n\\(b_n=0\\)
\n\\(a_n=\\frac{1}{\\pi}\\int_{-\\pi}^{\\pi} f(t)\\cos\\left(nx\\right)dx\\)
\n\\(a_n=\\frac{1}{\\pi}\\left(\\int_{-\\pi}^{-\\frac{\\pi}{2}}0\\sin\\left({n}x\\right)dx+\\int_{\\frac{-\\pi}{2}}^{\\frac{\\pi}{2}}\\var{a}\\sin\\left({n}x\\right)dx+\\int_{\\frac{\\pi}{2}}^{\\pi}0\\sin\\left({n}x\\right)dx\\right)\\)
\n\\(a_n=\\frac{1}{\\pi}\\left(\\frac{\\var{2} *\\var{a} (\\sin (\\frac{\\pi}{2} n)) }{n}\\right)\\)
\n\nIf \\(n\\) is an even number \\(sin(n\\frac{\\pi}{2})=0\\)
\n\\(b_n=0\\)
\nIf \\(n=1, 5, 9, ...\\) is then \\(sin(n\\frac{\\pi}{2})=1\\)
\n\\(b_n=\\frac{1}{\\pi}\\left(\\frac{\\var{2} *\\var{a} }{n}\\right)\\)
\nIf \\(n=3, 7, 11, ...\\) is an even number \\(sin(n\\frac{\\pi}{2})=-1\\)
\n\\(b_n=-\\frac{1}{\\pi}\\left(\\frac{\\var{2} *\\var{a} }{n}\\right)\\)
", "name": "Fourier Series square wave function.", "ungrouped_variables": ["a", "k"], "extensions": [], "rulesets": {}, "variables": {"k": {"group": "Ungrouped variables", "definition": "random(2..7#2)", "templateType": "randrange", "name": "k", "description": ""}, "a": {"group": "Ungrouped variables", "definition": "random(1..6#1)", "templateType": "randrange", "name": "a", "description": ""}}, "statement": "Given the function:
\n\\(f(t)=\\left[\\begin{array}{cc}\\,\\,0 &\\,\\,-\\pi<t<0\\\\\\,\\,\\var{a}&\\,\\,\\,\\,\\pi/2<t<\\pi/2\\\\\\,\\,0&\\,\\,\\,\\,\\pi/2<t<\\pi\\end{array}\\right] \\)
\n", "preamble": {"css": "", "js": ""}, "tags": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Calculating particular harmonic components of a Fourier series expansion.
"}, "variable_groups": [], "parts": [{"prompt": "Calculate the value for the trigonometric Fourier coefficient \\(b_{k}\\).
\n\\(b_{k}\\) = [[0]]
", "variableReplacementStrategy": "originalfirst", "type": "gapfill", "scripts": {}, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showCorrectAnswer": false, "extendBaseMarkingAlgorithm": true, "marks": 0, "gaps": [{"mustBeReducedPC": 0, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "scripts": {}, "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "customMarkingAlgorithm": "", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "maxValue": "0", "marks": "2", "unitTests": [], "allowFractions": false, "mustBeReduced": false, "correctAnswerStyle": "plain", "variableReplacements": [], "minValue": "0"}], "unitTests": [], "sortAnswers": false, "variableReplacements": []}, {"vsetRange": [0, 1], "prompt": "Determine an expression for the trigonometric Fourier coefficient \\(a_{0}\\), and hence evaluate \\(a_{0}\\).
\n\\(a_{0}\\) =
", "showPreview": true, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "type": "jme", "scripts": {}, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "marks": "2", "unitTests": [], "failureRate": 1, "expectedVariableNames": [], "checkVariableNames": false, "variableReplacements": [], "answer": "{a}"}, {"vsetRange": [0, 1], "prompt": "Determine an expression for the trigonometric Fourier coefficient \\(a_{1}\\), and hence evaluate \\(a_{1}\\).
\n\\(a_{1}\\) =
", "showPreview": true, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "type": "jme", "scripts": {}, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "marks": "2", "unitTests": [], "failureRate": 1, "expectedVariableNames": [], "checkVariableNames": false, "variableReplacements": [], "answer": "2*{a}/pi"}, {"vsetRange": [0, 1], "prompt": "Determine an expression for the trigonometric Fourier coefficient \\(a_{n}\\), and hence evaluate \\(a_{n}\\), for n=1,5,....
\n\\(a_{n}\\) =
", "showPreview": true, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "type": "jme", "scripts": {}, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "marks": "2", "unitTests": [], "failureRate": 1, "expectedVariableNames": [], "checkVariableNames": false, "variableReplacements": [], "answer": "2*{a}/(n pi)"}, {"vsetRange": [0, 1], "prompt": "Determine an expression for the trigonometric Fourier coefficient \\(a_{n}\\), and hence evaluate \\(a_{n}\\), for n=3,7,....
\n\\(a_{n}\\) =
", "showPreview": true, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "type": "jme", "scripts": {}, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "marks": "2", "unitTests": [], "failureRate": 1, "expectedVariableNames": [], "checkVariableNames": false, "variableReplacements": [], "answer": "-2*{a}/(n pi)"}, {"prompt": "Determine an expression for the trigonometric Fourier coefficient \\(a_{n}\\), and hence evaluate \\(a_{n}\\), for n=2,4,....
\n\\(a_{n}\\) =
\n[[0]]
", "variableReplacementStrategy": "originalfirst", "type": "gapfill", "scripts": {}, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "marks": 0, "gaps": [{"vsetRange": [0, 1], "showPreview": true, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "type": "jme", "scripts": {}, "showFeedbackIcon": true, "marks": "2", "customMarkingAlgorithm": "", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "answer": "0", "unitTests": [], "failureRate": 1, "expectedVariableNames": [], "checkVariableNames": false, "variableReplacements": []}], "unitTests": [], "sortAnswers": false, "variableReplacements": []}, {"minMarks": 0, "prompt": "Is the function even or odd?
", "choices": ["Even", "Odd", "Neither even or odd"], "variableReplacementStrategy": "originalfirst", "type": "1_n_2", "scripts": {}, "distractors": ["", "", ""], "showFeedbackIcon": true, "showCellAnswerState": true, "matrix": ["2", "0", 0], "customMarkingAlgorithm": "", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "displayColumns": 0, "shuffleChoices": false, "marks": 0, "unitTests": [], "maxMarks": 0, "displayType": "radiogroup", "variableReplacements": []}], "type": "question", "contributors": [{"name": "John Butler", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/555/"}, {"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}]}], "contributors": [{"name": "John Butler", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/555/"}, {"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}