Changeset eccbb1 in git
- Timestamp:
- Mar 16, 2005, 5:15:14 PM (18 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 2b9b329114ce96945f46f83c2b58bace8ffa5329
- Parents:
- a35b39c32dcf4a56924b3da98e808d414570ade0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/control.lib
ra35b39 reccbb1 1 version="$Id: control.lib,v 1.2 3 2005-02-25 10:48:06levandov Exp $";1 version="$Id: control.lib,v 1.24 2005-03-16 16:15:14 levandov Exp $"; 2 2 category="Applications"; 3 3 info=" … … 13 13 14 14 PROCEDURES: 15 control (R); analysis of controllability-related properties of R, 15 control (R); analysis of controllability-related properties of R(using Ext modules), 16 control2(R); analysis of controllability-related properties of R(using dimension), 16 17 autonom (R); analysis of autonomy-related properties of R (using Ext modules), 17 18 autonom2 (R); analysis of autonomy-related properties of R (using dimension), … … 19 20 RightKernel (R); a right kernel of R, 20 21 LeftInverse (R); a left inverse of R, 21 Right tInverse (R); a right inverse of R,22 RightInverse (R); a right inverse of R, 22 23 smith (M); a Smith form of a module M, 23 24 genericity (M); analysis of the genericity of parameters, … … 572 573 PURPOSE: computes list of all the properties concerning controllability of the system (behavior), represented by the matrix R 573 574 RETURN: list 574 EXAMPLE: example control ; shows an example575 EXAMPLE: example control2; shows an example 575 576 NOTE: same as control(R); but using dimensions 576 577 " … … 605 606 }; 606 607 //------------------------------------------------------------------------ 607 static proc autonom_output( int i, int NVars, module RC ) 608 proc rank(module M) 609 { 610 module M_red=bareiss(M)[1]; 611 int NCols_red=ncols(M_red); 612 return (NCols_red); 613 } 614 //------------------------------------------------------------------------ 615 static proc autonom_output( int i, int NVars, module RC, int R_rank ) 616 //static proc autonom_output( int i, int NVars, module RC ) 608 617 //static proc autonom_output( int i, int NVars ) 609 618 "USAGE: proc autonom_output(i, NVars) … … 625 634 "kernel representation for controllable part", 626 635 RC, 636 "column-rank of the matrix", 637 R_rank, 627 638 DofS, 628 639 d ) … … 725 736 module RT=transpose(R); 726 737 module RC; 738 int R_rank=ncols(R); 727 739 ExtIsZero=is_zero_Our(Ext_Our(0,RT)); 728 740 // R=transpose(R); … … 738 750 { 739 751 RC=LeftKernel(RightKernel(R)); 740 } 741 return(autonom_output(i,NVars,RC)); 752 R_rank=rank(R); 753 } 754 return(autonom_output(i,NVars,RC,R_rank)); 755 // return(autonom_output(i,NVars,RC)); 742 756 // return(autonom_output(i,NVars)); 743 757 } … … 898 912 "USAGE: genericity(M), M is a module/matrix 899 913 PURPOSE: determine parametric expressions which have been assumed to be non-zero in the process of computing the Groebner basis 900 RETURN: list (of strings) 914 RETURN: list (of strings) 901 915 NOTE: we strongly recommend to switch on the redSB and redTail options; 902 916 @* the procedure is effective with the lift procedure for modules with parameters … … 904 918 " 905 919 { 906 // returns nothing, if there are no parameters!920 // returns "-", if there are no parameters! 907 921 if (npars(basering)==0) 908 922 { 909 return(" ");923 return("-"); 910 924 } 911 925 int plevel = printlevel-voice+2; … … 1034 1048 genericity(T2); 1035 1049 } 1036 1050 //--------------------------------------------------------------- 1037 1051 proc canonize(list L) 1038 1052 "USAGE: canonize(L), L a list 1039 PURPOSE: modules in the list are canonized by computing their reduced minimal (= unique inthe given ordering) Groebner bases1053 PURPOSE: modules in the list are canonized by computing their reduced minimal (= unique up to constant factor w.r.t. the given ordering) Groebner bases 1040 1054 RETURN: list 1041 1055 ASSUME: L is the output of control/autonomy procedures … … 1077 1091 1078 1092 //--------------------------------------------------------------- 1079 1080 1093 static proc smdeg(matrix N) 1081 1094 // returns an intvec of length 2 with the index of an element of N with smallest degree … … 1305 1318 } 1306 1319 //--------------------------------------------------------------- 1307 proc list_tex(list L, string name, link l) 1308 "USAGE: control_tex(l), where l is a list 1309 PURPOSE: writes the content of list L in a tex-file 'name', L is supposed 1310 to be the output of control/autonomy procedures 1320 proc list_tex(L, string name,link l,int nr_loop) 1321 "USAGE: list_tex(L,name,l), where L is a list, name a string, l a link 1322 writes the content of list L in a tex-file 'name' 1311 1323 RETURN: nothing 1312 1324 " 1313 1325 { 1314 if(size(L)==0) 1315 { 1316 } 1326 if(typeof(L)!="list") //in case L is not a list 1327 { 1328 texobj(name,L); 1329 } 1330 if(size(L)==0) 1331 { 1332 } 1317 1333 else 1318 { 1319 string t; 1320 for (int i=1;i<=size(L);i++) 1334 { 1335 string t; 1336 for (int i=1;i<=size(L);i++) 1337 { 1338 while(1) 1339 { 1340 if(typeof(L[i])=="string") //Fehler hier fuer normalen output->nur wenn string in liste dann verbatim 1321 1341 { 1322 while(1)1323 {1324 if(typeof(L[i])=="string")1325 {1326 t=L[i];1327 write(l,t,"\\par");1328 break;1329 }1330 if(typeof(L[i])=="module")1331 {1332 texobj(s,matrix(L[i]));1333 break;1334 }1335 texobj(s,L[i]);1336 write(l,"\\par");1337 break;1338 }1342 t=L[i]; 1343 if(nr_loop==1) 1344 { 1345 write(l,"\\begin\{center\}"); 1346 write(l,"\\begin\{verbatim\}"); 1347 } 1348 write(l,t); 1349 if(nr_loop==0) 1350 { 1351 write(l,"\\par"); 1352 } 1353 if(nr_loop==1) 1354 { 1355 write(l,"\\end\{verbatim\}"); 1356 write(l,"\\end\{center\}"); 1357 } 1358 break; 1339 1359 } 1340 } 1360 if(typeof(L[i])=="module") 1361 { 1362 texobj(name,matrix(L[i])); 1363 break; 1364 } 1365 if(typeof(L[i])=="list") 1366 { 1367 list_tex(L[i],name,l,1); 1368 break; 1369 } 1370 write(l,"\\begin\{center\}"); 1371 texobj(name,L[i]); 1372 write(l,"\\end\{center\}"); 1373 write(l,"\\par"); 1374 break; 1375 } 1376 } 1377 } 1341 1378 } 1342 1379 //--------------------------------------------------------------- … … 1353 1390 write(l,"\\par"); 1354 1391 } 1392 //--------------------------------------------------------------- 1393 proc FindTorsion(module R, ideal TAnn) 1394 "USAGE: FindTorsion(R, I); R an ideal/matrix/module, I an ideal 1395 PURPOSE: computes the Groebner basis of the submodule of R, annihilated by I 1396 RETURN: module 1397 NOTE: especially helpful, when I is the annihilator of the t(R) - the torsion submodule of R. In this case, the result is the explicit presentation of t(R) as 1398 the submodule of R 1399 EXAMPLE: example FindTorsion; shows an example 1400 " 1401 { 1402 // motivation: let R be a module, 1403 // TAnn is the annihilator of t(R)\subset R 1404 // compute the generators of t(R) explicitly 1405 ideal AS = TAnn; 1406 module S = R; 1407 if (attrib(S,"isSB")<>1) 1408 { 1409 S = std(S); 1410 } 1411 if (attrib(AS,"isSB")<>1) 1412 { 1413 AS = std(AS); 1414 } 1415 int nc = ncols(S); 1416 module Tmp = AS*freemodule(nc); 1417 module To = modulo(Tmp,S); 1418 To = NF(std(To+S),S); 1419 To = simplify(To,2); 1420 To = std(To); 1421 return(To); 1422 } 1423 example 1424 { 1425 "EXAMPLE:";echo = 2; 1426 // Flexible Rod 1427 ring A = 0,(D1, D2), (c,dp); 1428 module R= [D1, -D1*D2, -1], [2*D1*D2, -D1-D1*D2^2, 0]; 1429 module RR = transpose(R); 1430 list L = control(RR); 1431 view(L); 1432 // here, we have the annihilator: 1433 ideal LAnn = D1; // = L[10] 1434 module Tr = FindTorsion(RR,LAnn); 1435 print(RR); // the module itself 1436 print(Tr); // generators of the torsion submodule 1437 }
Note: See TracChangeset
for help on using the changeset viewer.