Subject: [LON-CAPA-dev] Installing Modules for LON-CAPA

From: "GARRETT, DONNELL MAZON" <[email-masked]>
Date: Mon, 26 Sep 2005 12:29:34 -0400

Hi

I've emailed Gerd Kortemeyer a few times about maybe trying to extend
LON-CAPA's math capabilities.  He emailed me back and said that LON-CAPA
does in fact have the concept of a library so that new
functions/subroutines can be added.  This is music to my ears, as I told
him.

Last week after a little prodding the Electrical Engineering department
got their own CAPA server off the ground and working.  Since then, I've
been playing around with making different types of problems and I think
it's awesome.

Now, this is what I'm trying to do.  We want to solve simultaneous
equations.  For example, if:

x + y = 10
x - y = 2

We would want to be able to put them into a matrix and solve for x and
y.  This example is very simple, but later on when we get into trying to
solve simultaneous equations with circuits with a lot of different
elements, we are going to need some way to solve matrices.  Also, since
the script for problems is basically just Perl, we could write out how
to solve for these equations every time, but that would be a pain for
someone who is not familiar with Perl at all (which will be anyone
except me here in the EE department).

What I'm really looking for is for how to add things to this library.  I
did some poking around on the internet, and I found that there is a
module called Math::Cephes:Matrix on CPAN
(http://search.cpan.org/~rkobes/Math-Cephes-0.42/lib/Math/Cephes/Matrix.
pm).  It solves for simultaneous equations automatically and also gives
a lot of other useful matrix type features.  Likewise, there is a
Math::Cephes:Complex on CPAN
(http://search.cpan.org/~rkobes/Math-Cephes-0.42/lib/Math/Cephes/Complex
.pm) that deals with complex numbers, something we'd also like to
calculate later on.  It'd be great if we could get these two modules so
that when we write the script we can access functions/subroutines from
these modules and make better problems.  Also, I noticed that in one of
your documents
(http://s10.lite.msu.edu/adm/help/Script_Functions.hlp#Script_Functions)
that you "support" a few statistical functions from Math::Cephes.  That
is great.  If you are already using it, then it must be possible to
obtain usage of the other parts of Math::Cephes.  

That's what I'm trying to do..  Just figure out how we can use the perl
script in problems to take the randomly generated inputs and use
matrix/complex number functions and produce the outputs/answers based on
the inputs.  

Thanks for helping me out,
Donnell

---

From: Guy Albertelli II <[email-masked]>
Date: Mon, 26 Sep 2005 14:21:18 -0400 (EDT)

Hi Donnell,

> functions/subroutines can be added.  This is music to my ears, as I told

Gerd was referring to the .libray file in this case (as opposed to the
loading of new chunks of CPAN routines)

The .libray files are meant to be used as a place to contain common
Perl code for reuse in .problems, through the use of <import>

So to use this idea in you desires, you would in fact creat a .library
file taht contains the definitions of a variety of routines to handle
you needs (For example creat your own matrix/complex handling
routines.)

I suspect the sound of that won't make you very happy.

> Math::Cephes:Complex on CPAN

(and additional set of routines could be Math::Complex with are part
of the standard perl install)

There is now way for instructor to 'use' an arbitrary CPAN module.

We have specifically not allowed this for a few reasons
1) each CPAN module increases the static size of each apache child,
thus increasing the amount of memory need for Lon-CAPA to run, (and as
each Apache child right now hovers in the 80-100 meg range continued
bloat here could start causing real issues.)

2) we would like for every homework problem to be able to run on any
machine in the network, and when a homework requires new softare to be
installed on the server in order to run, we would start having issues
here.

That said, we aren't completely against adding new CPAN modules, we
just need to make sure that they are worth the costs they'll impose.

I suspect we will need to add a Complex library soon, we have had
several calls for that, (I'm leaning towards Math::Complex) and as it
looks like we are installing the Math::Cephes::Matrix routines, we
likely could add those without much issue.

-- 
[email-masked]   0-7-2-1-27,137

---

From: Gerd Kortemeyer <[email-masked]>
Date: Mon, 26 Sep 2005 15:26:10 -0400

Hi Donnell,

> equations.  For example, if:

Frankly, I would do this the other way around - much less computing  
intensive.

Determine x and y randomly. Then make your equations.

- Gerd.