login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

JetBundle (JB)

axiom
)lib JBC JBC-
JetBundleCategory is now explicitly exposed in frame initial JetBundleCategory will be automatically loaded when needed from /var/zope2/var/LatexWiki/JBC.NRLIB/code JetBundleCategory& is now explicitly exposed in frame initial JetBundleCategory& will be automatically loaded when needed from /var/zope2/var/LatexWiki/JBC-.NRLIB/code

spad
)abb domain     JB     JetBundle
++ Description: ++ \axiom{JetBundle} implements a jet bundle of arbitrary order with given ++ names for the independent and dependent variables. It supports only ++ repeated index notation.
V ==> Vector B ==> Boolean Sy ==> Symbol BOP ==> BasicOperator I ==> Integer PI ==> PositiveInteger NNI ==> NonNegativeInteger L ==> List LS ==> List Symbol EI ==> Expression Integer OUT ==> OutputForm JBC ==> JetBundleCategory
JetBundle(IVar:LS, DVar:LS) : Cat == Def where
Cat ==> JBC with
coerce : Sy -> $ ++ \axiom{coerce(sy)} allows for the input of jet variables as symbols. ++ Yields an error, if the symbol is not contained in \axiom{IVar} or ++ \axiom{DVar}.
D : (Sy, L Sy) -> $ ++ \axiom{D(U,[X1,...,Xq])} generates a derivative. \axiom{U} must be in ++ \axiom{DVar}; all other symbols in \axiom{IVar}.
Def ==> add
-- some global constants nn:NNI := #IVar mm:NNI := #DVar -- nameX:V Sy := new(nn, first IVar) -- nameU:V Sy := new(mm, first DVar) -- for i in 2..nn repeat -- qsetelt!(nameX,i,qelt(IVar,i)) -- for i in 2..mm repeat -- qsetelt!(nameU,i,qelt(DVar,i))
nameX := construct(IVar)$V(Sy) nameU := construct(DVar)$V(Sy)
Rep := L NNI -- The list has length 2 for independent variables, length n+2 for -- derivatives and dependent variables. The first entry is zero for 1, -- one for independent, two for dependent variables and three for -- derivatives. The second entry is the upper index, the rest the -- multi-index.
setNotation(s:Sy):Sy == print("only repeated index notation possible")$OUT Repeated
getNotation():Sy == Repeated
multiIndex(jv:$):L NNI == copy rest rest jv::Rep
index(jv:$):PI == first(rest jv)::PI
type(jv:$):Sy == t := first jv zero? t => Const one? t => Indep t=2 => Dep Deriv
CheckZeroIndex(il:L NNI):B == -- Local function; checks, whether multi-index is zero. for i in il repeat if not zero? i then return false true
X(up:PI):$ == up>nn => error errmsg2 [1,up::NNI]
U(up:PI):$ == up>mm => error errmsg2 cons(2, cons(up::NNI, [0$NNI for i in 1..nn]))
Pm(up:PI,lo:L NNI):$ == up>mm => error errmsg2 #lo^=nn => error errmsg1 CheckZeroIndex(lo) => U(up) cons(3,cons(up::NNI,lo))
coerce(s:Sy):$ == pos := position(s,IVar) pos<minIndex(IVar) => pos := position(s,DVar) pos<minIndex(DVar) => error errmsg4 U(pos::PI) X(pos::PI)
D(u:Sy,der:L Sy):$ == up := position(u,DVar) up<minIndex(DVar) => error errmsg4 lower:L PI := empty for d in der repeat pos := position(d,IVar) pos<minIndex(IVar) => error errmsg4 lower := cons(pos::PI,lower) lower := reverse! lower Pr(up::PI,lower)
1 : $ == [0,1]
numIndVar():PI == nn::PI
numDepVar():PI == mm::PI
-- ----------- -- -- Output Form -- -- ----------- --
name(jv:$):Sy == (jt:=type(jv))=Const => "1"::Sy i := index jv jt=Indep => qelt(nameX,i) jt=Dep => qelt(nameU,i) mu := repeatedIndex jv res := qelt(nameU,i) lower:L OUT := empty for j in mu repeat lower := cons(qelt(nameX,j)::OUT,lower) lower := reverse! lower subscript(res,lower)
-- Coerce to Symbol looses all information; therefore -- all important data like type and indices are saved -- as arguments of an operator
opdisp(l:L OUT):OUT == first l
coerce(jv:$):EI == -- Name of operator must be unique and the same as jv::Sy -- to allow to differentiate and substitute in EI. type(jv)=Const => 1 opname:Sy := name jv jop := operator(opname)$BOP display(jop,opdisp) tmp:None := coerce(jv)$NoneFunctions1($) jop := setProperty(jop,"%symbol",tmp)$BOP tmp := coerce(weight(jv))$NoneFunctions1(NNI) jop := setProperty(jop,"%weight",tmp)$BOP tmp := coerce(type(jv))$NoneFunctions1(Sy) jop := setProperty(jop,"%jet",tmp)$BOP arg:L EI := concat!([opname::EI,index(jv)::EI], _ [i::EI for i in repeatedIndex jv]) kernel(jop,arg)
spad
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/6566655606233118084-25px002.spad using 
      old system compiler.
   JB abbreviates domain JetBundle 
   processing macro definition V ==> Vector 
processing macro definition B ==> Boolean
processing macro definition Sy ==> Symbol
processing macro definition BOP ==> BasicOperator
processing macro definition I ==> Integer
processing macro definition PI ==> PositiveInteger
processing macro definition NNI ==> NonNegativeInteger
processing macro definition L ==> List
processing macro definition LS ==> List Symbol
processing macro definition EI ==> Expression Integer
processing macro definition OUT ==> OutputForm
processing macro definition JBC ==> JetBundleCategory
processing macro definition Cat ==> -- the constructor category processing macro definition Def ==> -- the constructor capsule ------------------------------------------------------------------------ initializing NRLIB JB for JetBundle compiling into NRLIB JB compiling exported setNotation : Symbol -> Symbol Time: 0.13 SEC.
compiling exported getNotation : () -> Symbol JB;getNotation;S;2 is replaced by QUOTERepeated Time: 0 SEC.
compiling exported multiIndex : $ -> List NonNegativeInteger Time: 0.01 SEC.
compiling exported index : $ -> PositiveInteger Time: 0.01 SEC.
compiling exported type : $ -> Symbol Time: 0.02 SEC.
compiling local CheckZeroIndex : List NonNegativeInteger -> Boolean Time: 0.02 SEC.
compiling exported X : PositiveInteger -> $ Time: 0.03 SEC.
compiling exported U : PositiveInteger -> $ Time: 0.10 SEC.
compiling exported Pm : (PositiveInteger,List NonNegativeInteger) -> $ Time: 0.06 SEC.
compiling exported coerce : Symbol -> $ Time: 0.05 SEC.
compiling exported D : (Symbol,List Symbol) -> $ Time: 0.04 SEC.
compiling exported One : () -> $ JB;One;$;12 is replaced by LIST01 Time: 0.02 SEC.
compiling exported numIndVar : () -> PositiveInteger Time: 0 SEC.
compiling exported numDepVar : () -> PositiveInteger Time: 0.01 SEC.
compiling exported name : $ -> Symbol Time: 0.16 SEC.
compiling local opdisp : List OutputForm -> OutputForm JB;opdisp is replaced by SPADfirst Time: 0.02 SEC.
compiling exported coerce : $ -> Expression Integer Time: 0.33 SEC.
(time taken in buildFunctor: 0)
;;; *** |JetBundle| REDEFINED
;;; *** |JetBundle| REDEFINED Time: 0.01 SEC.
Warnings: [1] D: lower has no value [2] name: Const has no value [3] name: Indep has no value [4] name: Dep has no value
Cumulative Statistics for Constructor JetBundle Time: 1.02 seconds
finalizing NRLIB JB Processing JetBundle for Browser database: --------(coerce ($ Sy))--------- --------(D ($ Sy (L Sy)))--------- --->-->JetBundle(constructor): Not documented!!!! --->-->JetBundle(): Missing Description ------------------------------------------------------------------------ JetBundle is now explicitly exposed in frame initial JetBundle will be automatically loaded when needed from /var/zope2/var/LatexWiki/JB.NRLIB/code




subject:
  ( 7 subscribers )  
Please rate this page: