// Numbas version: exam_results_page_options {"name": "Task C", "extensions": [], "custom_part_types": [], "resources": [["question-resources/VICKY_MATLAB_PLOt.png", "/srv/numbas/media/question-resources/VICKY_MATLAB_PLOt.png"], ["question-resources/VICKY_MATLAB_PLOt_mdUZbm1.png", "/srv/numbas/media/question-resources/VICKY_MATLAB_PLOt_mdUZbm1.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Task C", "tags": [], "metadata": {"description": "

For ENG1002 - Matlab Lab 4: Differentiation, Integration, Solving Differentiation equations.

", "licence": "All rights reserved"}, "statement": "

Task C: Particle Motion Solve ODE's. [4 marks]

\n

The motion of three particles can be given by the following first-order ordinary differential equations (ODEs):

\n

$\\frac{dy_1}{dt}=(y_2-y_3)$

\n

$\\frac{dy_2}{dt}=(y_3-y_1)$

\n

$\\frac{dy_3}{dt}=(y_1-y_2)$

\n

where $y_1,y_2$ and $y_3$ are positions for particle 1, 2 and 3. 

\n

We could rewrite the equations above:

\n

$\\frac{d}{dt}\\left( \\begin{array}{ccc} y_1 \\\\ y_2 \\\\ y_3\\end{array} \\right) = \\left( \\begin{array}{ccc} y_2 - y_3 \\\\ y_3 - y_1 \\\\ y_1 - y_2\\end{array} \\right)$

\n

In MATLAB, if we solve these ODEs using the ode23 command and plot the results we should see a figure similar to the one below:

\n

", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_2", "useCustomName": true, "customName": "Question 1", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Define the function $f$, which is a function of $t$ and $y$, to represent the differentiation equation above. [2 marks] 

", "minMarks": 0, "maxMarks": "2", "shuffleChoices": false, "displayType": "checkbox", "displayColumns": "1", "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": ["A)    f = @(t,y) [y2-y3;y3-y1;y1-y2];", "B)    f = @(t,y) [y(2)-y(3);y(3)-y(1);y(1)-y(2)];"], "matrix": ["-2", "2"], "distractors": ["A) Incorrect, the correct answer is B. y1,y2, and y3 forms the matrix y. Then, in matlab, you should use y(1) for y1, y(2) for y2 and so on. ", "B) Correct. y1,y2, and y3 forms the matrix y. Then, in matlab, you should use y(1) for y1, y(2) for y2 and so on. "]}, {"type": "m_n_2", "useCustomName": true, "customName": "Question 2", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Use ode23 to plot the trajectory of all three particle in the first 6 seconds. When t=0s, the original positions for particle 1, 2 and 3 are 1, 0, -1 centimeter. [1.5 marks]

", "minMarks": 0, "maxMarks": "1.5", "shuffleChoices": false, "displayType": "checkbox", "displayColumns": "1", "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": ["A)    ode23(f,0,6, [1;0;-1]);", "B)    ode23(f,[0,6], 1;0;-1);", "C)    ode23(f,[0,6], [1;0;-1]);"], "matrix": ["-1.5", "-1.5", "1.5"], "distractors": ["A) Incorrect, the correct answer is C. You must add square bracket for the limits of independent variable and the initial conditions. ", "B) Incorrect, the correct answer is C. You must add square bracket for the limits of independent variable and the initial conditions. ", "C) Correct. You must add square bracket for the limits of independent variable and the initial conditions. "]}, {"type": "m_n_2", "useCustomName": true, "customName": "Question 3", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Add title, legend, x and y axis labels to graph. [0.5 marks]

", "minMarks": 0, "maxMarks": "0.5", "shuffleChoices": false, "displayType": "checkbox", "displayColumns": "1", "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": ["

A)    title('Particle motion');
       xlabel('Time(s)');
       ylabel('Position');
       legend('Particle 1''Particle 2''Particle 3')

", "

B)    title('Particle motion');
       xlabel('Time(s)');
       ylabel('Position');
       legend('Particle 1','Particle 2','Particle 3')

"], "matrix": ["-0.5", "0.5"], "distractors": ["A) Incorrect, the correct answer is B. You must use comma (,) to separate legend for each curve. ", "Correct. You must use comma (,) to separate legend for each curve. "]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Alex Boote", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5098/"}]}]}], "contributors": [{"name": "Alex Boote", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5098/"}]}