// Numbas version: finer_feedback_settings {"name": "Week 1 homework test", "question_groups": [{"pickingStrategy": "all-ordered", "name": "Group", "pickQuestions": 1, "questions": [{"name": "The domain and codomain of a function", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}], "functions": {}, "ungrouped_variables": ["x1", "y1"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "", "rulesets": {}, "parts": [{"maxAnswers": 0, "displayColumns": 0, "prompt": "

Which combinations of domain and codomain make the formula $g(x) = 2x$ into a function?

", "matrix": ["1", "-1", "1", "1"], "shuffleChoices": false, "variableReplacements": [], "minAnswers": "0", "variableReplacementStrategy": "originalfirst", "maxMarks": 0, "distractors": ["", "$g(2)=4$ is not in the codomain", "", ""], "showCorrectAnswer": true, "scripts": {}, "warningType": "none", "marks": 0, "choices": ["

Domain $\\left\\{0,1,2\\right\\}$ and codomain $\\left\\{0,2,4\\right\\}$

", "

Domain $\\left\\{0,1,2\\right\\}$ and codomain $\\left\\{0,2\\right\\}$

", "

Domain $\\left\\{0,1,2\\right\\}$ and codomain $\\left\\{0,2,4,5\\right\\}$

", "

Domain $\\mathbb N$ and codomain $\\mathbb N$.

"], "type": "m_n_2", "displayType": "checkbox", "minMarks": 0}, {"maxAnswers": 0, "displayColumns": 0, "prompt": "

Which of the following forumulas make $h:\\mathbb Z \\mapsto \\mathbb Z$ into a function?

", "matrix": ["1", "-1", "-1", "1", "-1", "1"], "shuffleChoices": false, "variableReplacements": [], "minAnswers": 0, "variableReplacementStrategy": "originalfirst", "maxMarks": 0, "distractors": ["", "$h(1)=\\pm 1$ and so the input of 1 determines two possible outputs.", "$h(2) = \\sqrt(2)$ is not an element of the codomain", "", "$\\frac12$ is not in the codomain", ""], "showCorrectAnswer": true, "scripts": {}, "warningType": "none", "marks": 0, "choices": ["

$h(x) = -x$

", "

$h(x) = \\pm x$

", "

$h(x) = \\sqrt{x}$

", "

$h(x) = x^2$

", "

$h(x) = \\frac12$

", "

$h(x) = 1$

"], "type": "m_n_2", "displayType": "checkbox", "minMarks": 0}], "statement": "

Informally, a function tells you how to transform elements of one set into another. The parts of a function are the: name, domain, codomain and formula.

\n\n

We use the notation $f: X\\mapsto Y$ to mean that the function named $f$ has domain $X$ and codomain $Y$. The formula is expressed separately, for example

\n

$ f: \\left\\{-1,0,1\\right\\} \\mapsto \\left\\{0,1\\right\\}, f(x) = x^2.$

\n

The distinctive aspect of a function is that for any input, the formula determines exactly one output. 

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"y1": {"definition": "x1+1", "templateType": "anything", "group": "Ungrouped variables", "name": "y1", "description": ""}, "x1": {"definition": "random(-1,0,1)", "templateType": "anything", "group": "Ungrouped variables", "name": "x1", "description": ""}}, "metadata": {"description": "

A short question explaining the domain of a function.

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "type": "question"}, {"name": "Application 1: Differential equation with a repeated linear factor & a delta function", "extensions": [], "custom_part_types": [], "resources": [["question-resources/MSD.jpg", "/srv/numbas/media/question-resources/MSD.jpg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "parts": [{"showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "gaps": [{"showFeedbackIcon": true, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "allowFractions": true, "correctAnswerFraction": true, "maxValue": "{c1}/((-{d1}+{a1})(-{d1}+{a1}))", "variableReplacements": [], "minValue": "{c1}/((-{d1}+{a1})(-{d1}+{a1}))", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "scripts": {}, "marks": 1, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReduced": false}, {"showFeedbackIcon": true, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "allowFractions": true, "correctAnswerFraction": true, "maxValue": "{i0}-{c1}/((-{d1}+{a1})(-{d1}+{a1}))", "variableReplacements": [], "minValue": "{i0}-{c1}/((-{d1}+{a1})(-{d1}+{a1}))", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "scripts": {}, "marks": 1, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReduced": false}, {"showFeedbackIcon": true, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "allowFractions": true, "correctAnswerFraction": true, "maxValue": "({c1}+(-{i0}*{a1}+{i1}+2*{a1}*{i0})*(-{a1}+{d1}))/(-{a1}+{d1})", "variableReplacements": [], "minValue": "({c1}+(-{i0}*{a1}+{i1}+2*{a1}*{i0})*(-{a1}+{d1}))/(-{a1}+{d1})", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "scripts": {}, "marks": 1, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReduced": false}, {"showFeedbackIcon": true, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "allowFractions": false, "correctAnswerFraction": false, "maxValue": "b", "variableReplacements": [], "minValue": "b", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "scripts": {}, "marks": 1, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReduced": false}], "type": "gapfill", "variableReplacements": [], "prompt": "

Enter the value for \\(A\\) as an exact fraction.      \\(A=\\) [[0]]

\n

Enter the value for \\(B\\) as an exact fraction.      \\(B=\\) [[1]]

\n

Enter the value for \\(C\\) as an exact fraction.      \\(C=\\) [[2]]

\n

Enter the value for \\(D\\).                                           \\(D=\\) [[3]]

"}], "statement": "

The diagram below shows a typical mass-spring-damper system as might apply to the suspension of a car.

\n

(Masses have mass M, springs with stiffness k and dampers having damping coefficient B).

\n

The associated variables are displacement x(t) and force F(t).

\n

 

\n

Initially the mass is at a distance \\(\\var{i0}cm\\) from the equilibrium point and is moving at \\(\\var{i1}cm/s\\).

\n

If \\(B=\\simplify{2*{a1}}\\)  and  \\(k=\\simplify{{a1}^2}\\) and the system is subjected to an external applied force \\(F(t)=\\var{c1}e^{-\\var{d1}t}+\\var{b}\\delta(t-\\var{f})\\)

\n

then from Newton's law we get the differential equation:

\n

\n

     \\(\\frac{d^2x}{dt^2}+\\simplify{{a1}+{a1}}\\frac{dx}{dt}+\\simplify{{a1}*{a1}}x(t)=\\var{c1}e^{-\\var{d1}t}+\\var{b}\\delta(t-\\var{f})\\)  where \\(x(0)=\\var{i0} \\,\\, and \\,\\,  x'(0)=\\var{i1}\\)

\n

\n

The solution of the equation is given by:

\n

\n

     \\(x(t)=Ae^{-\\var{d1}t}+Be^{-\\var{a1}t}+Cte^{-\\var{a1}t}+Du(t-\\var{f})(t-\\var{f})e^{-\\var{a1}(t-\\var{f})}\\)

\n

.

", "rulesets": {}, "preamble": {"js": "", "css": ""}, "variable_groups": [], "functions": {}, "advice": "

\\(\\frac{d^2x}{dt^2}+\\simplify{{a1}+{a1}}\\frac{dx}{dt}+\\simplify{{a1}*{a1}}x(t)=\\var{c1}e^{-\\var{d1}t}+\\var{b}\\delta(t-\\var{f})\\)  where \\(x(0)=\\var{i0} \\,\\, and \\,\\,  x'(0)=\\var{i1}\\)

\n

The Laplace transform of this is given by:

\n

\\(s^2X(s)-\\var{i0}s-\\var{i1}+\\simplify{{a1}+{a1}}(sX(s)-\\var{i0})+\\simplify{{a1}*{a1}}X(s)=\\frac{\\var{c1}}{s+\\var{d1}}+\\var{b}e^{-\\var{f}s}\\)

\n

Gathering only \\(X(s)\\) terms on the left hand side and factoring gives:

\n

\\((s^2+\\simplify{{a1}+{a1}}s+\\simplify{{a1}*{a1}})X(s)=\\frac{\\var{c1}}{s+\\var{d1}}+\\var{i0}s+\\simplify{{i1}+({a1}+{a1})*{i0}}+\\var{b}e^{-\\var{f}s}\\)

\n

\\((s^2+\\simplify{{a1}+{a1}}s+\\simplify{{a1}*{a1}})X(s)=\\frac{\\simplify{{c1}+({i0}s+{i1}+({a1}+{a1})*{i0})*(s+{d1})}}{s+\\var{d1}}+\\var{b}e^{-\\var{f}s}\\)

\n

\\(X(s)=\\frac{\\simplify{{c1}+({i0}s+{i1}+({a1}+{a1})*{i0})*(s+{d1})}}{(s+\\var{d1})(s+\\var{a1})^2}+\\frac{\\var{b}}{(s+\\var{a1})^2}e^{-\\var{f}s}\\)

\n

Solving the first fraction gives:

\n

\\(X(s)=\\frac{A}{s+\\var{d1}}+\\frac{B}{s+\\var{a1}}+\\frac{C}{(s+\\var{a1})^2}\\)

\n

\\(\\simplify{{c1}+({i0}s+{i1}+({a1}+{a1})*{i0})*(s+{d1})}=A(s+\\var{a1})(s+\\var{a1})+B(s+\\var{d1})(s+\\var{a1})+C(s+\\var{d1})\\)

\n

Let \\(s=-\\var{d1}\\)

\n

\\(\\simplify{{c1}+({i0}*-{d1}+{i1}+({a1}+{a1})*{i0})*(-{d1}+{d1})}=\\simplify{(-{d1}+{a1})(-{d1}+{a1})}A\\)

\n

\\(A=\\simplify{({c1})/((-{d1}+{a1})(-{d1}+{a1}))}\\)

\n

Let \\(s=-\\var{a1}\\)

\n

\\(\\simplify{{c1}+({i0}*-{a1}+{i1}+({a1}+{a1})*{i0})*(-{a1}+{d1})}=\\simplify{(-{a1}+{d1})}C\\)

\n

\\(C=\\simplify{({c1}+({i0}*-{a1}+{i1}+({a1}+{a1})*{i0})*(-{a1}+{d1}))/((-{a1}+{d1}))}\\)

\n

Compare the coefficients of \\(s^2\\)   

\n

\\(\\var{i0}=A+B\\)

\n

\\(B=\\simplify{{i0}-(({c1})/((-{d1}+{a1})(-{d1}+{a1})))}\\)

\n

\\(B=\\simplify{({i0}*(-{d1}+{a1})*(-{d1}+{a1})-{c1})/((-{d1}+{a1})*(-{d1}+{a1}))}\\)

\n

We can find the inverse Laplace transform of the second fraction without breaking it down: 

\n

\\(\\frac{\\var{b}}{(s+\\var{a1})^2}e^{-\\var{f}s}\\) changes to \\(\\var{b}u(t-\\var{f})(t-\\var{f})e^{-\\var{a1}(t-\\var{f})}\\)

\n

\\(D=\\var{b}\\)

", "tags": [], "ungrouped_variables": ["a1", "c1", "d1", "i0", "i1", "b", "f", "B_1"], "metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": "

Solve a Differential equation with a repeated linear factor & a delta function

"}, "variables": {"b": {"name": "b", "group": "Ungrouped variables", "description": "", "templateType": "randrange", "definition": "random(2..12#1)"}, "B_1": {"name": "B_1", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "{i0}-{c1}/((-{d1}+{a1})(-{d1}+{a1}))"}, "f": {"name": "f", "group": "Ungrouped variables", "description": "", "templateType": "randrange", "definition": "random(1..9#1)"}, "a1": {"name": "a1", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "random(1..5)"}, "d1": {"name": "d1", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "random(12..16)"}, "i0": {"name": "i0", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "random(1..10)"}, "i1": {"name": "i1", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "random(1..10) "}, "c1": {"name": "c1", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "random(1..10)"}}, "variablesTest": {"maxRuns": "222", "condition": ""}, "type": "question"}]}], "duration": 0, "percentPass": 0, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "metadata": {"description": "

description

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "navigation": {"onleave": {"action": "none", "message": ""}, "reverse": true, "allowregen": true, "showresultspage": "oncompletion", "preventleave": true, "browse": true, "showfrontpage": true}, "showQuestionGroupNames": false, "feedback": {"showtotalmark": true, "advicethreshold": 0, "allowrevealanswer": true, "feedbackmessages": [], "showactualmark": true, "showanswerstate": true, "intro": "", "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "never"}, "type": "exam", "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}], "extensions": [], "custom_part_types": [], "resources": [["question-resources/MSD.jpg", "/srv/numbas/media/question-resources/MSD.jpg"]]}