Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ $rd2 = $r / 2;
$gr[0]->moveTo($rd2,0);
$gr[0]->arrowTo($rd2+0.1,0,"red",3);

$grAlt = "A vector field witha wedge shaped path traveled counterclockwise";
$grDescr = "A vector field with a counterclockwise rotation and magnitude increasing as points go away from the origin. A wedge shaped path going from the origin to (3,0), then along a circular path of radius 3 from the origin for 30 degrees, then back to the origin. ";

foreach my $i (0) {
$fig[$i] = image(insertGraph($gr[$i]),width=>"400",height=>"400",tex_size=>"700");
$fig[$i] = image(insertGraph($gr[$i]),width=>"400",height=>"400",tex_size=>"700", alt=>$grAlt, long_description=>$grDescr)
}


Expand Down
184 changes: 107 additions & 77 deletions OpenProblemLibrary/Michigan/Chap12Sec4/Q15.pg
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@
# Problem from Calculus, multi-variable, Hughes-Hallett et al.,
# originally from 5ed (with updates)
# WeBWorK problem written by Gavin LaRose, <glarose@umich.edu>

DOCUMENT();

loadMacros(
"PGstandard.pl",
"PGchoicemacros.pl",
"MathObjects.pl",
"PGgraphmacros.pl",
"PGcourse.pl"
);

## Tagged by glr 05/12/09


## DBsubject(Calculus - multivariable)
## DBchapter(Concepts for multivariable functions)
## DBsection(Traces, contours, and level sets)
Expand Down Expand Up @@ -31,105 +43,123 @@
## Textbook tags
## HHChapter1('Functions of Several Variables')

DOCUMENT();
$refreshCachedImages = 1;

loadMacros('PGstandard.pl', 'PGML.pl', 'plots.pl', 'PGcourse.pl');
Context("Numeric");
$showPartialCorrectAnswers = 1;

## the cost of a cd
$p = random(6, 10, 2);
$p = random(6,10,2);
## the cost of a dvd
$q = $p + random(2, 6, 2);
$q = $p + random(2,6,2);

$p = 10;
$q = 14;

## then the revenue is given by
## r = p c + q d,
## so the contour lines are the lines
## d = r/q - (p/q) c

$plot = Plot(
xmin => 0,
xmax => 400,
ymin => 0,
ymax => 400,
xtick_delta => 100,
xminor => 1,
ytick_delta => 100,
yminor => 1,
xlabel => '\(c\)',
ylabel => '\(d\)',
aria_label => 'The revenue based on number of CDs and DVDs sold',
axes_on_top => 1,
);

for ($i = 1; $i < 9; $i++) {
$r = 1000 * $i;
$plot->add_function(
"($r - $p*x)/($q)", 'x', 0, $r / $p,
color => 'blue',
weight => 2
);
$y1 = $r / ($p + $q);
$plot->add_label($y1 + 20, $y1 + 10, label => "$r", color => 'blue');
## d = r/q - (p/q) c
$gr = init_graph(0,0,400,400, axes=>[0,0], grid=>[8,8], size=>[300,300]);
$gr->lb('reset');
foreach my $v ( 100, 200, 300, 400 ) {
$gr->lb( new Label( $v, 0, "$v", 'black', 'right', 'bottom' ) );
$gr->lb( new Label( 0, $v, "$v", 'black', 'left', 'top' ) );
}
$gr->lb( new Label( 350, 0, "c", 'black', 'right', 'bottom' ) );
$gr->lb( new Label( 0, 350, " d", 'black', 'left', 'top' ) );

## nice intersection points are given by
%rpoints = (
6 => {
8 => [ [ 200, 100, 2000 ], [ 100, 300, 3000 ] ],
10 => [ [ 250, 50, 2000 ], [ 250, 150, 3000 ] ],
12 => [ [ 100, 200, 3000 ], [ 200, 150, 3000 ] ]
},
8 => {
10 => [ [ 250, 100, 3000 ], [ 250, 200, 4000 ] ],
12 => [ [ 100, 100, 2000 ], [ 100, 350, 5000 ] ],
14 => [ [ 200, 100, 3000 ], [ 100, 300, 5000 ] ]
},
10 => {
12 => [ [ 100, 250, 4000 ], [ 200, 250, 5000 ] ],
14 => [ [ 150, 250, 5000 ], [ 250, 250, 6000 ] ],
16 => [ [ 100, 250, 5000 ], [ 200, 250, 6000 ] ]
}
);
for ( my $i=1; $i<9; $i++ ) {
my $r = 1000*$i;
add_functions( $gr, "($r - $p*x)/$q for x in <0,400> using color:" .
"blue and weight:2" );

($c0, $d0, $r0) = @{ $rpoints{$p}->{$q}->[0] };
($c1, $d1, $r1) = @{ $rpoints{$p}->{$q}->[1] };
## put the contour label on the line y=x
my $y1 = $r/($p+$q);
$gr->lb( new Label( $y1, $y1, "$r", 'black', 'right', 'bottom' ) );
}
$grAlt = "A contour plot with parallel lines going down and to the right.";
$grDescr = "A graph where the horizontal axis is labelled as c, and the vertical axis is labelled as d. On the graph are eight parallel horizontal lines starting at the vertical axis and travelling down and right until they meet the horizontal axis. The lowest such line is labelled with 1000, and each higher line has a label that is 1000 greater than the one below. The line that is labelled $r0 passes through the point ($c0,$d0). The line that is labelled $r1 passes through the point ($c1,$d1).";

$alt_text =
"A graph where the horizontal axis is labelled as c, and the vertical axis is labelled as d. On the graph are eight parallel horizontal lines starting at the vertical axis and travelling down and right until they meet the horizontal axis. The lowest such line is labelled with 1000, and each higher line has a label that is 1000 greater than the one below. The line that is labelled $r0 passes through the point ($c0,$d0). The line that is labelled $r1 passes through the point ($c1,$d1).";
Context()->texStrings;
TEXT(beginproblem());
BEGIN_TEXT

BEGIN_PGML
A store sells CDs at one price and DVDs at another
price. The figure below shows the revenue (in dollars)
of the music store as a function of the number, [` c `],
of CDs and the number, [` d `], of DVDs that it sells. The
of the music store as a function of the number, \( c \),
of CDs and the number, \( d \), of DVDs that it sells. The
values of the revenue are shown on each line.

>> [! $alt_text !]{$plot}{300} <<

_(Hint: for this problem there are many possible ways to
$PAR
$BCENTER
\{ image( insertGraph( $gr ), tex_size=>350, height=>300, width=>300,
alt=>$grAlt, long_description=>$grDescr) \}

$ECENTER
$PAR
${BITALIC}(Hint: for this problem there are many possible ways to
estimate the requisite values; you should be able to find information
from the figure that allows you to give an answer that is essentially
exact.)_
exact.)$EITALIC
$PAR
${BBOLD}(a)$EBOLD
What is the price of a CD? \{ ans_rule(25) \} dollars
$BR
${BBOLD}(b)$EBOLD
What is the price of a DVD? \{ ans_rule(25) \} dollars

a) What is the price of a CD? [_]{$p}{5} dollars
b) What is the price of a DVD? [_]{$q}{5} dollars
END_PGML

BEGIN_PGML_SOLUTION
The revenue function, [`R`], is linear and so we may write it as:
[```
END_TEXT
Context()->normalStrings;

ANS(Compute("$p")->cmp() );
ANS(Compute("$q")->cmp() );

## nice intersection points are given by
%rpoints = ( 6 => { 8 => [ [ 200, 100, 2000 ],
[ 100, 300, 3000 ] ],
10 => [ [ 250, 50, 2000 ],
[ 250, 150, 3000 ] ],
12 => [ [ 100, 200, 3000 ],
[ 200, 150, 3000 ] ] },
8 => { 10 => [ [ 250, 100, 3000 ],
[ 250, 200, 4000 ] ],
12 => [ [ 100, 100, 2000 ],
[ 100, 350, 5000 ] ],
14 => [ [ 200, 100, 3000 ],
[ 100, 300, 5000 ] ] },
10 => { 12 => [ [ 100, 250, 4000 ],
[ 200, 250, 5000 ] ],
14 => [ [ 150, 250, 5000 ],
[ 250, 250, 6000 ] ] } );
($c0, $d0, $r0) = @{$rpoints{$p}->{$q}->[0]};
($c1, $d1, $r1) = @{$rpoints{$p}->{$q}->[1]};

Context()->texStrings;
SOLUTION(EV3(<<'END_SOLUTION'));
$PAR SOLUTION $PAR


The revenue
function, \(R\), is linear and so we may write it as:
\[
R = (p_1)c + (p_2)d
```]
where [`p_1`] is the price of CDs and [`p_2`] is the price of DVDs, in
\]
where \(p_1\) is the price of CDs and \(p_2\) is the price of DVDs, in
dollars.
From the diagram, we can pick two points, such as [`c = [$c0]`], [`d=[$d0]`]
on the contour [`R=[$r0]`], and [`c = [$c1]`], [`d = [$d1]`] on the contour
[`R = [$r1]`]. These
From the diagram, we can pick two points, such as \(c = $c0\), \(d=$d0\)
on the contour \(R=$r0\), and \(c = $c1\), \(d = $d1\) on the contour
\(R = $r1\). These
points give the following system of linear equations:
[```
[$r0] = [$c0] p_1 + [$d0] p_2, \mbox{ and }
[$r1] = [$c1] p_1 + [$d1] p_2.
```]
Solving gives [`p_1 = [$p]`] dollars and [`p_2 = [$q]`] dollars.
END_PGML_SOLUTION
\[
$r0 = $c0 p_1 + $d0 p_2, \mbox{ and }
$r1 = $c1 p_1 + $d1 p_2.
\]
Solving gives \(p_1 = $p\) dollars and \(p_2 = $q\) dollars.

END_SOLUTION
Context()->normalStrings;


;
ENDDOCUMENT();
7 changes: 4 additions & 3 deletions OpenProblemLibrary/Michigan/Chap14Sec1/Q09.pg
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ $fy[3] = PopUp( [ "?", "positive", "negative" ],

## we'll ask for three of these
@ask = PGsort( sub { $_[0] < $_[1] }, NchooseK( 4, 3 ) );

$grAlt = "A contour plot with circles centered at the origin and the radius of successive circles shrinking.";
$grDescr = "A plot of circles centered at the origin. The smallest circle is labeled 6 and successively larger circles are labeled 9, 12, 15,18,21, 24. The difference in radius between successive circles is decreasing. A point labeled P is on the contour labeled 12 and in the first quadrant. A point labeled Q is on the contour labeled 12 and is in the fourth quadrant. A point labeled S is on the contour labeled 12 and in the second quadrant. A point labeled R is on the contour labeled 12 and is in the third quadrant.";
Context()->texStrings;
TEXT(beginproblem());
BEGIN_TEXT
Expand All @@ -176,7 +177,7 @@ positive \(x\) value and negative \(y\), etc.)
$PAR
$BCENTER
\{ image( insertGraph( $contour ), tex_size=>300, height=>300, width=>300,
extra_html_tags=>'alt="' . $grdesc . '"' ) \}
alt=>$grAlt, long_description=>$grDescr) \}
$ECENTER
$PAR
${BBOLD}(a)$EBOLD
Expand Down Expand Up @@ -256,4 +257,4 @@ Context()->normalStrings;


;
ENDDOCUMENT();
ENDDOCUMENT();
9 changes: 5 additions & 4 deletions OpenProblemLibrary/Michigan/Chap14Sec1/Q26.pg
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ $hw22 = Compute( "($happ{$t2}->{$w2a} - $happ{$t2}->{$w2})/0.1" );
$hw22a = Compute( "($happ{$t2}->{$w2} - $happ{$t2}->{$w2b})/0.1" );
$hw22b = Compute( "($happ{$t2}->{$w2a} - $happ{$t2}->{$w2b})/0.2" );

$grAlt = "A contour map with four level curves";
$grDescr = "A graph showing \(H(T,0.1), H(T,0.2), H(T,0.3), H(T,0.4)\), which are decreasing functions of \(T\), each at a higher value of \(H\). As \(H\) increases, the associated level curve is more concave up.";

Context()->texStrings;
TEXT(beginproblem());
BEGIN_TEXT
Expand All @@ -146,9 +149,7 @@ diagram, but shows cross-sections of \( H \) with \( w \) fixed at
$PAR
$BCENTER
\{ image( insertGraph( $gr ), tex_size=>250, height=>350, width=>350,
extra_html_tags=>'alt="graph showing H(T,0.1), H(T,0.2), ' .
'H(T,0.3) and H(T,0.4), which are decresaing functions ' .
'of T, each at a higher value of H."' ) \}
alt=>$grAlt, long_description=>$grDescr) \}
$ECENTER
$PAR
${BBOLD}(a)$EBOLD
Expand Down Expand Up @@ -295,4 +296,4 @@ Context()->normalStrings;


;
ENDDOCUMENT();
ENDDOCUMENT();
6 changes: 4 additions & 2 deletions OpenProblemLibrary/Michigan/Chap16Sec1/Q03.pg
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ $tol = ($over - $under)/2;
$overTest = Compute( "($oversum)*2*2 - $tol" )->with( tolType=>'absolute', tolerance=>($tol+1) );
$underTest = Compute( "($undersum)*2*2 + $tol" )->with( tolType=>'absolute', tolerance=>($tol+1) );

$grAlt = "A contour plot of the function g";
$grDescr = "A contour plot with horizontal range from 5 yo 11 and vertical range from 2 to 8. There are five contours labeled 2, 3, 4, 5, and 6 that are hyperbolas with the labels increasing across the graphs being further up and to the right.";

Context()->texStrings;
TEXT(beginproblem());
BEGIN_TEXT
Expand All @@ -121,8 +124,7 @@ The figure below shows contours of \( g(x,y) \) on the region
$PAR
$BCENTER
\{ image( insertGraph( $gr ), height=>300, width=>300, tex_size=>300,
extra_html_tags=>'alt="contour graph showing the contours ' .
'of the function."' ) \}
alt=>$grAlt, long_description=>$grDescr) \}
$ECENTER
$PAR
Using \( \Delta x = \Delta y =2 \), find an overestimate and an
Expand Down
9 changes: 6 additions & 3 deletions OpenProblemLibrary/Michigan/Chap16Sec1/Q27.pg
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ $avgint = Compute( "($max + $min)/2" );
$avg = Compute( "($max + $min)/50" );
$tolval = ($max - $min)/50 + 0.1;

$grAlt = "A contour plot of the temperature in a 5 by 5 meter room";
$grDescr = "A contour plot with horizontal and vertical range from 0 to 5. There are ten contours labeled from 21 to 30 and the contours become more curved when moving away from the middle of the plot.";

Context()->texStrings;
TEXT(beginproblem());
BEGIN_TEXT
Expand All @@ -161,8 +164,8 @@ degrees C, in a 5 meter by 5 meter heated room.
$PAR
$BCENTER
\{ image( insertGraph( $gr ), height=>300, width=>300, tex_size=>300,
extra_html_tags=>'alt="contour graph showing the temperatures ' .
'in the room"' ) \}
alt=>$grAlt, long_description=>$grDescr) \}

$ECENTER
Using Riemann sums, estimate the average temperature in the room.
$BR
Expand Down Expand Up @@ -227,4 +230,4 @@ Context()->normalStrings;


;
ENDDOCUMENT();
ENDDOCUMENT();
9 changes: 6 additions & 3 deletions OpenProblemLibrary/Michigan/Chap16Sec4/Q07.pg
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ if( $whichSec < 3 ) {
}

@desc = ( "a rectangular region with diagonally opposite corners ($x0,$y0) " .
"and ($x1,y1).",
"and ($x1,$y1).",
"a sector of a circle of radius $r0 centered at the origin, with " .
"radial endpoints ($rcx0,$rcy0) and ($rcx1,$rcy1)." );

Expand Down Expand Up @@ -221,6 +221,8 @@ $chk[1] = MultiAnswer( Compute($sangles[$whichSec]->[0]),

@order = NchooseK(2,2);

$grAlt = "A wedge shaped region";
$grAlt2 = "A rectangular shaped region";

Context()->texStrings;
TEXT(beginproblem());
Expand All @@ -236,7 +238,8 @@ The region
$BR
$BCENTER
\{ image( insertGraph( $gr[$order[0]] ), tex_size=>250, height=>250,
width=>250, extra_html_tags=>'alt="' . $desc[$order[0]] . '"' ) \}
width=>250, alt=>$grAlt, long_description=>$desc[$order[0]]) \}

$ECENTER
With
\( a = \) \{ $chk[$order[0]]->ans_rule(5) \},
Expand All @@ -254,7 +257,7 @@ The region
$BR
$BCENTER
\{ image( insertGraph( $gr[$order[1]] ), tex_size=>250, height=>250,
width=>250, extra_html_tags=>'alt="' . $desc[$order[1]] . '"' ) \}
width=>250, alt=>$grAlt2, long_description=>$desc[$order[1]]) \}
$ECENTER
With
\( a = \) \{ $chk[$order[1]]->ans_rule(5) \},
Expand Down
9 changes: 4 additions & 5 deletions OpenProblemLibrary/Michigan/Chap17Sec5/Q25.pg
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ $param = MultiAnswer( $xst, $yst, $zst, $s0, $s1, $t0, $t1 )->with(
$vol = NumberWithUnits( "$n0*$po2*pi*(1 + 2*$rb*$rb)", "in^3" );
$volc = $n0*$po2*(1 + 2*$rb*$rb);

$grAlt = "A column that has a sinusoidal radius";
$grDescr = "figure of a column with a vertically varying outside radius. the maximum radius is r0 inches, the vertical distance between maximum radii is a0 inches, and the difference between the minimum and maximum radii is 2 inches.";

Context()->texStrings;
TEXT(beginproblem());
BEGIN_TEXT
Expand All @@ -114,11 +117,7 @@ that its profile is sinusoidal as shown in the figure below.
$BR
$BCENTER
\{ image( 'q15f1.png', tex_size=>200, height=>432, width=>173,
extra_html_tags=>'alt="figure of a column with a ' .
'vertically varying outside radius. the maximum radius ' .
'is r0 inches, the vertical distance between maximum ' .
'radii is a0 inches, and the difference between the ' .
'minimum and maximum radii is 2 inches."' ) \}
alt=>$grAlt, long_description=>$grDescr) \}
$ECENTER
$BR
In this figure, \(r_0 = $r1\) inches and \(a_0 = $p0\) inches.
Expand Down
Loading