Plotting lg with STACK fails

Plotting lg with STACK fails

by Stefan Lörcks -
Number of replies: 2

Dear,

we had a problem plotting the logarithm to base 10. While

`@plot([ln(x)], [x, -.5,5])@`

gives a nice plot of the natural logarithm

`@plot([lg(x)], [x, -.5,5])@`

results in a graphic containing the text:

'STACK auto-generated plot of [logbase(x,10)] with parameters x,-0.5,5'

The graph is not plotted. I'm not sure, if STACK actually tries to plot 'logbase', which is not a maxima command, is it?

This problem occured using STACK 3.5.7 (2017060600), Maxima 5.39 (SBCL) and moodle 3.2.2 on an ubuntu 16.04 system.

Can anyone reproduce this behaviour and confirm it's a bug?

Best,
Stefan

Average of ratings: -
In reply to Stefan Lörcks

Re: Plotting lg with STACK fails

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Stefan,

Thank you very much indeed for reporting this bug.  I'm very sorry we omitted to anticipate this when we introduce the "logbase" functionality.  This is one consequence of having "ephemeral" forms which represent by don't simplify.  At some point, the lack of simplification comes back to get you...

A fix is here:

https://github.com/maths/moodle-qtype_stack/issues/298

I've added this to the "equiv_input" branch  as I'm in the final testing phases of this code for a major new release.  I can't see a reason why this small change can't be added to your code individually if you really need it immediately.

An immediate workaround should be to use

`@plot(ev(lg(x), logbase=logbasesimp), [x, -.5,5])@`

Thanks again for the report, much appreciated.

Chris


In reply to Christopher Sangwin

Re: Plotting lg with STACK fails

by Stefan Lörcks -

Chris,

just realised in shock that I didn't answer your post. I'm sorry. Even more as it was most helpful. As you suggested I added the few lines of code, which solved the problem immediately. Thanks for your fast reply! And by the way: Thanks for STACK in general. It is a great tool! smile

Best,

Stefan