// Numbas version: finer_feedback_settings {"name": "Bill's copy of Dynamical system 6:Centre.", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "advice": "
Given the system of differential equations:
\n\\[\\begin{align}\\dot{x}&=\\simplify[std]{a*x+b*y},\\\\\\dot{y}&=\\simplify[std]{c*x+d*y}.\\end{align}\\]
\nIt can be written in the form $\\dot{\\boldsymbol{x}}=\\mathsf{A}\\boldsymbol{x}$, where $\\boldsymbol{x}=\\pmatrix{x,y}^\\mathsf{T}$ and
\n\\[\\mathsf{A}=\\pmatrix{a& b\\\\c & d}\\]
\nIn this case, with $a=\\var{f}$ we want to enter values for $b,\\;c,\\;d$ such that the system gives a centre.
\nFor this to happen we need the eigenvalues of $A$ to be purely imaginary and you are given that they are $\\simplify{{v}*i}$ and $\\simplify{{-v}*i}$.
\nThe characteristic polynomial for $A$ is given by
\n\\[\\det\\left(\\mathsf{A}-\\lambda\\mathsf{I}\\right)=0,\\]
\ni.e. $(a-\\lambda)(d-\\lambda)-bc=0$. This leads to $\\lambda^2-(a+d)\\lambda+(ad-bc)=0$.
\nSo in order to get purely imaginary eigenvalues $\\pm \\var{abs(v)*i}$ we need :
\n1. $a+d=0 \\Rightarrow d=\\var{-f}$ as $a=\\var{f}$.
\n2. $ad-bc=\\var{v^2} \\Rightarrow bc=-\\var{v^2}-\\var{f^2}$.
\nHence if you set $d=\\var{-f}$ and you choose values of $b,\\;c$ such that $bc=-\\var{f^2+v^2}$, this will give the required system of differential equations with phase space a centre and the required eigenvalues.
", "parts": [{"gaps": [{"minValue": "1", "type": "numberentry", "variableReplacements": [], "correctAnswerStyle": "plain", "showFeedbackIcon": true, "allowFractions": false, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": false, "maxValue": "1", "marks": 0, "correctAnswerFraction": false, "scripts": {"mark": {"script": "!doesMarking;\nthis.answered=true;", "order": "instead"}}}, {"minValue": "1", "type": "numberentry", "variableReplacements": [], "correctAnswerStyle": "plain", "showFeedbackIcon": true, "allowFractions": false, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": false, "maxValue": "1", "marks": 0, "correctAnswerFraction": false, "scripts": {"mark": {"script": "!doesMarking;\nthis.answered=true;", "order": "instead"}}}, {"minValue": "1", "type": "numberentry", "variableReplacements": [], "correctAnswerStyle": "plain", "showFeedbackIcon": true, "allowFractions": false, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": false, "maxValue": "1", "marks": 0, "correctAnswerFraction": false, "scripts": {"mark": {"script": "!doesMarking;\nthis.answered=true;", "order": "instead"}}}, {"minValue": "0", "type": "numberentry", "variableReplacements": [], "correctAnswerStyle": "plain", "showFeedbackIcon": true, "allowFractions": false, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "maxValue": "0", "marks": 1, "correctAnswerFraction": false, "scripts": {}}, {"minValue": "0", "type": "numberentry", "variableReplacements": [], "correctAnswerStyle": "plain", "showFeedbackIcon": true, "allowFractions": false, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "maxValue": "0", "marks": 2, "correctAnswerFraction": false, "scripts": {}}], "type": "gapfill", "steps": [{"type": "information", "showFeedbackIcon": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "prompt": "$x(t)$ is in black, $y(t)$ in blue.
\nYou can use the navigation bar to zoom in and out of the graph.
", "variableReplacements": [], "marks": 0}], "showFeedbackIcon": true, "scripts": {}, "stepsPenalty": 0, "showCorrectAnswer": true, "prompt": "The system can be written in the form $\\dot{\\boldsymbol{x}}=\\mathsf{A}\\boldsymbol{x}$, where $\\boldsymbol{x}=\\pmatrix{x,y}^\\mathsf{T}$.
\nInput the components of the matrix $\\mathsf{A}$ in order to obtain a centre where the eigenvalues of $A$ are $\\simplify{{v}*i}$ and $\\simplify{{-v}*i}$.
\nYou are given that $a=\\var{f}$.
\n$\\mathsf{A}=\\Bigg($ | \n$\\var{f}$ | \n[[0]] | \n$\\Bigg)$ | \n
[[1]] | \n[[2]] | \n
Once you have input appropriate values into the matrix, the diagram below shows the plot of $(x(t),y(t))$.
\nAt $t=0$ we have initally $x=-5,\\;\\;y=5$. Moving the point gives phase diagrams for the following initial values at $t=0$:
\n$x=\\;$ $y=\\;$
\n\n\n\n\n\n\nYou can click on Steps to see the solutions for $x(t),\\;y(t)$ after you have input values into the matrix.
", "variableReplacements": [], "marks": 0, "variableReplacementStrategy": "originalfirst"}], "variables": {"v": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "v", "definition": "random(1..5)"}, "xr": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "xr", "definition": "50"}, "yr": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "yr", "definition": "50"}, "f": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "name": "f", "definition": "random(-9..9 except[0,1,-1])"}}, "tags": ["centres", "Differential equations", "differential equations", "dynamical system", "feedback", "fixed points", "interactive", "Jsxgraph", "jsxgraph", "navigation change", "phase space", "stable", "systems of differential equations", "unstable"], "rulesets": {"std": ["all", "!collectNumbers", "!noLeadingMinus"]}, "variablesTest": {"condition": "", "maxRuns": 100}, "functions": {}, "metadata": {"description": "Asking users to input coefficients of a system of diff equations so that the phase space is a centre. All systems input by the user are graphed together with immediate feedback. Also included in the Steps are the graphs of the solutions for $x(t),\\; y(t);\\; x(0)=-5,\\;y(0)=5.$
", "licence": "Creative Commons Attribution 4.0 International"}, "extensions": ["jsxgraph"], "preamble": {"css": "", "js": "var pc;\nvar brd;\nvar P1;\nvar brd1;\nvar g1;\nvar g2;\nvar fin;\nvar m;\nvar adv;\nfunction updateBoards(a,b,c,d) {\n function f(x,yy) {\n var y1 = yy[0];\n var y2 = yy[1];\n var z1 = a*y1+b*y2;\n var z2 = c*y1+d*y2;\n return [z1,z2];\n }\n \n function ode() {\n //solution curve data array produced in the interval between 0 and 10, 200 steps\n return JXG.Math.Numerics.rungeKutta('heun', [P1.Y(),P1.X()], [0, 10], 500, f);\n }\n function ode1() {\n //solution curve data array produced in the interval between 0 and -10, 200 steps\n return JXG.Math.Numerics.rungeKutta('heun', [P1.Y(),P1.X()], [0, -10], 500, f);\n }\n \n pc.updateDataArray = function() {\n var data = ode();\n var l=data.length;\n var data1=ode1();\n var l1=data1.length;\n this.dataX = [];\n this.dataY = [];\n for(var i=0; iConsider the following two-dimensional dynamical system . You have to find values for $a,\\;b\\;c,\\;d$ such that the system's phase space is a centre.
\n\\[\\begin{align}\\dot{x}&=\\simplify[std]{a*x+b*y},\\\\\\dot{y}&=\\simplify[std]{c*x+d*y}.\\end{align}\\]
\nNote that this question is purely formative and for experimenting with. No marks are given.
", "ungrouped_variables": ["xr", "yr", "v", "f"], "name": "Bill's copy of Dynamical system 6:Centre.", "type": "question", "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}]}