######################################################################## VessiotJets := table(): mypackagename:="VessiotJets"; ######################################################################## # # (C) Pieter Eendebak, eendebak@math.uu.nl # # Template for the code was taken from Mohamed Barakat and Gehrt Hartjen. # ######################################################################## print(""||mypackagename||`, by Pieter Eendebak`); print(`This packages contains various commands to extend the capabilities of Vessiot.`); print(`The package requires the jets package and the Vessiot package.`); print(`Users are free to modify this program but should retain copyright notices.`); ######################################################################## # Commands ######################################################################## # determine a 1-form modulo a set of 1-forms VessiotJets[modulo]:=proc(jet, l) local fjf, fjv, n; if(nops(l)=0) then jet; else if(nops(l)>1) then modulo( modulo(jet, l[2..-1]), l[1]); else if( type(l, list) ) then n:=l[1]; else n:=l; end if; fjf:=frameJetForms(); fjv:=frameJetVectors(); jet &minus (fjf[n] &wedge hook(fjv[n], jet) ); end if; end if; end proc: # Convert a Vessiot vector to a normal vector VessiotJets[vvec2vec]:=proc(vv) option `Convert a Vessiot vector to plain vector`: local var, n; var:=frameIndependentVariables(); n:=nops(var); [seq(coeff_list(vv,[[i]]), i=1..n)]; end proc: # Convert a Vessiot vector to a vector in conventional notation VessiotJets[vvec2cvec]:=proc(v,ivar) option `Convert a Vessiot vector to conventional vector`: vec2cvec(VessiotJets[vvec2vec](v), ivar); end proc: # VessiotJets[cvec2vvec]:=proc(vec) option `Convert a vector in conventional notation to a Vessiot vector`: local terms; terms:=map( term->term[1] &mult vect(term[2][1]), vec); foldr((a,b)->a &plus b, zero_vect(1), op(terms) ); end proc: VessiotJets[form2vform]:=proc(vec, vars) option `Convert a form to a Vessiot form`: local terms; terms:=[seq(vec[j] &mult form(vars[j]), j=1..nops(vars))]; foldr((a,b)->a &plus b, zero_form(1), op(terms) ); end proc: VessiotJets[sub2vfull]:=proc(vec, vbundle) option `Convert vector in subbundle to Vessiot vector`; local ll; ll:=zip( (c,v)->c &mult v, mklist(vec), vbundle ); foldr((a,b)->a &plus b, zero_vect(1), op(ll) ); end proc: VessiotJets[sub2cfull]:=proc(vec, cbundle, ivar) option `Convert vector in sunbbundle to jets vector`; local ll; ll:=zip( (c,v)->mulcon(c,v,ivar), vec, cbundle); foldr((a,b)->jets[addcon](a,b,ivar),[],op(ll)); end proc: VessiotJets[formCoef]:=proc(form::Vessiot_form, fb) option `Express a 1-form in terms of a basis`; local fr, n; fr:=dual_frame(fb); n:=nops(fb); [seq( hook(fr[j], form ), j=1..n)]; end proc: VessiotJets[zform2scalar]:=proc(z) option `Convert a 0-form to a scalar`; coeff_set(z)[1] end proc: VessiotJets[twoFormMatrix]:=proc(tform::Vessiot_form, vlist) option `Convert a 2-form to its matrix representation with respect to given basis`; local n, vl; n:=nops(vlist); matrix(n,n,(i,j)->zform2scalar(hook(vlist[j], hook(vlist[i], tform))) ); end proc: VessiotJets[twoFormMatrixCoord]:=proc(tform::Vessiot_form) option `Convert a 2-form to its matrix representation with respect to coordinates`; local var, vlist; var:=frameIndependentVariables(); vlist:=map(vect, var); VessiotJets[twoFormMatrix](tform, vlist) end proc: ######################################################################## # set variables mypackagenamelib:=cat(mypackagename, ".lib"): cdir:=currentdir(): mypackagenameFull:=""||cdir||"/"||mypackagenamelib; # remove old lib system("rm "||mypackagenamelib); # create new lib print("Creating archive"); march('create', mypackagenamelib, 100); savelibname:=mypackagenameFull; savelib(convert(mypackagename,symbol)); marchlist:=march('list', mypackagenameFull); map(march, ['gc','reindex','pack'], mypackagenameFull); march('setattribute', mypackagenameFull, mode="READONLY"); print(marchlist); quit; ########################################################################