From: Chris S. <san...@us...> - 2005-11-08 09:41:49
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6131/scripts/maxima Modified Files: initmaxima.php maximafun.php stackfun.php stackmaxima.mac Log Message: Changes to implement simp:false in the code. A major update. Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** stackmaxima.mac 20 Oct 2005 14:05:39 -0000 1.39 --- stackmaxima.mac 8 Nov 2005 09:41:40 -0000 1.40 *************** *** 108,133 **** /* The top level function */ ! rand(ex):=BLOCK( ! if (integerp(ex)) then RETURN(randnum(ex)), ! if (listp(ex)) then RETURN(randlist(ex)), ! if (floatnump(ex)) then RETURN(randfloat(ex)), ! if (matrixp(ex)) then RETURN(matrixmap(rand,ex)) ); [...1617 lines suppressed...] ) else ! block( val: "true", rawmk: String(0), *************** *** 1266,1269 **** ), ret: StackReturnOb(val, rawmk, ansnote, fb), ! RETURN(ret) ); --- 1293,1300 ---- ), ret: StackReturnOb(val, rawmk, ansnote, fb), ! return(ret) ); + + + /* Stack expects some output */ + print("[ Stack-Maxima started ]"); Index: maximafun.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/maximafun.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** maximafun.php 10 May 2005 19:45:49 -0000 1.5 --- maximafun.php 8 Nov 2005 09:41:40 -0000 1.6 *************** *** 2713,2717 **** $maxima_cmd['SIMP']['urls'][] = 'maxima_7.html#IDX188'; ! $maxima_cmd['SIMP']['use'] = 's'; $maxima_cmd['SIMPSUM']['urls'][] = 'maxima_7.html#IDX189'; --- 2713,2717 ---- $maxima_cmd['SIMP']['urls'][] = 'maxima_7.html#IDX188'; ! $maxima_cmd['SIMP']['use'] = 'ex'; $maxima_cmd['SIMPSUM']['urls'][] = 'maxima_7.html#IDX189'; Index: initmaxima.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/initmaxima.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** initmaxima.php 14 Jul 2005 17:46:59 -0000 1.6 --- initmaxima.php 8 Nov 2005 09:41:40 -0000 1.7 *************** *** 54,57 **** --- 54,58 ---- $tnA = ''; $gF = ''; + $fNE = ''; // Maxima's functions. *************** *** 61,73 **** if ( 's' == $vals['use']) { ! $sA .= ", '$fun' "; } if ( '' == $vals['use']) { ! $tnA .= ", '$fun' "; } if ( 'never' == $vals['use']) { ! $gF .= ", '$fun' "; } --- 62,79 ---- if ( 's' == $vals['use']) { ! $sA .= ", '$fun' "; ! } ! ! if ( 'ex' == $vals['use']) { ! $sA .= ", '$fun' "; ! $fNE .= ", '$fun' "; } if ( '' == $vals['use']) { ! $tnA .= ", '$fun' "; } if ( 'never' == $vals['use']) { ! $gF .= ", '$fun' "; } *************** *** 83,95 **** if ( 's' == $vals['use']) { ! $sA .= ", '$fun' "; } if ( '' == $vals['use']) { ! $tnA .= ", '$fun' "; } if ( 'never' == $vals['use']) { ! $gF .= ", '$fun' "; } --- 89,106 ---- if ( 's' == $vals['use']) { ! $sA .= ", '$fun' "; ! } ! ! if ( 'ex' == $vals['use']) { ! $sA .= ", '$fun' "; ! $fNE .= ", '$fun' "; } if ( '' == $vals['use']) { ! $tnA .= ", '$fun' "; } if ( 'never' == $vals['use']) { ! $gF .= ", '$fun' "; } *************** *** 99,102 **** --- 110,115 ---- } + // Exceptions: Maxima variable names which are allowed to be variable names as part of STACK. + *************** *** 104,110 **** // Three levels ! $globalForbid = "\$stack_cas['globalForbid'] = array(".substr($gF,1).");\n\n\n"; ! $teacherNotAllow = "\$stack_cas['teacherNotAllow'] = array(".substr($tnA,1).");\n\n\n"; ! $studentAllow = "\$stack_cas['studentAllow'] = array(".substr($sA,1).");\n\n\n"; // File header --- 117,125 ---- // Three levels ! $globalForbid = "\$stack_cas['globalForbid'] = array(".substr($gF,1).");\n\n\n"; ! $teacherNotAllow = "\$stack_cas['teacherNotAllow'] = array(".substr($tnA,1).");\n\n\n"; ! $studentAllow = "\$stack_cas['studentAllow'] = array(".substr($sA,1).");\n\n\n"; ! $functionNameExceptions = "\$stack_cas['functionNameExceptions'] = array(".substr($fNE,1).");\n\n\n"; ! // File header *************** *** 134,137 **** --- 149,153 ---- fwrite($fh,$teacherNotAllow); fwrite($fh,$studentAllow); + fwrite($fh,$functionNameExceptions); fwrite($fh,$filetail); fclose($fh); Index: stackfun.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackfun.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** stackfun.php 7 Oct 2005 06:26:38 -0000 1.2 --- stackfun.php 8 Nov 2005 09:41:40 -0000 1.3 *************** *** 98,101 **** --- 98,106 ---- $stack_cmd['simplify']['use'] = 's'; + $stack_cmd['divthru']['doc'] = 'This takes an algebraic fraction, eg <tt>(x^4-1)/(x+2)</tt> and divides through by the demoninator, to leave a polynomial and a proper fraction. Useful in feedback, or steps of a calculation.'; + $stack_cmd['divthru']['syntax'] = 'divthru(p)'; + $stack_cmd['divthru']['type'] = 'algebra'; + $stack_cmd['divthru']['use'] = 's'; + $stack_cmd['factor']['doc'] = 'Factor <tt>p</tt>. This is a complex issue, since different CAS systems assume a different underlying field. Most assume a call to this function will factor an integer polynomial over the rationals. Maxima already has a function of this name, and it is best not to redefine it. If you wish to test *************** *** 110,113 **** --- 115,120 ---- $stack_cmd['factorp']['use'] = 's'; + + $stack_cmd['diff']['doc'] = 'Differentiate <tt>p</tt> with respect to the variable <tt>v</tt>'; $stack_cmd['diff']['syntax'] = 'diff(p,v)'; |