Changeset eccbb1 in git


Ignore:
Timestamp:
Mar 16, 2005, 5:15:14 PM (19 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
2b9b329114ce96945f46f83c2b58bace8ffa5329
Parents:
a35b39c32dcf4a56924b3da98e808d414570ade0
Message:
*levandov: rank and fixes by Markus added, FindTorsion by Viktor added, other fixes


git-svn-id: file:///usr/local/Singular/svn/trunk@7783 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/control.lib

    ra35b39 reccbb1  
    1 version="$Id: control.lib,v 1.23 2005-02-25 10:48:06 levandov Exp $";
     1version="$Id: control.lib,v 1.24 2005-03-16 16:15:14 levandov Exp $";
    22category="Applications";
    33info="
     
    1313
    1414PROCEDURES:
    15 control  (R);           analysis of controllability-related properties of R,
     15control  (R);           analysis of controllability-related properties of R(using Ext modules),
     16control2(R);            analysis of controllability-related properties of R(using dimension),
    1617autonom  (R);           analysis of autonomy-related properties of R (using Ext modules),
    1718autonom2 (R);           analysis of autonomy-related properties of R (using dimension),
     
    1920RightKernel (R);        a right kernel of R,
    2021LeftInverse (R);        a left inverse of R,
    21 RighttInverse (R);      a right inverse of R,
     22RightInverse (R);      a right inverse of R,
    2223smith (M);              a Smith form of a module M,
    2324genericity (M);         analysis of the genericity of parameters,
     
    572573PURPOSE: computes list of all the properties concerning controllability of the system (behavior), represented by the  matrix R
    573574RETURN: list
    574 EXAMPLE:  example control; shows an example
     575EXAMPLE:  example control2; shows an example
    575576NOTE: same as control(R); but using dimensions
    576577"
     
    605606};
    606607//------------------------------------------------------------------------
    607 static proc autonom_output( int i, int NVars, module RC )
     608proc rank(module M)
     609{
     610  module M_red=bareiss(M)[1];
     611  int NCols_red=ncols(M_red);
     612  return (NCols_red);
     613}
     614//------------------------------------------------------------------------
     615static proc autonom_output( int i, int NVars, module RC, int R_rank )
     616//static proc autonom_output( int i, int NVars, module RC )
    608617//static proc autonom_output( int i, int NVars )
    609618"USAGE:  proc autonom_output(i, NVars)
     
    625634                   "kernel representation for controllable part",
    626635                   RC,
     636                   "column-rank of the matrix",
     637                   R_rank,
    627638                   DofS,
    628639                   d )
     
    725736  module RT=transpose(R);
    726737  module RC;
     738  int R_rank=ncols(R);
    727739  ExtIsZero=is_zero_Our(Ext_Our(0,RT));     
    728740//   R=transpose(R);
     
    738750    {
    739751      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));
    742756  //  return(autonom_output(i,NVars));     
    743757}
     
    898912"USAGE:  genericity(M), M is a module/matrix
    899913PURPOSE: determine parametric expressions which have been assumed to be non-zero in the process of computing the Groebner basis
    900 RETURN:  list (of strings)
     914RETURN:  list (of strings) 
    901915NOTE: we strongly recommend to switch on the redSB and redTail options;
    902916@*    the procedure is effective with the lift procedure for modules with parameters
     
    904918"
    905919{
    906   // returns nothing, if there are no parameters!
     920  // returns "-", if there are no parameters!
    907921  if (npars(basering)==0)
    908922  {
    909     return("");
     923    return("-");
    910924  }
    911925  int plevel = printlevel-voice+2;
     
    10341048  genericity(T2);
    10351049}
    1036 
     1050//---------------------------------------------------------------
    10371051proc canonize(list L)
    10381052"USAGE:  canonize(L), L a list
    1039 PURPOSE: modules in the list are canonized by computing their reduced minimal (= unique in the given ordering) Groebner bases
     1053PURPOSE: modules in the list are canonized by computing their reduced minimal (= unique up to constant factor w.r.t. the given ordering) Groebner bases
    10401054RETURN:  list
    10411055ASSUME:  L is the output of control/autonomy procedures
     
    10771091
    10781092//---------------------------------------------------------------
    1079 
    10801093static proc smdeg(matrix N) 
    10811094// returns an intvec of length 2 with the index of an element of N with smallest degree
     
    13051318}
    13061319//---------------------------------------------------------------
    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
     1320proc 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'
    13111323RETURN: nothing
    13121324"
    13131325{
    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  }
    13171333  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
    13211341        {
    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;
    13391359        }
    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  }
    13411378}
    13421379//---------------------------------------------------------------
     
    13531390  write(l,"\\par");
    13541391}
     1392//---------------------------------------------------------------
     1393proc FindTorsion(module R, ideal TAnn)
     1394"USAGE:  FindTorsion(R, I);   R an ideal/matrix/module, I an ideal
     1395PURPOSE: computes the Groebner basis of the submodule of R, annihilated by I
     1396RETURN:  module
     1397NOTE: 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
     1398the submodule of R
     1399EXAMPLE: 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}
     1423example
     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.