1 /* written by Gosei Furuya <go.maxima@gmail.com>
2 # This program is free software; you can redistribute it and/or modify
3 # it under the terms of the GNU General Public License as published by
4 # the Free Software Foundation; either version 2 of the License, or
5 # (at your option) any later version.
12 triple_pmat(u_,v_,w_):=
14 mode_declare([m],any),
18 m[i,1]:u_[i],m[i,2]:v_[i],m[i,3]:w_[i]
21 matdmake(_list,_base):=block([_a:_list,_b:_base,_m],match_declare([_a,_b,_m],any),
22 _m:coefmatrix(d(_a),_b),_m);
24 /* liebraket we assumed that _pform1 is 1form,_pform2 either*/
25 Liebkt(_pform1,_pform2):=block([_a:[],_b:[],_a1,_b1,_m,_n,_p],
26 match_declare([_list1,_list2,_m,_n,_p],any),
27 _a1:expand(_pform1),_b1:expand(_pform2),
29 _a:endcons(ratcoef(_a1,basis[i]),_a),
30 _b:endcons(ratcoef(_b1,basis[i]),_b)
32 _m:transpose(matdmake(_b,basis)),_n:transpose(matdmake(_a,basis)),
33 _p: ( _a . _m . basis - _b . _n . basis)
34 /*inner(apply("+",basis),_p)*/
37 /*from vector to pform vtof1 is work form and vtof2 is flux form by Darling book*/
38 vtof1(_vector):=block(_vector.diag(scale_factor).basis);
39 vtof2(_vector):=block([_a],_a:map(h_st,basis),_vector._a);
40 /*from pform to vector but these two functions are rather experimentable*/
41 inv_i1(_pform):=block([a_],a_:coefmatrix(_pform,basis),a_.invert(diag(scale_factor)));
44 J(_f):= volume*apply("*",basis)& _f$
46 /*antiderivative or kodira diff op */
47 antid(_g):=nest2([J,d,J],_g)$