WeBWorK Problems

ERROR: non-zero status 256: Bad file descriptor

ERROR: non-zero status 256: Bad file descriptor

by Ron Vaillancourt -
Number of replies: 0

This problem viewing the equation in images format produces the following display and errors. Any help is greatly appreciated !

## DESCRIPTION
##   Approximate an Integral Using Riemann Sums
## ENDDESCRIPTION

## KEYWORDS('Definite', 'Integral', 'Approximate', 'Riemann Sum')
## Tagged by nhamblet

## DBsubject('Calculus')
## DBchapter('Techniques of Integration')
## DBsection('Approximate Integration')
## Date('')
## Author('')
## Institution('ASU')
## TitleText1('')
## EditionText1('')
## AuthorText1('')
## Section1('')
## Problem1('')

DOCUMENT();        # This should be the first executable line in the problem.

loadMacros(
"PG.pl",
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl",
"PGauxiliaryFunctions.pl"
);

TEXT(beginproblem());
$showPartialCorrectAnswers = 1;

$a = random(1,5,1);      ## left endpoint
$dx = random(1,2,1);        ## delta x
$n = random(3,4,1);
$b = $a + $n*$dx;            ## right endpoint, n subdivisions

$c = random(2,4,1);

sub myfunc {
    $x = shift @_;
    return $x**2 + $c*$x;
}

BEGIN_TEXT

Estimate the area under the graph of \( f(x)= x^2 + $c x \) on the interval \( [$a, $b] \)
using \( $n \) approximating rectangles and left endpoints.

$BR \{ans_rule(30)\}

END_TEXT

if ($n == 3) {
 $ans = $dx* (myfunc($a)+myfunc($a+$dx)+myfunc($a+2*$dx));
}

if ($n == 4) {
 $ans = $dx* (myfunc($a)+myfunc($a+$dx)+myfunc($a+2*$dx)+myfunc($a+3*$dx));
}

ANS(num_cmp($ans));

ENDDOCUMENT();        # This should be the last executable line in the problem.

testcourse-1: Problem 1

This set is visible to students.

(1 pt) settestcourse-1/leftsum_1.pg
Estimate the area under the graph of f(x)= x^2 + 2 x on the interval [1, 5] using 4 approximating rectangles and left endpoints.

Edit this problem

View equations as:    
plainText
images
jsMath
LaTeXMathML

  • cd /opt/webwork/webwork2/tmp/ImageGenerator.cg5342XM && /bin/mv /opt/webwork/webwork2/tmp/ImageGenerator.cg5342XM/equation1.png /opt/webwork/webwork2/htdocs/tmp/equations/6f/5e1a181d257fd53e477b73198f27661.png returned non-zero status 256: Bad file descriptor at /opt/webwork/pg/lib/WeBWorK/PG/ImageGenerator.pm line 401.
  • cd /opt/webwork/webwork2/tmp/ImageGenerator.cg5342XM && /bin/mv /opt/webwork/webwork2/tmp/ImageGenerator.cg5342XM/equation3.png /opt/webwork/webwork2/htdocs/tmp/equations/70/1184bb64ba9bb2d7bb89f6d7c90b481.png returned non-zero status 256: Bad file descriptor at /opt/webwork/pg/lib/WeBWorK/PG/ImageGenerator.pm line 401.
  • cd /opt/webwork/webwork2/tmp/ImageGenerator.cg5342XM && /bin/mv /opt/webwork/webwork2/tmp/ImageGenerator.cg5342XM/equation2.png /opt/webwork/webwork2/htdocs/tmp/equations/7f/731359622cd87aa269961264232bfe1.png returned non-zero status 256: Bad file descriptor at /opt/webwork/pg/lib/WeBWorK/PG/ImageGenerator.pm line 401.