// Numbas version: exam_results_page_options {"name": "Harmonic component of the complex form of a Fourier series", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Harmonic component of the complex form of a Fourier series", "statement": "

Given the function:

\n

  \\(f(t)=\\left[ \\begin{array}{cc}\\,\\,\\var{a}&\\,\\,-\\var{L}<t<-\\simplify{{L}/2}\\\\\\,\\,\\var{b}&\\,\\,-\\simplify{{L}/2}<t<\\simplify{{L}/2}\\\\\\,\\,\\var{c}&\\,\\,\\simplify{{L}/2}<t<\\var{L}\\end{array}\\right] \\,\\,\\,\\,f(t+\\simplify{2*{L}})=f(t)\\)

", "variable_groups": [], "variables": {"k": {"definition": "random(5..19#2)", "name": "k", "templateType": "randrange", "group": "Ungrouped variables", "description": ""}, "L": {"definition": "random(2..12#2)", "name": "L", "templateType": "randrange", "group": "Ungrouped variables", "description": ""}, "b": {"definition": "random(9..18#1)", "name": "b", "templateType": "randrange", "group": "Ungrouped variables", "description": ""}, "c": {"definition": "random(2..10#1)", "name": "c", "templateType": "randrange", "group": "Ungrouped variables", "description": ""}, "a": {"definition": "random(2..6#1)", "name": "a", "templateType": "randrange", "group": "Ungrouped variables", "description": ""}}, "rulesets": {}, "extensions": [], "functions": {}, "parts": [{"variableReplacements": [], "showCorrectAnswer": true, "customMarkingAlgorithm": "", "unitTests": [], "type": "gapfill", "sortAnswers": false, "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "prompt": "

Determine an expression for the complex exponential Fourier coefficients \\( c_{k}\\) and hence calculate the value for the amplitude of the \\(\\var{k}\\)th harmonic component.

\n

Amplitude = [[0]]

", "gaps": [{"unitTests": [], "strictPrecision": false, "precision": "3", "showCorrectAnswer": true, "allowFractions": false, "customMarkingAlgorithm": "", "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "showFeedbackIcon": true, "correctAnswerStyle": "plain", "extendBaseMarkingAlgorithm": true, "maxValue": "sqrt(((2*{b}-{a}-{c})*sin({k}*pi/2))^2+(({c}-{a})cos({k}*pi)+({a}-{c})cos({k}*pi/2))^2)/({k}*pi)", "variableReplacementStrategy": "originalfirst", "showPrecisionHint": true, "variableReplacements": [], "mustBeReduced": false, "mustBeReducedPC": 0, "minValue": "sqrt(((2*{b}-{a}-{c})*sin({k}*pi/2))^2+(({c}-{a})cos({k}*pi)+({a}-{c})cos({k}*pi/2))^2)/({k}*pi)", "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "marks": "3", "precisionPartialCredit": 0, "correctAnswerFraction": false, "precisionType": "dp"}], "variableReplacementStrategy": "originalfirst", "marks": 0}], "preamble": {"css": "", "js": ""}, "tags": [], "metadata": {"description": "

Calculate a particular harmonic component of the complex form of a Fourier series expansion.

", "licence": "Creative Commons Attribution 4.0 International"}, "ungrouped_variables": ["a", "b", "c", "L", "k"], "variablesTest": {"maxRuns": "118", "condition": ""}, "advice": "

\\(f(t)=\\left[ \\begin{array}{cc}\\,\\,\\var{a}&\\,\\,-\\var{L}<t<-\\simplify{{L}/2}\\\\\\,\\,\\var{b}&\\,\\,-\\simplify{{L}/2}<t<\\simplify{{L}/2}\\\\\\,\\,\\var{c}&\\,\\,\\simplify{{L}/2}<t<\\var{L}\\end{array}\\right] \\,\\,\\,\\,f(t+\\simplify{2*{L}})=f(t)\\)

\n

\\(c_{k}=\\frac{1}{2L}\\int_{-L}^{-L}f(t)e^{-\\frac{jk\\pi}{L}t}\\)

\n

In this example \\(2L=\\simplify{2*{L}}\\)

\n

\\(c_{k}=\\frac{1}{\\simplify{2*{L}}}\\left(\\int_{-\\var{L}}^{\\simplify{-{L}/2}}\\var{a}e^{-\\frac{j{k}\\pi}{\\var{L}}t}+\\int_{-{\\simplify{{L}/2}}}^{\\simplify{{L}/2}}\\var{b}e^{-\\frac{j{k}\\pi}{\\var{L}}t}dt+\\int_{\\simplify{{L}/2}}^{\\var{L}}\\var{c}e^{-\\frac{j{k}\\pi}{\\var{L}}t}\\right)\\)

\n

\\(c_{k}=\\frac{1}{\\simplify{2*{L}}}\\left(-\\frac{\\var{a}*\\var{L}}{j{k}\\pi}e^{-\\frac{j{k}\\pi}{\\var{L}}t}|_{-\\var{L}}^{-\\simplify{{L}/2}}-\\frac{\\var{b}*\\var{L}}{j{k}\\pi}e^{-\\frac{{k}\\pi}{\\var{L}}t}|_{-\\simplify{{L}/2}}^{\\simplify{{L}/2}}-\\frac{\\var{c}*\\var{L}}{j{k}\\pi}e^{-\\frac{j{k}\\pi}{\\var{L}}t}|_{\\simplify{{L}/2}}^{\\var{L}}\\right)\\)

\n

\\(c_{k}=-\\frac{1}{2{k}\\pi j}\\left(\\var{a}e^{-\\frac{j{k}\\pi}{\\var{L}}t}|_{-\\var{L}}^{-\\simplify{{L}/2}}+\\var{b}e^{-\\frac{j{k}\\pi}{\\var{L}}t}|_{-\\simplify{{L}/2}}^{\\simplify{{L}/2}}+\\var{c}e^{-\\frac{j{k}\\pi}{\\var{L}}t}|_{\\simplify{{L}/2}}^{\\var{L}}\\right)\\)

\n

\\(c_{k}=\\frac{j}{2{k}\\pi}\\left(\\var{a}e^{\\frac{j{k}\\pi}{{2}}}-\\var{a}e^{j{k}\\pi}+\\var{b}e^{-\\frac{j{k}\\pi}{2}}-\\var{b}e^{\\frac{j{k}\\pi}{2}}+\\var{c}e^{-j{k}\\pi}-\\var{c}e^{-\\frac{j{k}\\pi}{2}}\\right)\\)

\n

\\(c_{k}=\\frac{j}{2{k}\\pi}\\left(\\simplify{{a}-{b}}e^{\\frac{j{k}\\pi}{{2}}}-\\var{a}e^{j{k}\\pi}+\\simplify{{b}-{c}}e^{-\\frac{j{k}\\pi}{2}}+\\var{c}e^{-j{k}\\pi}\\right)\\)

\n

Recall \\(e^{j\\theta}=cos(\\theta)+jsin(\\theta)\\)    and     \\(e^{-j\\theta}=cos(\\theta)-jsin(\\theta)\\)

\n

\\(c_{k}=\\frac{j}{2{k}\\pi}\\left(\\simplify{{a}-{b}}cos(\\frac{{k}\\pi}{2})+\\simplify{{a}-{b}}jsin(\\frac{{k}\\pi}{2})-\\var{a}cos({k}\\pi)-\\var{a}jsin({k}\\pi)+\\simplify{{b}-{c}}cos(\\frac{{k}\\pi}{2})-\\simplify{{b}-{c}}jsin(\\frac{{k}\\pi}{2})+\\var{c}cos({k}\\pi)-\\var{c}jsin({k}\\pi)\\right)\\)

\n

Recall \\(sin({k}\\pi)=0\\) for all whole number values of \\(k\\)

\n

\\(c_{k}=\\frac{j}{2{k}\\pi}\\left(\\simplify{{c}-{a}}cos({k}\\pi)+\\simplify{{a}-{c}}cos(\\frac{{k}\\pi}{{2}})+\\simplify{{c}-2*{b}+{a}}jsin(\\frac{{k}\\pi}{2}))\\right)\\)

\n

\\(c_{k}=\\frac{1}{2{k}\\pi}\\left(\\simplify{-{c}+2*{b}-{a}}sin(\\frac{{k}\\pi}{2})+j(\\simplify{{c}-{a}}cos({k}\\pi)+\\simplify{{a}-{c}}cos(\\frac{{k}\\pi}{{2}}))\\right)\\)

\n

\\(c_{k}=\\frac{1}{2{k}\\pi}\\left(\\simplify{(-{c}+2*{b}-{a})}sin(\\frac{{k}\\pi}{2})+(\\simplify{({c}-{a})}cos({k}\\pi)+\\simplify{({a}-{c})}cos(\\frac{{k}\\pi}{2}))j\\right)\\)

\n

Therefore

\n

\\(c_{\\var{k}}=\\frac{1}{\\simplify{2*{k}pi}}\\left(\\simplify{-{c}+2*{b}-{a}}sin(\\frac{\\var{k}\\pi}{2})+j(\\simplify{{c}-{a}}cos(\\var{k}\\pi)+\\simplify{{a}-{c}}cos(\\frac{\\var{k}\\pi}{{2}}))\\right)\\)

\n

\\(c_{\\var{k}}=\\frac{1}{\\simplify{2*{k}pi}}\\left(\\simplify{(-{c}+2*{b}-{a})sin({k}*pi/2)}+(\\simplify{(({c}-{a})cos({k}*pi)+({a}-{c})cos({k}*pi/2))})j\\right)\\)

\n

The \\(\\var{k}\\)th harmonic component equals \\(2|c_{\\var{k}}|\\)

\n

\\(2*|c_{\\var{k}}|=\\frac{1}{\\simplify{{k}pi}}\\sqrt{\\simplify{((-{c}+2*{b}-{a})sin({k}*pi/2))^2+(({c}-{a})cos({k}*pi)+({a}-{c})cos({k}*pi/2))^2}}\\)

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