// Numbas version: exam_results_page_options {"name": "Trigonometric 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": "Trigonometric form of a Fourier series.", "functions": {}, "statement": "

Given the function:

\n

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

\n

", "ungrouped_variables": ["a", "b", "L"], "metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": "

Calculating particular harmonic components of a Fourier series expansion.

"}, "rulesets": {}, "preamble": {"js": "", "css": ""}, "parts": [{"variableReplacements": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "marks": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "gaps": [{"checkingtype": "absdiff", "expectedvariablenames": [], "marks": "4", "variableReplacementStrategy": "originalfirst", "checkingaccuracy": 0.001, "vsetrangepoints": 5, "type": "jme", "variableReplacements": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "checkvariablenames": false, "scripts": {}, "vsetrange": [0, 1], "answer": "({a}+{b})/2+2*({b}-{a})/(pi)sin(pi*t/{L})+2*({b}-{a})/(3*pi)sin(3*pi*t/{L})", "showpreview": true}], "type": "gapfill", "prompt": "

Write out the first three non-zero terms of the Fourier series, expressing each coefficient as an exact fraction.

\n

\\(f(t)=\\) [[0]]

"}], "tags": [], "advice": "

\\(f(t)=\\{\\begin{array}{cc}\\,\\,\\var{a}&\\,\\,-\\var{L}<t<0\\\\\\,\\,\\var{b}&\\,\\,\\,\\,\\,\\,\\,\\,\\,0<t<\\var{L}\\end{array}\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,f(t+\\simplify{2*{L}})=f(t)\\)

\n

\\(\\frac{a_0}{2}=\\) the average value of the wave over one complete cycle

\n

\\(\\frac{a_0}{2}=\\frac{\\var{a}+\\var{b}}{2}=\\simplify{({a}+{b})/2}\\)

\n

\n

If we could move the x-axis to \\(y=\\simplify{({a}+{b})/2}\\) the function would become odd.

\n

This implies that \\(f(t)=g(t)+\\simplify{({a}+{b})/2}\\) where \\(g(t)\\) is an odd function and hence \\(a_k=0\\).

\n

\n

\\(b_k=\\frac{1}{L}\\int_{-L}^{L}f(t)sin\\left(\\frac{{k}\\pi}{L}t\\right)dt\\)       \\(2L=\\simplify{2*{L}}\\implies L=\\var{L}\\)

\n

\\(b_k=\\frac{1}{\\var{L}}\\left(\\int_{-\\var{L}}^{0}\\var{a}sin\\left(\\frac{{k}\\pi}{\\var{L}}t\\right)dt+\\int_{0}^{\\var{L}}\\var{b}sin\\left(\\frac{{k}\\pi}{\\var{L}}t\\right)dt\\right)\\)

\n

\\(b_k=\\frac{1}{\\var{L}}\\left(-\\frac{\\var{a}*\\var{L}}{{k}\\pi}cos\\left(\\frac{{k}\\pi}{\\var{L}}t\\right)|_{-\\var{L}}^0-\\frac{\\var{b}*\\var{L}}{{k}\\pi}cos\\left(\\frac{{k}\\pi}{\\var{L}}t\\right)|_{0}^{\\var{L}}\\right)\\)

\n

\\(b_k=-\\frac{\\var{a}}{{k}\\pi}cos(0)+\\frac{\\var{a}}{{k}\\pi}cos(-\\var{k}\\pi)-\\frac{\\var{b}}{{k}\\pi}cos(\\var{k}\\pi)+\\frac{\\var{b}}{{k}\\pi}cos(0)\\)

\n

\\(b_k=\\frac{\\simplify{{b}-{a}}}{\\var{k}\\pi}-\\frac{\\simplify{{b}-{a}}}{{k}\\pi}cos(\\var{k}\\pi)\\)

\n

If \\(k\\) is an odd number \\(cos(k\\pi)=-1\\)

\n

\\(b_k=\\frac{\\simplify{{b}-{a}}}{\\var{k}\\pi}-\\frac{\\simplify{{b}-{a}}}{{k}\\pi}(-1)=\\frac{\\simplify{2*({b}-{a})}}{({k}*pi)}\\)

\n

If \\(k\\) is an even number \\(cos(k\\pi)=1\\)

\n

\\(b_k=\\frac{\\simplify{{b}-{a}}}{{k}\\pi}-\\frac{\\simplify{{b}-{a}}}{{k}\\pi}(1)=0\\)

\n

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": [], "variables": {"L": {"name": "L", "definition": "random(2..7#1)", "templateType": "randrange", "group": "Ungrouped variables", "description": ""}, "a": {"name": "a", "definition": "random(1..17#2)", "templateType": "randrange", "group": "Ungrouped variables", "description": ""}, "b": {"name": "b", "definition": "random(2..16#2)", "templateType": "randrange", "group": "Ungrouped variables", "description": ""}}, "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/"}]}