~ubuntu-branches/debian/squeeze/maxima/squeeze

« back to all changes in this revision

Viewing changes to share/contrib/plsquares.dem

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2006-10-18 14:52:42 UTC
  • mto: (1.1.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20061018145242-vzyrm5hmxr8kiosf
ImportĀ upstreamĀ versionĀ 5.10.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"DEMO FILE FOR PLSQUARES v1.1"$
2
 
 
3
 
load("plsquares")$
4
 
 
5
 
"A simple example of multivariable linear adjustment:"$
6
 
plsquares(matrix([1,2,0],[3,5,4],[4,7,9],[5,8,10]),[x,y,z],z);
7
 
 
8
 
"The same example without degree restrictions:"$
9
 
plsquares(matrix([1,2,0],[3,5,4],[4,7,9],[5,8,10]),[x,y,z],z,1,0);
10
 
 
11
 
"How many diagonals does a N-sides polygon have? What polynomial degree should be used?"$
12
 
plsquares(matrix([3,0],[4,2],[5,5],[6,9],[7,14],[8,20]),[N,diagonals],diagonals,5);
13
 
ev(%, N=9);   /* Testing for a 9 sides polygon */
14
 
 
15
 
"How many ways do we have to put two queens without they are threatened into a n x n chessboard?"$
16
 
plsquares(matrix([0,0],[1,0],[2,0],[3,8],[4,44]),[n,positions],[positions],4);
17
 
ev(%[1], n=8);   /* Testing for a normal (8 x 8) chessboard */
18
 
 
19
 
"An example with six dependent variables:"$
20
 
MTRX:matrix([0,0,0,0,0,1,1,1],[0,1,0,1,1,1,0,0],[1,0,0,1,1,1,0,0],[1,1,1,1,0,0,0,1]);
21
 
plsquares(MTRX,[a,b,_And,_Or,_Xor,_Nand,_Nor,_Nxor],[_And,_Or,_Xor,_Nand,_Nor,_Nxor],1,0);
22
 
 
23
 
"END OF THE DEMO"$