Changeset 4713c6 in git
- Timestamp:
- Jul 22, 2004, 8:49:14 PM (19 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 42d8df26b60839287cbb2c2ceabaaf2e186abeb6
- Parents:
- 47228711837a0a74205d021c040da7f645546089
- 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 levandovExp $";2 category=" Miscellaneous";1 version="$Id: control.lib,v 1.2 2004-07-22 18:49:14 plural Exp $"; 2 category="System and Control Theory"; 3 3 info=" 4 4 LIBRARY: control.lib Procedures for System and Control Theory … … 8 8 SUPPORT: Forschungsschwerpunkt 'Mathematik und Praxis' 9 9 10 10 11 PROCEDURES: 11 12 declare(string NameOfRing, string Variables[, list #]); 12 Defining the ring, optional paramete r is a string of parameters.13 Defining the ring, optional parametes are a string of parameters and a sting of ordering. 13 14 14 15 Print(); 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 16 control(module R); Computes everthing related to controllability 17 autonom(module R); Computes everything related to autonomy(using Exts) 18 autonom2(module R); Computes everything related to autonomy(using dim) 17 19 LeftKernel(module R); Computing the left kernel of R 18 20 RightKernel(module R); Computing the right kernel of R … … 20 22 static space(int n) Procedure used inside the procedure 'Print' to have a better formatted output 21 23 static control_output(); Generating the output for the procedure 'control' 22 static autonom_output(); Generating the output for the procedure 'autonom' 24 static autonom_output(); Generating the output for the procedure 'autonom' and 'autonom2' 23 25 24 26 "; 25 27 26 28 LIB "homolog.lib"; 27 LIB "inout.lib";28 29 LIB "poly.lib"; 29 30 30 LIB "primdec.lib"; 31 //--------------------------------------------------------------- 31 32 proc declare(string NameOfRing, string Variables, list #) 32 33 { … … 37 38 else 38 39 { 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 }; 40 55 }; 41 56 keepring(basering); … … 46 61 string v="x,y,z"; 47 62 string p="q,p"; 63 string Ord ="c,lp"; 48 64 49 65 declare("Ring_1",v); … … 54 70 print(basering); 55 71 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)); 57 84 }; 58 85 // … … 67 94 // 68 95 // 69 96 //------------------------------------------------------------------------- 70 97 static proc space(int n) 71 98 //the procedure is used in the procedure Print to have a better formatted output … … 81 108 return(s); 82 109 }; 83 110 //----------------------------------------------------------------------------- 84 111 proc Print(M) 85 112 //procedure for a well-formatted output of lists, modules and matrixes … … 146 173 return(); 147 174 }; 148 175 //-------------------------------------------------------------------------- 149 176 proc RightKernel(matrix M) 150 177 { 151 178 return(syz(M)); 152 179 }; 153 180 //------------------------------------------------------------------------- 154 181 proc LeftKernel(matrix M) 155 182 { 156 183 return( transpose( syz( transpose(M) ) ) ); 157 184 }; 158 185 //------------------------------------------------------------------------ 159 186 static proc control_output(int i, int NVars, module R, module Ext_1) 160 187 //in this procedure the output list with all the contollability properties of the system is generated 161 188 { 162 189 int d=dim( std( Ann( transpose(R) ) ) ) ;;//this is the dimension of the system 190 string DofS= "dimension of the system:"; 163 191 if(i==1) 164 192 { 165 193 module RK=RightKernel(R); 166 194 return( 167 list ("not controllable , image representation for controllable part:", 195 list ( i, 196 "not controllable , image representation for controllable part:", 168 197 RK, 169 198 "kernel representation for controllable part:", 170 199 LeftKernel( RK ), 171 200 "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 173 206 ) 174 207 ); … … 177 210 if(i>NVars) 178 211 { 179 return("strongly controllable"); 212 return( list( -1, 213 "strongly controllable, image representation:", 214 RightKernel(R), 215 DofS, 216 d) 217 ); 180 218 }; 181 219 … … 186 224 if( (i==2) ) 187 225 { 188 return("controllable, not reflexive"); 226 return( list( i, 227 "controllable, not reflexive, imagerepresentation:", 228 RightKernel(R), 229 DofS, 230 d ) 231 ); 189 232 }; 190 233 191 234 if( (i>=3) ) 192 235 { 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 195 244 196 245 }; 197 246 //------------------------------------------------------------------------- 198 247 199 248 proc control(module R) … … 205 254 206 255 207 module Ext_1 = Ext_R(1,R);256 module Ext_1 = std(Ext_R(1,R)); 208 257 209 258 ExtIsZero=is_zero(Ext_1); … … 233 282 Print( Rc ); 234 283 Print( control(Rc) ); 235 kill r;236 284 //---------------------------------- 237 285 //reflector antenna … … 247 295 Print(R); 248 296 Print(control(R)); 249 kill A;250 297 //---------------------------------- 251 298 //Flexible Rod … … 257 304 Print(R); 258 305 Print(control(R)); 259 kill A;260 306 //------------------------------------- 261 307 //TwoPendula … … 268 314 Print(R); 269 315 Print(control(R)); 270 kill r;271 316 //---------------------------------------- 272 317 //Wind Tunnel … … 279 324 Print(R); 280 325 Print(control(R)); 281 kill A; 282 }; 283 326 //------------------------------------------- 327 328 }; 329 //------------------------------------------------------------------------ 284 330 static proc autonom_output( int i, int NVars ) 285 331 //in this procedure the output list with all the autonomy properties of the system is generated 286 332 { 287 333 int d=NVars-i;//that is the dimension of the system 334 string DofS="dimension of the system:"; 288 335 if(i==0) 289 336 { 290 return( "not autonomous" ); 337 return( list( i, 338 "not autonomous", 339 DofS, 340 d ) 341 ); 291 342 }; 292 343 293 344 if( i>NVars ) 294 345 { 295 return( "trivial" ); 346 return( list( -1, 347 "trivial", 348 DofS, 349 d ) 350 ); 296 351 }; 297 352 … … 306 361 //that system is overdetermined in this case 307 362 { 308 return( "autonomous, not overdetermined" ); 363 return( list ( i, 364 "autonomous, not overdetermined", 365 DofS, 366 d ) 367 ); 309 368 }; 310 369 311 370 if( i==NVars ) 312 371 { 313 return( "strongly autonomous, in particular overdetermined" ); 372 return( list( i, 373 "strongly autonomous,in particular overdetermined", 374 DofS, 375 d) 376 ); 314 377 }; 315 378 316 379 if( i<NVars ) 317 380 { 318 return( "overdetermined, not strongly autonomous" ); 381 return( list ( i, 382 "overdetermined, not strongly autonomous", 383 DofS, 384 d) 385 ); 319 386 }; 320 387 321 388 }; 322 323 324 389 //-------------------------------------------------------------------------- 390 proc 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 }; 399 example 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 //--------------------------------------------------------------------------- 325 439 326 440 proc autonom(module R) … … 362 476 Print( Rc ); 363 477 Print( autonom(Rc) ); 364 kill r;365 478 //----------------------------------- 366 479 ring r=0,(s1,s2),dp; … … 370 483 Print( R ); 371 484 Print( autonom(R) ); 372 kill r; 373 //----------------------------------- 485 374 486 ring r=0,(s1,s2,s3,s4),dp; 375 487 module R= [s1,-s2], … … 380 492 Print( R ); 381 493 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 382 502 }; 383 503 //---------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.