The system can be written in the form $\\dot{\\boldsymbol{x}}=\\mathsf{A}\\boldsymbol{x}$, where $\\boldsymbol{x}=\\pmatrix{x,y}^\\mathsf{T}$.

\n

Input the components of the matrix $\\mathsf{A}$ in order to obtain a stable spiral.

\n

In order to achieve this you have to supply the diagonal elements of the matrix, the entries for $b,\\;c$ are given. In this case the eigenvalues of $A$ are complex and of the form $w+vi,\\;w-vi$ where $w <0$.

\n

You are given that $b=\\var{f},\\;c=\\var{g}$.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
 $\\mathsf{A}=\\Bigg($ [] $\\var{f}$ $\\Bigg)$ $\\var{g}$ []
\n

\n

\n

Once you have input appropriate values into the matrix, the diagram below shows the plot of $(x(t),y(t))$.

\n

At $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

\n

You can click on Steps to see the solutions for $x(t),\\;y(t)$ after you have input values into the matrix.

", "variableReplacements": [], "scripts": {}, "type": "gapfill", "showFeedbackIcon": true, "steps": [{"marks": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "prompt": "

#### Graph of $x(t),\\;y(t)$

\n

\n

\n

$x(t)$ is in black, $y(t)$ in blue.

\n

You can use the navigation bar to zoom in and out of the graph.

", "variableReplacements": [], "scripts": {}, "type": "information", "showFeedbackIcon": true}]}], "metadata": {"description": "

Asking users to input coefficients of a system of diff equations so that the phase space is a stable spiral. 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"], "variablesTest": {"condition": "", "maxRuns": 100}, "functions": {}, "ungrouped_variables": ["xr", "yr", "g", "f"], "statement": "

Consider 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 stable spiral.

\n

\\\begin{align}\\dot{x}&=\\simplify[std]{a*x+b*y},\\\\\\dot{y}&=\\simplify[std]{c*x+d*y}.\\end{align}\

\n

Note that this question is purely formative and for experimenting with. No marks are given.

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}\

\n

It 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}\$

\n

In this case, with $b=\\var{f},\\;c=\\var{g}$  we want to enter values for $a,\\;d$ such that the system gives a stable spiral for its phase space.

\n

For this to happen we need the eigenvalues of $A$ to be complex with negative real parts.

\n

The characteristic polynomial for $A$ is given by

\n

\$\\det\\left(\\mathsf{A}-\\lambda\\mathsf{I}\\right)=0,\$

\n

i.e.  $(a-\\lambda)(d-\\lambda)-bc=0$.  This leads to $\\lambda^2-(a+d)\\lambda+(ad-bc)=0$.

\n

So in order to get complex eigenvalues with negative real parts we need :

\n

1. Complex roots. Hence $(a+d)^2 \\lt 4(ad-bc) \\Rightarrow (a-d)^2 \\lt -4bc$. Note that this means that $b,\\;c$ must have opposite signs as they do have for this example.

\n

Hence we have one condition is that $(a-d)^2 \\lt \\simplify[all,!collectNumbers]{-4*{f}*{g}={-4*f*g}}$

\n

2. Real part $\\lt 0$ gives the other condition  $a+d \\lt 0$.

\n

", "preamble": {"js": "var pc;\nvar brd;\nvar P1;\nvar brd1;\nvar g1;\nvar g2;\nvar fin;\nvar m;\nfunction updateBoards(a,b,c,d) {\n function f(x,yy) {\nvar y1 = yy;\nvar y2 = yy;\nvar z1 = a*y1+b*y2;\nvar z2 = c*y1+d*y2;\nreturn [z1,z2];\n }\n \n function ode() {\n//solution curve data array produced in the interval between 0 and 10, 200 steps\nreturn 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\nreturn JXG.Math.Numerics.rungeKutta('heun', [P1.Y(),P1.X()], [0, -10], 500, f);\n }\n\npc.updateDataArray = function() {\nvar data = ode();\nvar l=data.length;\nvar data1=ode1();\nvar l1=data1.length;\nthis.dataX = [];\nthis.dataY = [];\nfor(var i=0; i0){ty='Unstable spiral.';} \n else if(ans1<0){ty='Stable spiral.';} else {ty='Centre.';}}\n else {if(det<0){ty='Saddle.';}\n else if ((det>0)&&(ans1>0)){ty='Unstable node.';} else {ty='Stable node.';}}}\nelse {ty=''};\n//if either the input has not been completed or the correct answer has been input - no message.\nif(fin||((st1==-1)&&(ans==1))){ m='';}\n//all entries have been input and an incorrect diagonal value has been input or gives the wrong eigenvalue.\n else if(st1!=-1){m='The eigenvalues are real, so you do not have a spiral.';}\n else {m='This is not a stable spiral.';}\nvar html = question.display.html;\nhtml.find('#type').text(ty);\n//This is displayed in the question as an aid to the user.\nhtml.find('#mess').text(m);\n\n/*values for hidden gapfills which are marked*/\nquestion.parts.gaps.display.studentAnswer(st1); \nquestion.parts.gaps.display.studentAnswer(ans);\n\nupdateBoards(a,b,c,d);\n});\n});\n", "css": ""}, "name": "Dynamical system 7: Stable spiral.", "rulesets": {"std": ["all", "!collectNumbers", "!noLeadingMinus"]}, "variable_groups": [], "variables": {"f": {"templateType": "anything", "definition": "random(-9..9 except[0,1,-1])", "name": "f", "group": "Ungrouped variables", "description": ""}, "yr": {"templateType": "anything", "definition": "50", "name": "yr", "group": "Ungrouped variables", "description": ""}, "g": {"templateType": "anything", "definition": "if(f<0,random(2..9),random(-9..-2))", "name": "g", "group": "Ungrouped variables", "description": ""}, "xr": {"templateType": "anything", "definition": "50", "name": "xr", "group": "Ungrouped variables", "description": ""}}, "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/"}]}