[system] / trunk / pg / doc / MathObjects / README.pod Repository:
ViewVC logotype

View of /trunk/pg/doc/MathObjects/README.pod

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5539 - (download) (annotate)
Fri Sep 28 00:23:44 2007 UTC (12 years, 4 months ago) by sh002i
File size: 5123 byte(s)
converted basic mathobjects docs to POD

    1 =head1 NAME
    2 
    3 MathObjects - Object system for manipulating mathematics in PG.
    4 
    5 =head1 OVERVIEW
    6 
    7 This directory contains the documentation for a new
    8 mathematical-expression parser written in perl.  It was developed for
    9 use with the WeBWorK on-line homework system, but it can be used in
   10 any perl program.
   11 
   12 The goal was to process vector-valued expressions, but the parser was
   13 designed to be extensible, so that you could add your own functions,
   14 operators, and data types.  It is still a work in progress, but should
   15 provide a framework for building more sophisticated expression handling.
   16 
   17 Currenlty, the parser understands:
   18 
   19 =over
   20 
   21 =item * real and complex numbers,
   22 
   23 =item * points, vectors, and matrices (with real or complex entries)
   24 
   25 =item * arbitrary lists of elements
   26 
   27 =item * intervals and unions of intervals
   28 
   29 =item * predefined strings like 'infinity'
   30 
   31 =back
   32 
   33 Some other useful features are that you can write sin^2 x for (sin(x))^2
   34 and sin^-1 x for arcsin(x), and so on.
   35 
   36 Most of the documentation still needs to be written, but you can get some
   37 ideas from the samples in the problems and extensions directories, and by
   38 reading the files in this directory.
   39 
   40 =head1 INSTALLATION
   41 
   42 The parser should already be installed as part of the WeBWorK 2.1
   43 distribution, so you should not need to install it separately.  If you
   44 don't seem to have it installed, then it can be obtained from the
   45 Union CVS repository at
   46 http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/WeBWorKCVS
   47 
   48 The README file in that directory contains the installation instructions.
   49 
   50 =head1 SAMPLE FILES
   51 
   52 Sample problems are given in the problems and extensions directories.  Move
   53 these to the templates directory of a course where you want to test the
   54 Parser, and move the contents of the macros directory to that course's
   55 macros directory.
   56 
   57 Now try looking at these problems using the Library Browser.  Edit the
   58 source to see how they work, and to read the comments within the code
   59 itself.
   60 
   61 =head1 EXAMPLE FILES
   62 
   63 The 'problems' directory contains several examples that show how to use
   64 Parser within your problem files.
   65 
   66 =over
   67 
   68 =item problems/sample01.pg
   69 
   70 Uses the parser to make a string into a formula that you can
   71 evaluate and print in TeX form
   72 
   73 =item problems/sample02.pg
   74 
   75 Shows how to create formulas using perl's usual mathematical
   76 expressions rather than character strings.
   77 
   78 =item problems/sample03.pg
   79 
   80 Shows how to use the parser's differentiation abilities.
   81 
   82 =item problems/sample04.pg
   83 
   84 =item problems/sample05.pg
   85 
   86 Use the parser in conjunction with the graphics macros to generate
   87 function graphs on the fly.  These also show how to create a
   88 perl function to evaluate an expression.
   89 
   90 =item problems/sample06.pg
   91 
   92 Shows some simple use of vectors in a problem.
   93 
   94 =item problems/sample07.pg
   95 
   96 Example if using the build-in Real object and its answer
   97 checker
   98 
   99 =item problems/sample08.pg
  100 
  101 Uses complex numbers and the built-in checker
  102 
  103 =item problems/sample09.pg
  104 
  105 =item problems/sample10.pg
  106 
  107 Demonstrates points and vectors and their answer checkers
  108 
  109 =item problems/sample11.pg
  110 
  111 =item problems/sample12.pg
  112 
  113 Shows the answer checkers for intervals and unions.
  114 
  115 =item problems/sample13.pg
  116 
  117 =item problems/sample14.pg
  118 
  119 =item problems/sample15.pg
  120 
  121 Demonstrate various list checkers, including a check for the
  122 word 'NONE', which is a predefined string.
  123 
  124 =item problems/sample16.pg
  125 
  126 =item problems/sample17.pg
  127 
  128 =item problems/sample18.pg
  129 
  130 These show the multi-variable function checker in use (for
  131 functions of the form R->R, R^2->R and R->R^3).
  132 
  133 =item problems/sample19.pg
  134 
  135 Uses the function checker to implement a "constant" that can
  136 be used in formulas.
  137 
  138 =item problems/sample20.pg
  139 
  140 Shows how to use the parser's substitution abilities.
  141 
  142 =item problems/sample21.pg
  143 
  144 Checks for a list of points.
  145 
  146 =item problems/sample22.pg
  147 
  148 Shows how to provide named constants that the student can
  149 use in his answer.
  150 
  151 =back
  152 
  153 The 'examples' directory contains samples that show how to extend the
  154 parser to include your own functions, operators, and so on.  There are also
  155 some samples of how to call the methods available for Formula objects
  156 generated by the parser, and what some error messages look like.
  157 
  158 =over
  159 
  160 =item examples/1-function.pg
  161 
  162 Adds a single-variable function to the parsers list of functions.
  163 
  164 =item examples/2-function.pg
  165 
  166 Adds a two-variable function to the parser.
  167 
  168 =item examples/3-operator.pg
  169 
  170 Adds a binary operator to the parser.  (Unary operators are similar.)
  171 
  172 =item examples/4-list.pg
  173 
  174 Adds a new "list type" object.  In this case, it's really an
  175 operation [n,r] that returns n choose r.
  176 
  177 =item examples/5-list.pg
  178 
  179 Add a new "equality" operator that you can use to handle answers
  180 like "x+y=0".
  181 
  182 =item examples/6-precedence.pg
  183 
  184 Shows an experimental precedence setting that can be used to make
  185 sin 2x return sin(2x) rather than (sin(2))x.
  186 
  187 =item examples/7-context.pg
  188 
  189 Shows how to switch contexts (in this case, to complex and to vector
  190 contexts), and how this affects the parsing.
  191 
  192 =item examples/8-answer.pg
  193 
  194 Implements a simple vector-valued answer checker using the
  195 parser's computation and comparison ability.
  196 
  197 =back

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9