Second-order derivatives

7 views
Skip to first unread message

Adam Povey

unread,
Apr 18, 2024, 5:08:54 AMApr 18
to Numbas Users
Apologies if I have missed something: what is the syntax to make d^2y/dx^2 the answer to a question? (In this case, it's part of a derivation of a wave equation.)

At the moment, we use `d^2 y/dx^2` with multi-letter names. This both looks bad in the render and means that `d` can't be a variable elsewhere in the expression. It does, though, work.

In other parts of the course, we use `diff:y/diff:x` to represent first-order derivatives but the syntax for : replacement doesn't permit `diff:^2y`.

I see that `diff(y,x,2)` does render correctly but, when evaluating the expression, it instead calls the diff function that differentiates expressions so the call fails as y isn't an expression.

Thanks,
Adam

Christian Lawson-Perfect

unread,
Apr 18, 2024, 5:11:35 AMApr 18
to numbas...@googlegroups.com
I don't think we've done this before, so we have to make a decision!
I think that `diff(y,x,2)` makes the most sense, although it doesn't match what a student would write on paper. To avoid evaluating the diff function, I think you'd have to change the marking algorithm to only do pattern matching, and skip the numerical comparison.

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/9d6e82e0-a8d2-4de6-b1a0-4ecd0134b0c5n%40googlegroups.com.

Adam Povey

unread,
Apr 18, 2024, 5:54:51 AMApr 18
to Numbas Users
Right, I shall go work out who marking algorithms work so I can work out which bit to get rid of.
Adam

Christian Lawson-Perfect

unread,
Apr 18, 2024, 6:23:14 AMApr 18
to numbas...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages