Changeset 8059d4 in git


Ignore:
Timestamp:
Oct 14, 2010, 8:14:08 PM (14 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
9de0abdbc641e8e514442aa3e70a7c66cca9819a
Parents:
3247105d0e1b88a132678cae369bf4353e95ba14
Message:
*levandov: minor fixes, cleanup

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/findiff.lib

    r324710 r8059d4  
    1 //
    2 //
    31//////////////////////////////////////////////////////////////////////////////
    42version="$Id$";
     
    97AUTHOR:                  Christian Dingler
    108
    11 NOTE:
    12  @texinfo
     9OVERVIEW:
     10@texinfo
    1311 Using @code{qepcad}/@code{qepcadsystem} from this
    1412 library requires the program @code{qepcad} to be installed.
     
    1816
    1917PROCEDURES:
    20  visualize(f);        shows a scheme in index-notation
    21  u(D[,#]);        gives some vector; depends on @derivatives
     18 visualize(f);            shows a scheme in index-notation
     19 u(D[,#]);                gives some vector; depends on @derivatives
    2220 scheme([v1,..,vn]);      computes the finite difference scheme defined by v1,..,vn
    2321 laxfrT(Ut,U,space);      Lax-Friedrich-approximation for the time-direction
    2422 laxfrX(Ux,U,space);      Lax-Friedrich-approximation for the space-direction
    2523 forward(U1,U2,VAR);      forward-approximation
    26  backward(U1,U2,VAR);      backward-approximation
    27  central1st(U1,U2,VAR);      central-approximation of first order
    28  central2nd(U1,U2,VAR);      central-approximation of second order
    29  trapezoid(U1,U2,VAR);      trapezoid-approximation
    30  midpoint(U1,U2,VAR);      midpoint-approximation
     24 backward(U1,U2,VAR);     backward-approximation
     25 central1st(U1,U2,VAR);   central-approximation of first order
     26 central2nd(U1,U2,VAR);   central-approximation of second order
     27 trapezoid(U1,U2,VAR);    trapezoid-approximation
     28 midpoint(U1,U2,VAR);     midpoint-approximation
    3129 pyramid(U1,U2,VAR);      pyramid-approximation
    3230 setinitials(variable,der[,#]);    constructs and sets the basering for further computations
    3331 errormap(f);        performs the Fouriertransformation of a poly
    34  matrixsystem(Matrices,Approx);    gives the scheme of a pde-system as one matrix
     32 matrixsystem(M,A);    gives the scheme of a pde-system as one matrix
    3533 timestep(M);        gives the several timelevels of a scheme derived from a pde-system
    36  fouriersystem(Matrices,Approx);  performs the Fouriertransformation of a matrix scheme
     34 fouriersystem(M,A);  performs the Fouriertransformation of a matrix scheme
    3735 PartitionVar(f,n);      partitions a poly into the var(n)-part and the rest
    38  ComplexValue(f);      computes the complex value of f, var(1) being the imaginary unit
    39  VarToPar(f);        substitute var(i) by par(i)
    40  ParToVar(f);        substitute par(i) by var(i)
    41  qepcad(f);        ask QEPCAD for equivalent constraints to f<1
    42  qepcadsystem(l);      ask QEPCAD for equivalent constraints to all eigenvals of some matrices being <1
     36 ComplexValue(f);        computes the complex value of f, var(1) being the imaginary unit
     37 VarToPar(f);            substitute var(i) by par(i)
     38 ParToVar(f);            substitute par(i) by var(i)
     39 qepcad(f);              ask QEPCAD for equivalent constraints to f<1
     40 qepcadsystem(l);        ask QEPCAD for equivalent constraints to all eigenvals of some matrices being <1
     41";
    4342
    44 
    45 ";
    4643LIB "ring.lib";
    4744LIB "general.lib";
     
    125122/////////////////////////////////////
    126123proc u(D,list #)
    127 "USAGE:   u(D[,#]); D a string that occurs in the list of @derivatives, # an optional list of integers.
    128 RETURN:  type vector; gives the vector, that corresponds with gen(n)*m, where m is the monomial defined by #
     124"USAGE: u(D[,#]); D a string that occurs in the list of @derivatives, # an optional list of integers.
     125RETURN: type vector; gives the vector, that corresponds with gen(n)*m, where m is the monomial defined by #
    129126EXAMPLE: example u; shows an example
    130127"
     
    203200///////////////////////////////////////////////
    204201proc scheme(list #)
    205 "USAGE:    scheme([v1,..,vn]); v1,..,vn of type vector
    206 RETURN:   type poly; performs substitutions by the means of Groebner Basis computation of the module generated by the input vectors, then intersects the intermediate result with the suitable component in order to get a finite difference scheme;
    207 NOTE:     works only for a single pde, for the case of a system use matrixsystem
    208 EXAMPLE:  example scheme; shows an example
     202"USAGE:  scheme([v1,..,vn]); v1,..,vn of type vector
     203RETURN:  poly
     204PURPOSE: performs substitutions by the means of Groebner basis computation
     205of the submodule, generated by the input vectors, then intersects the
     206intermediate result with the suitable component in order to get a finite
     207difference scheme
     208NOTE:  works only for a single PDE, for the case of a system use @code{matrixsystem}
     209EXAMPLE: example scheme; shows an example
    209210"
    210211{
     
    270271"USAGE:   laxfrT(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
    271272RETURN:   type vector; gives a predefined approximation of the Lax-Friedrich-approximation for the derivation in the timevariable as often used in literature;
    272 NOTE:     see also laxfrX,setinitials,scheme; WARNING: laxfrT is not to be interchanged with laxfrX
     273NOTE:     see also laxfrX, setinitials, scheme; Warning: laxfrT is not to be interchanged with laxfrX
    273274EXAMPLE:  example laxfrT; shows an example
    274275"
     
    291292////////////////////////
    292293proc laxfrX(string Ux, string U, poly space)
    293 "USAGE:   laxfrX(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
    294 RETURN:   type vector; gives a predefined approximation of the Lax-Friedrich-approximation for the derivation in one of the spatial variables as often used in literature;
    295 NOTE:     see also laxfrT,setinitials,scheme; WARNING: laxfrT is not to be interchanged with laxfrX
    296 EXAMPLE:  example laxfrX; shows an example
    297 "
    298 {
    299   poly dspace=diffpar(space);
     294"USAGE: laxfrX(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
     295RETURN: type vector; gives a predefined approximation of the Lax-Friedrich-approximation for the derivation in one of the spatial variables as often used in literature;
     296NOTE:   see also laxfrT, setinitials, scheme; Warning: laxfrX is not to be interchanged with laxfrT
     297EXAMPLE: example laxfrX; shows an example
     298"
     299{
     300  poly dspace = diffpar(space);
    300301  def v=2*dspace*space*u(Ux)-(space**2-1)*u(U);
    301302  return(v);
     
    530531proc setinitials(list variable, list der,list #)
    531532"USAGE:  setinitials(V,D[,P]); V,D,P are lists with strings as elements
    532 RETURN:  no return value: sets the dependence order of the occuring derivatives, constructs the suitable ring to compute in containing user chosen parameters, sets new basering
    533 NOTE:    P is optional, used to introduce some additional parameters into the ring. The SINE and COSINE values needed for the fouriertransformation  are symbolically introduced under the names string(c)+nameof(variable), i.e. if x is any spatial variable then cx:=cosine(dx*ksi), when regarding the fouriertransform after ksi (for sine respectively). Artificial parameters I,T,Px,Py are introduced for the later eigenvalue analysis -> variables can be transformed into parameters of similar name
     533RETURN:  no return value: sets the dependence order of the occuring derivatives,
     534constructs the suitable ring to compute in containing user chosen parameters, sets new basering
     535NOTE:    P is optional, used to introduce some additional parameters into the ring. The Sine and
     536Cosine values needed for the fourier transformation are symbolically introduced under the names
     537string(c)+nameof(variable), i.e. if x is any spatial variable then cx:=cosine(dx*ksi), when
     538regarding the fourier transform after ksi (for sine respectively). Artificial parameters I,T,Px,Py
     539are introduced for the later eigenvalue analysis. Variables can be transformed into parameters
     540of similar name
    534541EXAMPLE: example setinitials; shows an example
    535542"
     
    593600  qring R=std(Id);
    594601  setring R;
     602  // comment by VL: it's better to return this ring! causes many changes
     603  // across the library
    595604  export(R);
    596605  exportto(Top,basering);
     
    857866example
    858867{
    859   "EXAMPLE:"echo=2;
     868  "EXAMPLE:"; echo=2;
    860869  list D="Ut","Ux","Uy","U";
    861870  list V="t","x","y";
     
    10671076"
    10681077{
     1078  // how to test, whether QEPCAD is installed?
     1079  createQCfilter(); // creates/overwrites qepcadfilter.pl
    10691080  system("sh","rm -f QEPCAD-out");
    10701081  system("sh","rm -f QEPCAD-in");
     
    11411152}
    11421153///////////////////////////////////////////
     1154proc createQCfilter()
     1155{
     1156  // writes the following to the file qepcadfilter.pl
     1157  // is there already such a file? remove it!
     1158  system("sh","rm -f qepcadfilter.pl"); 
     1159  link l=":w qepcadfilter.pl";
     1160  write(l, "#!/usr/bin/perl");
     1161  write(l, "$flag = 0;");
     1162  write(l, "$res = \"\";");
     1163  write(l,"while(<>)");
     1164  write(l,"{ if ($_ =~ /Warning|WARNING|warning|Error|error|ERROR/) { print $_; }");
     1165  write(l,"elsif ($_ =~ /An\ equivalent/) { $flag = 1; }");
     1166  write(l,"elsif ($flag == 1 && $_ ne \"\n\") { print $_; $flag = 0; } }");
     1167}
     1168
     1169///////////////////////////////////////////
    11431170proc qepcadsystem(list l)
    1144 "USAGE:   qepcadsytem(f); l a list;
    1145 RETURN:   type list; gives back some constraints that are equivalent to the eigenvalues of the matrices in the list l being < 1 (computed by QEPCAD);
     1171"USAGE:  qepcadsytem(f); l a list;
     1172RETURN:  list
     1173PURPOSE: gives back some constraints that are equivalent to the
     1174eigenvalues of the matrices in the list l being < 1 (computed by QEPCAD)
    11461175EXAMPLE:  example qepcadsystem; shows an example
    11471176"
    11481177{
     1178  // how to test, whether QEPCAD is installed?
     1179  createQCfilter(); // creates/overwrites qepcadfilter.pl
    11491180  system("sh","rm -f QEPCAD-out");
    11501181  system("sh","rm -f QEPCAD-in");
     
    12071238  if(size(output)==0)
    12081239  {
    1209     return("Try manually");    //maybe too few cells
     1240    ERROR("Try manually");    //maybe too few cells
    12101241  }
    12111242  if(find(output,"FALSE")!=0)
    12121243  {
    1213     return("FALSE");
     1244    ERROR("FALSE");
    12141245  }
    12151246  if(find(output,"WARNING")!=0)
    12161247  {
    1217     return("WARNING! Try manually");
     1248    ERROR("WARNING! Try manually");
    12181249  }
    12191250  else
Note: See TracChangeset for help on using the changeset viewer.