Hi,

I've tracked down the problem you are having with ode2.

Actually, STACK has a "pre-parser" to spot common syntax errors students make, and tries to put in missing *'s. If a student types "2(x+1)" STACK assumes this is an implied multiplication, and inserts a multiplication sign. Maple (9.5) takes input "2(x+1);" and assumes "2" is a constant function to which "x+1" is being applied, and so returns "2". Deeply mystifying to all students! I wrote about syntax and CAA with Phil Ramsden

C. J. Sangwin and P. Ramsden. Linear syntax for communicating elementary mathematics. Journal of Symbolic Computation, 42(9):902{934, 2007. DOI:10.1016/j.jsc.2007.07.002.

The pre-parser is causing the difficulty. STACK turns "ode2(a,b,c)" into "ode2*(a,b,c)" which is problematic.

A further problem is that ode2 returns a "constant of integration" %c.

STACK variables are not permitted to contain the "%" character, because a student or teacher might use this to refer to a previous line in the MAXIMA session, and this will cause no end of other problems.

So, I will have to give these issues some thought and fix them.

Actually, I think using ode2 may be problematic. When randomly generating questions we could easily generate an ODE which cannot be solved in closed form. It is much better when setting any kinds of STACK question to start with the method, and work backwards to generate the question. This ensures the question remains valid over a whole range of parameters.

Lastly, when marking this kind of question, I suggest you take the student's answer and substitute this into the ODE. The student's answer should satisfy the equation. Just "looking like the teacher's answer" isn't as robust. How else does the teacher avoid the problem of knowing which letter the student used to represent an arbitrary constant?

E.g. in Maxima code

ode:x^2*'diff(y,x) + 3*y*x = sin(x)/x; ans: ( c - cos(x))/x^3; /* The student's (correct) answer */ sa1:subst(y=ans,ode); sa2:ev(sa1,nouns); sa3:rullratsimp(expand(sa2));

sa1, sa2 and sa2 can be used as part of the feedback when a student doesn't get the right answer.

An example STACK question is attached. Further tests are needed to ensure the student's solution is non-trivial, satisfies any initial conditions, or is suitably general. I've not included these in this example.

If you have some questions you'd like me to work on that would be a great help. I'd be happy to work on these and post some demonstration ODE questions. A former PhD student of mine, Eligio Cerval-Pena, wrote a very interesting chapter of his thesis on generating ODE questions randomly. There are some quite interesting mathematical problems here of defining the parameter ranges over which a method remains valid, or which generate "nice" questions in various well defined senses.

Thank you for asking this question. ODE questions provide some very nice examples of what STACK is designed to do.

I hope this helps.

Chris