Editing USub Applet Sample Problem

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 107: Line 107:
 
</p>
 
</p>
 
<p>
 
<p>
The uSub.swf applet has the student enter a four part solution: the integrand after the u-substitution, the lower limit of integration in terms of u, the upper limit of integration in terms of u, and the value of the integral. The correct answer must be entered in list format in the pg file. That is what the code <code>$anslist = List(Compute("cos(u)"),</code> <code>Compute("0"),</code><code>Compute("$b+$b^2"),</code> <code>Compute("sin($b+$b^2)"));</code> does. The line <code>Context()->variables->add(u=>"Real");</code> adds the variable u to the context. <code>$vbig</code> and <code>$vsmall</code> are the vertical axes graph window settings. These can be different for the two graphs, but this is generally not a good idea as the purpose of the applet is to show the student that after a u-substitution, the are of the integrand will be the same even though the shape of the graph may change. Functions must be carefully chosen to convey this message and so that the two graph windows can be the same size. <code>$ubig</code> is the maximum value of the horizontal graph window for both graphs. The minimum value for this problem is coded in the pg file to '-3'. This is not necessary, it can be set to any value smaller than the maximum horizontal window value.
+
The uSub.swf applet has the student enter a four part solution: the integrand after the u-substitution, the lower limit of integration in terms of u, the upper limit of integration in terms of u, and the value of the integral. The correct answer must be entered in list format in the pg file. That is what the code <code>$anslist = List(Compute("cos(u)"),</code> <code>Compute("0"),</code><code>Compute("$b+$b^2"),</code><code>Compute("sin($b+$b^2)"));</code> does. The line <code>Context()->variables->add(u=>"Real");</code> adds the variable u to the context. <code>$vbig</code> and <code>$vsmall</code> are the vertical axes graph window settings. These can be different for the two graphs, but this is generally not a good idea as the purpose of the applet is to show the student that after a u-substitution, the are of the integrand will be the same even though the shape of the graph may change. Functions must be carefully chosen to convey this message and so that the two graph windows can be the same size. <code>$ubig</code> is the maximum value of the horizontal graph window for both graphs. The minimum value for this problem is coded in the pg file to '-3'. This is not necessary, it can be set to any value smaller than the maximum horizontal window value.
 
</p>
 
</p>
 
|- style="background-color:#ccffff;"
 
|- style="background-color:#ccffff;"
Line 176: Line 176:
 
<p>You must include the section that follows <code># Create link to applet</code>. If you are embedding a different applet, from the uSub applet, put your applet name in place of 'uSub' in the line <code>$appletName = "uSub";</code>. Enter the height of the applet in the line <code>height => '550',</code> in place of 550 and the width in the line <code>width => '700',</code> in place of 700.
 
<p>You must include the section that follows <code># Create link to applet</code>. If you are embedding a different applet, from the uSub applet, put your applet name in place of 'uSub' in the line <code>$appletName = "uSub";</code>. Enter the height of the applet in the line <code>height => '550',</code> in place of 550 and the width in the line <code>width => '700',</code> in place of 700.
 
</p><br>
 
</p><br>
<p> The lines <code>$applet-></code> <code>configuration(qq{<xml><plot func='(1+2*x)*cos(x+x^2)' </code> <code>lower='0' upper='$b'/></code> <code><br>
+
<p> The lines <code>$applet-></code><code>configuration(qq{<xml><plot func='(1+2*x)*cos(x+x^2)' </code><code>lower='0' upper='$b'/></code><code><br>
<grids xgrid='1' ygrid='$b'/></code> <code><br>
+
<grids xgrid='1' ygrid='$b'/></code><code><br>
 
<win xmin='-3' xmax='$ubig' ymin='$vsmall' ymax='$vbig'
 
<win xmin='-3' xmax='$ubig' ymin='$vsmall' ymax='$vbig'
umin='-3' umax='$ubig' vmin='$vsmall' vmax='$vbig' /></code> <code><br>
+
umin='-3' umax='$ubig' vmin='$vsmall' vmax='$vbig' /></code><code><br>
<ans func='' lower='' upper ='' theValue='' /></code> <code><br>
+
<ans func='' lower='' upper ='' theValue='' /></code><code><br>
 
<usub ufunc='x+x^2'/></xml>});</code>
 
<usub ufunc='x+x^2'/></xml>});</code>
 
<br>
 
<br>
 
and
 
and
 
<br>
 
<br>
<code>$applet-></code> <code>initialState(qq{<xml><plot func='(1+2*x)*cos(x+x^2)' </code> <code>lower='0' upper='$b'/></code> <code><br>
+
<code>$applet-></code><code>initialState(qq{<xml><plot func='(1+2*x)*cos(x+x^2)' </code><code>lower='0' upper='$b'/></code><code><br>
<grids xgrid='1' ygrid='$b'/></code> <code><br>
+
<grids xgrid='1' ygrid='$b'/></code><code><br>
 
<win xmin='-3' xmax='$ubig' ymin='$vsmall' ymax='$vbig'
 
<win xmin='-3' xmax='$ubig' ymin='$vsmall' ymax='$vbig'
umin='-3' umax='$ubig' vmin='$vsmall' vmax='$vbig' /></code> <code><br>
+
umin='-3' umax='$ubig' vmin='$vsmall' vmax='$vbig' /></code><code><br>
<ans func='' lower='' upper ='' theValue='' /></code> <code><br>
+
<ans func='' lower='' upper ='' theValue='' /></code><code><br>
 
<usub ufunc='x+x^2'/></xml>});</code>
 
<usub ufunc='x+x^2'/></xml>});</code>
 
<br> configure the applet. The configuration of the applet is done in xml. The applet expects to be told the integrand of the original integral (func='(1+2*x)*cos(x+x^2)'), the lower limit of integration (lower='0'), the upper limit (upper='$b'), the horizontal and vertical grid spacing (xgrid='1' ygrid='$b'), the dimensions of the two graph windows (,code><win xmin='-3' xmax='$ubig' ymin='$vsmall' ymax='$vbig'
 
<br> configure the applet. The configuration of the applet is done in xml. The applet expects to be told the integrand of the original integral (func='(1+2*x)*cos(x+x^2)'), the lower limit of integration (lower='0'), the upper limit (upper='$b'), the horizontal and vertical grid spacing (xgrid='1' ygrid='$b'), the dimensions of the two graph windows (,code><win xmin='-3' xmax='$ubig' ymin='$vsmall' ymax='$vbig'

Please note that all contributions to WeBWorK_wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see The WeBWorK Project wiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)