## Forum archive 2000-2006

### Danny Glin - Parameters in fun_cmp ### Danny Glin - Parameters in fun_cmp

by Arnold Pizer -
Number of replies: 0 Parameters in fun_cmp topic started 7/8/2003; 4:47:50 PMlast post 7/9/2003; 1:15:49 PM Danny Glin - Parameters in fun_cmp 7/8/2003; 4:47:50 PM (reads: 890, responses: 3) We've been working lately on setting up a differential equations course to run on webwork at the University of Calgary. I've been looking at some of the existing problems to get ideas of how to check implicit solutions in two variables. This has been done in some instances by having the students set their relations equal to zero or a constant. In this case, fun_cmp is then called to check a two variable function, which includes a "params=>" option, in order to account for the fact answers could be scaled. An example of such a problem is setDiffEQ3Separable/ur_de_3_2.pg The problem that arises is that the system does not differentiate if the value of the parameter is zero, so, for example, in calling the answer evaluator in a situation such as: ANS( fun_cmp("k($ans) +c", var=>['x','y'], params=>['k','c'] ) ); where$ans contains a correct two variable function, a student can enter 0 (or any number) and get full credit, as the system reads this as k=0. I'm wondering if anyone has any ideas of a way to check a function that can be scaled by a constant factor other than zero. Is there a way to preclude a certain value of the parameter, or even to preclude a certain answer? Danny Glin University of Calgary <| Post or View Comments |> John Jones - Re: Parameters in fun_cmp 7/8/2003; 6:22:12 PM (reads: 1085, responses: 0) Hi, I work around this problem with the "partial credit answer evaluator". The idea is that it goes through a sequence of answer evalators until it hits one which says the answer is correct. The problem author gets to say how much credit that is worth, so   ANS( pc_evaluator([[ fun_cmp(0), 0], [fun_cmp("k($ans) +c",var=>['x','y'], params=>['k','c']])); would give 0 credit if the student answer matches the 0 function, otherwise you get the result of the comparison you really wanted. pc_evaluator is in PGasu.pl. If the syntax above does not work, you may need a new copy of that file from Rochester CVS. John PS When I first wrote pc_evaluator, I didn't really think it was going to be useful. Yet, this is not the first time it could be used to answer a question in this discussion area. <| Post or View Comments |> John Labute - Re: Parameters in fun_cmp 7/9/2003; 10:25:32 AM (reads: 1074, responses: 0) Hi Danny, he problem is more complicated than that as two solutions may not be affinely related. For example, (x^2+y^2)*$ans=0 is the same curve as $ans=0$. This happens often as different integrating factors can be found for the same problem. The only solution I have found is, for example, to select a problem where the answer is a polynomial so that I can specify to expresss the answer as a polynomial of a given degree. If you want to see an example, go to my webpage (www.math.mcgill.ca/labute) and go to the course MATH 325B where, via the assignments section, you will be led to the webwork site for the course. You can login as 'guest' with password 'guest'. In set3 you will find some examples. In view of John Jones' contribution, the answer evaluator can be improved. John Labute McGill University <| Post or View Comments |> John Jones - Re: Parameters in fun_cmp 7/9/2003; 1:15:49 PM (reads: 1077, responses: 0) Hi again, Another variation on this is to use equation_cmp (in extraAnswerEvaluators). You would need to dictate the type of equation as in John Labute's post for it to work properly, but it automatically guards against the 0=0 answer. On the plus side, it lets you ask for an equation which may be more natural for the problem. On the down side, the presence of answers which are whole equations may confuse some students (they might start entering equations where you just want functions). John <| Post or View Comments |>