Context()->functions->disable("abs","sqrt");

The cut-off date for posting to this forum is reached so you can no longer post to it.

Hi Joel,

Your question is on stuff that we will cover in detail in the next two weeks. Yes, you can do things like disable (or undefine or redefine) certain functions in webwork. One way to disable a function is described on the wiki

http://webwork.maa.org/wiki/DisableFunctions

For example, you can disable the absolute value and the square root using

Context()->functions->disable("abs","sqrt");

In your case, you would probably want to disable sine, tangent, and all the co- functions except for cosine, which could be accomplished with

### begin code snippet

Context("Numeric")->variables->are(t=>"Real");

Context()->functions->disable("sin","tan","csc","sec","cot");

$A = ??; # replace ?? by some value

$F = ??; # replace ?? by some value

$phi = ??; # replace ?? by some value

$answer = Compute("$A * cos(2*pi* $F * t + $phi)");

### end code snippet

If you write a question like this, make sure to include instructions for the students in the text of the problem that says something like "Enter your answer using a single cosine function and no other trig functions." or "Enter your answer in the form \( A \cos(\omega t + \phi) \) for some constants \( A \), \( \omega \), and \( \phi \)."

Best regards,

Paul Pearson

You are currently using guest access (Log in)