Changeset 4713c6 in git for Singular/LIB/control.lib


Ignore:
Timestamp:
Jul 22, 2004, 8:49:14 PM (20 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
42d8df26b60839287cbb2c2ceabaaf2e186abeb6
Parents:
47228711837a0a74205d021c040da7f645546089
Message:
*yena: alternative autonom2 (via 'dim'), extended output


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/control.lib

    r472287 r4713c6  
    1 version="$Id: control.lib,v 1.1 2004-07-20 12:09:58 levandov Exp $";
    2 category="Miscellaneous";
     1version="$Id: control.lib,v 1.2 2004-07-22 18:49:14 plural Exp $";
     2category="System and Control Theory";
    33info="
    44LIBRARY:  control.lib Procedures for System and Control Theory
     
    88SUPPORT: Forschungsschwerpunkt 'Mathematik und Praxis'
    99
     10
    1011PROCEDURES:
    1112declare(string NameOfRing, string Variables[, list #]);
    12 Defining the ring, optional parameter is a string of parameters.
     13Defining the ring, optional parametes are a string of parameters and a sting of ordering.
    1314 
    1415Print();                      Well-formatted output of lists, modules and matrixes
    15 control(module R);            Compute everthing related to controllability
    16 autonom(module R);            Compute everything related to autonomy
     16control(module R);            Computes everthing related to controllability
     17autonom(module R);            Computes everything related to autonomy(using Exts)
     18autonom2(module R);           Computes everything related to autonomy(using dim)
    1719LeftKernel(module R);         Computing the left kernel of R
    1820RightKernel(module R);        Computing the right kernel of R
     
    2022static space(int n)           Procedure used inside the procedure 'Print' to have a better formatted output
    2123static control_output();      Generating the output for the procedure 'control'
    22 static autonom_output();      Generating the output for the procedure 'autonom'
     24static autonom_output();      Generating the output for the procedure 'autonom' and 'autonom2'
    2325
    2426";
    2527
    2628LIB "homolog.lib";
    27 LIB "inout.lib";
    2829LIB "poly.lib";
    29 
    30 
     30LIB "primdec.lib";
     31//---------------------------------------------------------------
    3132proc declare(string NameOfRing, string Variables, list #)
    3233{
     
    3738  else
    3839  {
    39     execute( "ring " + NameOfRing + "=(0," + #[1] + "),(" + Variables + "),dp;" );
     40    if(size(#)==1)
     41    {
     42      execute( "ring " + NameOfRing + "=(0," + #[1] + "),(" + Variables + "),dp;" );
     43    }
     44    else
     45    {
     46      if( (size(#[1])!=0)&&(#[1]!=" ") )
     47      {
     48        execute( "ring " + NameOfRing + "=(0," + #[1] + "),(" + Variables + "),("+#[2]+");" );
     49      }
     50      else
     51      {
     52        execute( "ring " + NameOfRing + "=0,("+Variables+"),("+#[2]+");" );
     53      };
     54    };
    4055  };
    4156  keepring(basering);
     
    4661  string v="x,y,z";
    4762  string p="q,p";
     63  string Ord ="c,lp";
    4864 
    4965  declare("Ring_1",v);
     
    5470  print(basering);
    5571  print(nameof(basering));
    56 
     72 
     73  declare("Ring_3",v,p,Ord);
     74  print(basering);
     75  print(nameof(basering));
     76 
     77  declare("Ring_4",v,"",Ord);
     78  print(basering);
     79  print(nameof(basering));
     80 
     81  declare("Ring_5",v," ",Ord);
     82  print(basering);
     83  print(nameof(basering));
    5784};
    5885//
     
    6794//
    6895//
    69 
     96//-------------------------------------------------------------------------
    7097static proc space(int n)
    7198//the procedure is used in the procedure Print to have a better formatted output
     
    81108  return(s);
    82109};
    83 
     110//-----------------------------------------------------------------------------
    84111proc Print(M)
    85112//procedure for a well-formatted output of lists, modules and matrixes
     
    146173  return();
    147174};
    148 
     175//--------------------------------------------------------------------------
    149176proc RightKernel(matrix M)
    150177{
    151178  return(syz(M));
    152179};
    153 
     180//-------------------------------------------------------------------------
    154181proc LeftKernel(matrix M)
    155182{
    156183  return( transpose( syz( transpose(M) ) ) );
    157184};
    158 
     185//------------------------------------------------------------------------
    159186static proc control_output(int i, int NVars, module R, module Ext_1)
    160187//in this procedure the output list with all the contollability properties of the system is generated
    161188{
    162  
     189  int d=dim( std( Ann( transpose(R) ) ) ) ;;//this is the dimension of the system
     190  string DofS= "dimension of the system:";
    163191  if(i==1)
    164192  {
    165193    module RK=RightKernel(R);
    166194    return(
    167             list ("not controllable , image representation for controllable part:",
     195            list ( i,
     196                  "not controllable , image representation for controllable part:",
    168197                   RK,     
    169198                  "kernel representation for controllable part:",
    170199                   LeftKernel( RK ),
    171200                  "obstruction to controllability",
    172                    Ext_1
     201                   Ext_1,
     202                  "annihilator of torsion module(of obstruction to controllability)",
     203                   Ann(Ext_1),
     204                   DofS,
     205                   d
    173206                 )
    174207          );
     
    177210  if(i>NVars)
    178211  { 
    179     return("strongly controllable");
     212    return( list( -1,
     213                  "strongly controllable, image representation:",
     214                   RightKernel(R),
     215                   DofS,
     216                   d)
     217          );
    180218  };
    181219 
     
    186224  if( (i==2) )
    187225  {
    188     return("controllable, not reflexive");
     226    return( list( i,
     227                 "controllable, not reflexive, imagerepresentation:",
     228                  RightKernel(R),
     229                  DofS,
     230                  d )
     231          );
    189232  };
    190233   
    191234  if( (i>=3) )
    192235  {
    193     return("reflexive, not strongly controllable");
    194   };             
     236    return( list ( i,
     237                  "reflexive, not strongly controllable, image representation:",
     238                   RightKernel(R),
     239                   DofS,
     240                   d)
     241          );
     242  };
     243             
    195244 
    196245}; 
    197 
     246//-------------------------------------------------------------------------
    198247
    199248proc control(module R)
     
    205254 
    206255       
    207   module Ext_1 = Ext_R(1,R);
     256  module Ext_1 = std(Ext_R(1,R));
    208257   
    209258  ExtIsZero=is_zero(Ext_1);
     
    233282  Print( Rc );
    234283  Print( control(Rc) );
    235   kill r;
    236284  //----------------------------------
    237285  //reflector antenna
     
    247295  Print(R);
    248296  Print(control(R));
    249   kill A;
    250297  //----------------------------------
    251298  //Flexible Rod
     
    257304  Print(R);
    258305  Print(control(R));
    259   kill A;
    260306  //-------------------------------------
    261307  //TwoPendula
     
    268314  Print(R);
    269315  Print(control(R));
    270   kill r;
    271316  //----------------------------------------
    272317  //Wind Tunnel
     
    279324  Print(R);
    280325  Print(control(R));
    281   kill A;
    282 };
    283 
     326  //-------------------------------------------
     327
     328};
     329//------------------------------------------------------------------------
    284330static proc autonom_output( int i, int NVars )
    285331//in this procedure the output list with all the autonomy properties of the system is generated
    286332{
    287  
     333  int d=NVars-i;//that is the dimension of the system
     334  string DofS="dimension of the system:";
    288335  if(i==0)
    289336  {
    290     return( "not autonomous" );
     337    return( list(  i,
     338                  "not autonomous",
     339                   DofS,
     340                   d )
     341          );
    291342  };
    292343 
    293344  if( i>NVars )
    294345  { 
    295     return( "trivial" );
     346    return( list( -1,
     347                  "trivial",
     348                  DofS,
     349                  d )
     350          );
    296351  };
    297352 
     
    306361  //that system is overdetermined in this case
    307362  {
    308     return( "autonomous, not overdetermined" );
     363    return( list ( i,
     364                  "autonomous, not overdetermined",
     365                   DofS,
     366                   d )
     367          );
    309368  };
    310369   
    311370  if( i==NVars )
    312371  { 
    313     return( "strongly autonomous, in particular overdetermined" );
     372    return( list(  i,
     373                  "strongly autonomous,in particular overdetermined",
     374                   DofS,
     375                   d)
     376          );
    314377  };
    315378 
    316379  if( i<NVars )
    317380  {
    318     return( "overdetermined, not strongly autonomous" );
     381    return( list ( i,
     382                  "overdetermined, not strongly autonomous",
     383                   DofS,
     384                   d)
     385          );
    319386  };
    320387   
    321388}; 
    322  
    323 
    324 
     389//--------------------------------------------------------------------------
     390proc autonom2(module R)
     391//analogue to autonom using dim calculations
     392{
     393  int d;
     394  int NVars = nvars(basering);
     395  R=transpose(R);
     396  d=dim( std( Ann(R) ) );
     397  return( autonom_output(NVars-d,NVars) );
     398};
     399example
     400{"EXAMPLE:"; echo = 2;
     401  ring r=0,(s1,s2,s3),dp;
     402  module R=[0,-s3,s2],
     403           [s3,0,-s1];
     404  R=transpose(R);         
     405  Print( R ); 
     406  Print( autonom2(R) );
     407
     408  module Rc=[0,-s3,s2],
     409            [s3,0,-s1],
     410            [-s2,s1,0];
     411  Rc=transpose(Rc);         
     412  Print( Rc );
     413  Print( autonom2(Rc) );
     414  //-----------------------------------
     415  ring r=0,(s1,s2),dp;
     416  module R= [s1,-s2],
     417            [s2, s1];
     418  R=transpose(R);
     419  Print( R );
     420  Print( autonom2(R) );
     421 
     422  ring r=0,(s1,s2,s3,s4),dp;
     423  module R= [s1,-s2],
     424            [s2, s1],
     425            [s3,-s4],
     426            [s4, s3];       
     427  R=transpose(R);
     428  Print( R );
     429  Print( autonom2(R) );
     430  //----------------------------------------
     431  ring r=0,(d1,d2),dp;
     432  module R=[d1^2-d2],
     433           [d2^2-1];
     434  R=transpose(R);
     435  Print(R);
     436  Print(autonom2(R));     
     437}; 
     438//---------------------------------------------------------------------------
    325439
    326440proc autonom(module R)
     
    362476  Print( Rc );
    363477  Print( autonom(Rc) );
    364   kill r;
    365478  //-----------------------------------
    366479  ring r=0,(s1,s2),dp;
     
    370483  Print( R );
    371484  Print( autonom(R) );
    372   kill r;
    373   //-----------------------------------
     485 
    374486  ring r=0,(s1,s2,s3,s4),dp;
    375487  module R= [s1,-s2],
     
    380492  Print( R );
    381493  Print( autonom(R) );
     494  //----------------------------------------
     495  ring r=0,(d1,d2),dp;
     496  module R=[d1^2-d2],
     497           [d2^2-1];
     498  R=transpose(R);
     499  Print(R);
     500  Print(autonom(R));       
     501 
    382502}; 
    383 
     503//---------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.