<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>4.5.1.4  Sketch a graph</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>Using the values you filed in on the previous table, what is the shape of the function \( x = R\cos(\omega t) \) for \( t=0\) to \( t=\dfrac{4\pi}{\omega}\), where \( R={@a@}\) and \( \omega={@b@}&nbsp; \)?</p>
<p>[[input:ans1]] [[validation:ans1]] [[feedback:prt1]]</p>
<p>Choose from the graphs below:</p><ul> </ul>
<table>
  <tbody><tr>
    <td><b>Graph A</b></td>
    <td><b>Graph B</b></td>
  </tr>
  <tr>
    <td>{@thumbnailplot(funcstoplot[1],"Graph A")@}</td>
    <td>{@thumbnailplot(funcstoplot[2],"Graph B")@}</td>
  </tr><tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr><tr>
    <td>&nbsp;<b>Graph C</b></td>
    <td><b>Graph D</b></td>
  </tr><tr>
    <td>&nbsp;{@thumbnailplot(funcstoplot[3],"Graph C")@}</td>
    <td>{@thumbnailplot(funcstoplot[4],"Graph D")@}&nbsp;</td></tr></tbody></table><br><p></p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>Here are the values we found for \(x = R \cos(\omega t)\) in the previous question.</p>
<table class="HELM_table">
<thead>
<tr>
<th>\(t\)</th>
<th>\( 0 \)</th>
<th>\( \dfrac{\pi}{2\omega} \)</th>
<th>\( \dfrac{\pi}{\omega} \)</th>
<th>\( \dfrac{3\pi}{2\omega} \)</th>
<th>\( \dfrac{2\pi}{\omega} \)</th>
</tr>
</thead>
<tbody>
<tr>
<td>\(x\)</td>
<td>\(R\)</td>
<td>\(0\)</td>
<td>\(-R\)</td>
<td>\(0\)</td>
<td>\(R\)</td>
</tr></tbody>
</table>
<p>Substituing the given values for \(R\) and \(\omega\) we see that the correct graph is {@corr[1]@}.</p><p>{@plot(f,[x,0,4*pi/b],[y,-a, a],[box, false],[yx_ratio, 0.7],[xtics, 0, 2*pi/b,4*pi/b],[ytics, -a, 2*a, a],[axes, solid],[size,240,240],[plottags,false])@}<br></p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021072200</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[a: rand(15)+2;
b: (2*pi)/(rand(4)+1);
f: a*cos(b*x);
g:  a*sin(b*x);
f1: fullratsimp(f)
f(x):=a*cos(b*x);
g(x):=a*sin(b*x);



max: f(a/2);
min: f(a/3);

c_funcs: [f];
w_funcs: [-f, -g, g];
/* Choose functions to plot */
funcs: append(c_funcs, rand_selection(w_funcs,3)) 
/* permute the graphs but keep note of which ones are right! */
reordering:random_permutation([1,2,3,4]);
fntoletter:zip_with("[",reordering,[A,B,C,D]);
/* apply the reordering to produce the shuffled list of options */
funcstoplot: makelist(funcs[reordering[i]],i,1,4);
corr:maplist(lambda([ex],assoc(ex,fntoletter)), [1,2,3,4]);
ta1:maplist(lambda([ex],[ex, is(ex=assoc(1,fntoletter))]), [A,B,C,D]);
thumbnailplot:lambda([ex1,ex2],plot(ex1,[x,0,4*pi/b],[y,-a, a],[box, false],[yx_ratio, 0.7],[xtics, 0, 2*pi/b,4*pi/b],[ytics, -a, 2*a, a],[axes, solid],[size,240,240],[plottags,false],[alt,ex2]));]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[ f = {@f@}, \quad {@corr[1]@} \]
\[wrong = {@w_funcs@} \]</text>
    </questionnote>
    <questiondescription format="moodle_auto_format">
      <text/>
    </questiondescription>
    <questionsimplify>1</questionsimplify>
    <assumepositive>0</assumepositive>
    <assumereal>0</assumereal>
    <prtcorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:green;"><i class="fa fa-check"></i></span> Correct answer, well done.]]></text>
    </prtcorrect>
    <prtpartiallycorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:orange;"><i class="fa fa-adjust"></i></span> Your answer is partially correct.]]></text>
    </prtpartiallycorrect>
    <prtincorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:red;"><i class="fa fa-times"></i></span> Incorrect answer.]]></text>
    </prtincorrect>
    <decimals>.</decimals>
    <scientificnotation>*10</scientificnotation>
    <multiplicationsign>dot</multiplicationsign>
    <sqrtsign>1</sqrtsign>
    <complexno>i</complexno>
    <inversetrig>cos-1</inversetrig>
    <logicsymbol>lang</logicsymbol>
    <matrixparens>[</matrixparens>
    <isbroken>0</isbroken>
    <variantsselectionseed/>
    <input>
      <name>ans1</name>
      <type>dropdown</type>
      <tans>ta1</tans>
      <boxsize>15</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>0</showvalidation>
      <options/>
    </input>
    <prt>
      <name>prt1</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1</sans>
        <tans>corr[1]</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>456060512</deployedseed>
    <deployedseed>8409083</deployedseed>
    <deployedseed>1438367252</deployedseed>
    <deployedseed>1906670235</deployedseed>
    <deployedseed>1748130305</deployedseed>
    <deployedseed>905234147</deployedseed>
    <deployedseed>1093340902</deployedseed>
    <deployedseed>774418216</deployedseed>
    <deployedseed>1438594724</deployedseed>
    <deployedseed>628215946</deployedseed>
    <deployedseed>1390986873</deployedseed>
    <deployedseed>952096170</deployedseed>
    <deployedseed>1367262140</deployedseed>
    <deployedseed>1155768078</deployedseed>
    <deployedseed>839110196</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>corr[1]</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>corr[2]</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
