Matlab

Re: Octave Symbolic Package

by David Forehand -
Number of replies: 10

Hi Richard,

Thanks very much for your very quick reply - that is fantastic!  Our IT people have installed it on the Jobe server used by our demo site, so I will test it out over the next few days.

All the Best and thanks very much again,

David

In reply to David Forehand

Re: Octave Symbolic Package

by asa czylabson -
dear David!
i would like to ask You about the octave+symbolic+coderunner constellation. On our
server, even for the simplest function (that returns sym(1)), I always get
a ***Run error*** message in the output window, together with a signs of a python prompt (>>>)
best wishes, Csaba
In reply to asa czylabson

Re: Octave Symbolic Package

by Richard Lobb -
If you're seeing a python prompt, this must be a question that is scripted in python, which is then executing octave + the symbolic package. This is going to exceed the default memory limit. So the first thing to try is to set the MemLimit to 0 to turn off memory limit checks. [Click customise, then open Advanced Customisation to find that field]. If that fixes the problem, experiment to find a reasonable memory limit.

If that doesn't solve the problem, please post an xml export of your failing question, plus a screen dump of the output.
In reply to Richard Lobb

Re: Octave Symbolic Package

by asa czylabson -
dear Richard!
thank for your kind reply.
i started to use coderunner in this semester, honestly, i have only a vague understanding of the system, but i managed to set a few questions, by modifying a very simple example found here or elsewhere on the net.
i am very enjoying setting the through the coderunner.
it is the first issue that i am unable to solve.

the scenario is the following:
type octave_function, symbolic for octave and sympy for python is installed

when i define the answer involving symbolic computation (not a real problem):
pkg load symbolic;
sympref('quiet',1);
syms f x;
f(x)=x^2;
disp(diff(f,x));

and i save this draft version, (w/ validate on save checked), then i see the correct result
(computed by octave) with the aforementioned 'run error' and a kind of python prompt.
i attached the screenshot and the xml.

(i suspect some communication error between python2(numpy) and octave(symbolic), that is unrelated
to the coderunner, but currently no sympy under python3 on the server, so i cannot test it.)

best wishes, Csaba




Attachment crhiba.png
In reply to asa czylabson

Re: Octave Symbolic Package

by David Forehand -
Hi Csaba,
Apologies for coming into this conversation late. With the great help of Richard last year, I managed to get the symbolic Octave package working with CodeRunner. I have ran your xml file and it seems to work OK for me. See the screenshot below. Of course, your code fails the first test because you don’t have an “Expected output” in your first test case. You also don’t have a semicolon after “diff(f,x)”, and so the output “2.x” is seen in the first test. I’m attaching a test xml question that I made. Basically, I don’t want my students to know that I am using Octave. I want them to think that they are using Matlab because that is what I am teaching them. I “customise” the question and put the “pkg load symbolic” in the Template. I have a first test which captures the initial output “Symbolic pkg v2.8.0: Python communication link active, SymPy v1.5.1.” and then I can carry on with normal tests. I’ve filled the “answer” box with symbolic Matlab functions from my course - just to see if they also work with the symbolic Octave package and in CodeRunner. I’m by no means an expert with CodeRunner but I’ve just managed to find a way that works for my needs. Richard has been a great help throughout. I’m sorry, I’m not sure what is the problem with your symbolic Octave installation in CodeRunner? Richard is much better for that than me.
All the Best,
David


In reply to David Forehand

Re: Octave Symbolic Package

by asa czylabson -
dear David,
Thanks for the guides!
Perhaps my problem is related to our jobe server's setup (for example "version conflict" between octave,symbolic,python,sympy...), because the xml that You provided gives the same
'run error + python prompt'
error, even after removing the default memory+cpu limits, as proposed by Richard.

Anyway, it is a good news, that it will work with appropriate jobe server settings.

best wishes, Csaba
In reply to Richard Lobb

Re: Octave Symbolic Package

by asa czylabson -
dear Richard,

The problem is partially solved. Octave/symbolic was unable to communicate (ipc) via 'popen2' with python. I do not know the why's, but setting it to 'system', the symbolic package started to work both with py2 and py3. (But it is inredibly slow. :-( )

all the best, Csaba
In reply to asa czylabson

Re: Octave Symbolic Package

by Richard Lobb -

Hi Csaba, it sounds like you're making progress. I've never used the symbolic package in Octave, so I've no ideas about speed. David maybe able to help you there. Perhaps you could post an example of a question you're asking and the time it's taking for David or other users to get a measure of what you mean by "incredibly slow"?

I'm afraid I can't help with the problems you're having with Python either. I only just now discovered that the symbolic package for Octave uses Python - until then I was puzzled as to why Python was involved at all.  Since I no longer teach Octave or Matlab, and have never used symbolic algebra packages, I'm not the right person to advise. But it sounds like the problems are with the configuration of the Jobe server rather than being directly CodeRunner related.

Good luck with your experimentation :-)
In reply to Richard Lobb

Re: Octave Symbolic Package

by asa czylabson -
dear Richard,

it is slow because - in my case - octave communicate with python not through the default 'popen2' interface but by some fallback way.
It is slow, as mentioned in the documentation of octave symbolics, not because of coderunner, but because of some octave/python config error in our jobe server.
So, do not bother w/ this problem more :-)

all the best, Csaba
In reply to Richard Lobb

Re: Octave Symbolic Package

by asa czylabson -
dear Richard,
i set up coderunner/moodle system on my desktop machine (using Your docker image and bitnami's moodle VM). everything works fine w/ the octave symbolic! it is very convenient to have locally a complete system to test with.
Thanks again for Your docker "stuff"!

best wishes, Csaba