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

answer in required form

by Joel Trussell - Thursday, 12 June 2014, 11:59 AMNumber of replies: 1

In electrical engineering, we usually require answers involving sinusoidal functions to be written as a cosine with phase, e.g, v(t) = A*cos(2*pi*F*t + phi). Of course, the answer a*cos(2*pi*F*t) + b*sin(2*pi*F*t) will give the same numerical result (for proper a and b). Can I force the form of the answer to be in the cosine with phase form? I realize the I could ask specifically for the magnitude, frequency and phase, but for solutions of DE's with decaying exponential envelopes, this gives more information than I wish.

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

$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 \)."