Annotation of OpenXM_contrib2/asir2000/lib/bgk, Revision 1.3
1.2 noro 1: /*
2: * Copyright (c) 1994-2000 FUJITSU LABORATORIES LIMITED
3: * All rights reserved.
4: *
5: * FUJITSU LABORATORIES LIMITED ("FLL") hereby grants you a limited,
6: * non-exclusive and royalty-free license to use, copy, modify and
7: * redistribute, solely for non-commercial and non-profit purposes, the
8: * computer program, "Risa/Asir" ("SOFTWARE"), subject to the terms and
9: * conditions of this Agreement. For the avoidance of doubt, you acquire
10: * only a limited right to use the SOFTWARE hereunder, and FLL or any
11: * third party developer retains all rights, including but not limited to
12: * copyrights, in and to the SOFTWARE.
13: *
14: * (1) FLL does not grant you a license in any way for commercial
15: * purposes. You may use the SOFTWARE only for non-commercial and
16: * non-profit purposes only, such as academic, research and internal
17: * business use.
18: * (2) The SOFTWARE is protected by the Copyright Law of Japan and
19: * international copyright treaties. If you make copies of the SOFTWARE,
20: * with or without modification, as permitted hereunder, you shall affix
21: * to all such copies of the SOFTWARE the above copyright notice.
22: * (3) An explicit reference to this SOFTWARE and its copyright owner
23: * shall be made on your publication or presentation in any form of the
24: * results obtained by use of the SOFTWARE.
25: * (4) In the event that you modify the SOFTWARE, you shall notify FLL by
1.3 ! noro 26: * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification
1.2 noro 27: * for such modification or the source code of the modified part of the
28: * SOFTWARE.
29: *
30: * THE SOFTWARE IS PROVIDED AS IS WITHOUT ANY WARRANTY OF ANY KIND. FLL
31: * MAKES ABSOLUTELY NO WARRANTIES, EXPRESSED, IMPLIED OR STATUTORY, AND
32: * EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS
33: * FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT OF THIRD PARTIES'
34: * RIGHTS. NO FLL DEALER, AGENT, EMPLOYEES IS AUTHORIZED TO MAKE ANY
35: * MODIFICATIONS, EXTENSIONS, OR ADDITIONS TO THIS WARRANTY.
36: * UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, TORT, CONTRACT,
37: * OR OTHERWISE, SHALL FLL BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
38: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL
39: * DAMAGES OF ANY CHARACTER, INCLUDING, WITHOUT LIMITATION, DAMAGES
40: * ARISING OUT OF OR RELATING TO THE SOFTWARE OR THIS AGREEMENT, DAMAGES
41: * FOR LOSS OF GOODWILL, WORK STOPPAGE, OR LOSS OF DATA, OR FOR ANY
42: * DAMAGES, EVEN IF FLL SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF
43: * SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. EVEN IF A PART
44: * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY
45: * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
46: * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
47: *
1.3 ! noro 48: * $OpenXM: OpenXM_contrib2/asir2000/lib/bgk,v 1.2 2000/08/21 08:31:40 noro Exp $
1.2 noro 49: */
1.1 noro 50: /* examples for groebner basis computations by Boege, Gebauer, Kredel */
51:
52: /* $(hairer,runge-kutta 1,05.11.83)
53: d=q
54: r=d(c2,c3,b3,b2,b1,a21,a32,a31)
55: opt=10 */
56: Hairer1 = [
57: [a31,a32,a21,b1,b2,b3,c3,c2],[
58: (+c2-a21),
59: (+c3-a31-a32),
60: (+b1+b2+b3-1),
61: (+b2*c2+b3*c3-1/2),
62: (+b2*c2^2+b3*c3^2-1/3),
63: (+b3*a32*c2-1/6)
64: ]]$
65:
66: /*$(hairer,runge-kutta*2,05.11.1983)
67: d=q
68: r=d(c2,c3,c4,b4,b3,b2,b1,a21,a31,a32,a41,a42,a43)
69: opt=10*/
70: Hairer2 = [
71: /* [a43,a42,a41,a32,a31,a21,b1,b2,b3,b4,c4,c3,c2],[ */
72: [a21,a31,a41,b1,b2,a42,a32,a43,b3,b4,c4,c3,c2],[
73: (+b1+b2+b3+b4-1),
74: (+b2*c2+b3*c3+b4*c4-1/2),
75: (+b2*c2^2+b3*c3^2+b4*c4^2-1/3),
76: (+b3*a32*c2+b4*a42*c2+b4*a43*c3-1/6),
77: (+b2*c2^3+b3*c3^3+b4*c4^3-1/4),
78: (+b3*c3*a32*c2+b4*c4*a42*c2+b4*c4*a43*c3-1/8),
79: (+b3*a32*c2^2+b4*a42*c2^2+b4*a43*c3^2-1/12),
80: (+b4*a43*a32*c2-1/24),
81: (+c2-a21),
82: (+c3-a31-a32),
83: (+c4-a41-a42-a43)
84: ]]$
85:
86:
87: /*$(hairer,runge-kutta 3,10.11.1983)
88: d=q
89: r=d(c2,c3,c4,c5,b2,b3,b4,b5,a32,a42,a43,a52,a53,a54)
90: opt=g10*/
91: Hairer3 = [
92: /* [a54,a53,a52,a43,a42,a32,b5,b4,b3,b2,c5,c4,c3,c2], */
93: [b2,b3,b4,b5,a52,a53,a42,a54,a32,a43,c5,c4,c3,c2],
94: [
95: (+b2*c2+b3*c3+b4*c4+b5*c5-1/2),
96: (+b2*c2^2+b3*c3^2+b4*c4^2+b5*c5^2-1/3),
97: (+b3*a32*c2+b4*a42*c2+b4*a43*c3+b5*a52*c2+b5*a53*c3+b5*a54*c4-1/6),
98: (+b2*c2^3+b3*c3^3+b4*c4^3+b5*c5^3-1/4),
99: (+b3*c3*a32*c2+b4*c4*a42*c2+b4*c4*a43*c3+b5*c5*a52*c2+b5*c5*a53*c3+b5*c5*a54*c4-1/8),
100: (+b3*a32*c2^2+b4*a42*c2^2+b4*a43*c3^2+b5*a52*c2^2+b5*a53*c3^2+b5*a54*c4^2-1/12),
101: (+b4*a43*a32*c2+b5*a53*a32*c2+b5*a54*a42*c2+b5*a54*a43*c3-1/24),
102: (+b2*c2^4+b3*c3^4+b4*c4^4+b5*c5^4-1/5),
103: (+b3*c3^2*a32*c2+b4*c4^2*a42*c2+b4*c4^2*a43*c3+b5*c5^2*a52*c2+b5*c5^2*a53*c3+b5*c5^2*a54*c4-1/10),
104: (+b3*c2^2*a32*c3+b4*c2^2*a42*c4+b4*c3^2*a43*c4+b5*c2^2*a52*c2+b5*c3^2*a53*c5+b5*c4^2*a54*c5-1/15),
105: (+b4*c4*a43*a32*c2+b5*c5*a53*a32*c2+b5*c5*a54*a42*c2+b5*c5*a54*a43*c3-1/30),
106: (+b3*a32^2*c2^2+b4*a42^2*c2^2+2*b4*a42*c2*a43*c3+b4*a43^2*c3^2+b5*a52^2*c2^2+b5*a53^2*c3^2+b5*a54^2*c4^2+2*b5*a52*c2*a53*c3+2*b5*a52*c2*a54*c4+2*b5*a53*c3*a54*c4-1/20),
107: (+b3*a32*c2^3+b4*a42*c2^3+b4*a43*c3^3+b5*a52*c2^3+b5*a53*c3^3+b5*a54*c4^3-1/20),
108: (+b4*a43*c3*a32*c2+b5*a53*c3*a32*c2+b5*a54*c4*a42*c2+b5*a54*c4*a43*c3-1/40),
109: (+b4*a43*a32*c2^2+b5*a53*a32*c2^2+b5*a54*a42*c2^2+b5*a54*a43*c3^2-1/60),
110: (+b5*a54*a43*a32*c2-1/120)
111: ]]$
112:
113: /*$(hairer,runge-kutta 4,p=5 s=6,20.12.1983)
114: d=q
115: r=d(c2,c3,c4,c5,c6,b2,b3,b4,b5,b6,a32,a42,a43,a52,a53,
116: a54,a62,a63,a64,a65)
117: opt=oil*/
118: Hairer4 = [
119: [a65,a64,a63,a62,a54,a53,a52,a43,a42,a32,b6,b5,b4,b3,b2,c6,c5,c4,c3,c2,c51],[
120: (+b2*c2+b3*c3+b4*c4+b5*c5+b6*c6-1/2),
121: (+b2*c2^2+b3*c3^2+b4*c4^2+b5*c5^2+b6*c6^2-1/3),
122: (+b3*a32*c2+b4*a42*c2+b4*a43*c3+b5*a52*c2+b5*a53*c3+b6*a62*c2+b6*a63*c3+b6*a64*c4+b6*a65*c5+b5*a54*c4-1/6),
123: (+b2*c2^3+b3*c3^3+b4*c4^3+b5*c51^3+b6*c6^3-1/4),
124: (+b3*c3*a32*c2+b4*c4*a42*c2+b4*c4*a43*c3+b5*c5*a52*c2+b6*c6*a62*c2+b6*c6*a63*c3+b6*c6*a64*c4+b6*c6*a65*c5+b5*c5*a53*c3+b5*c5*a54*c4-1/8),
125: (+b3*a32*c2^2+b4*a42*c2^2+b4*a43*c3^2+b5*a52*c2^2+b6*a62*c2^2+b6*a63*c3^2+b6*a64*c4^2+b6*a65*c5^2+b5*a53*c3^2+b5*a54*c4^2-1/12),
126: (+b4*a43*a32*c2+b5*a53*a32*c2+b5*a54*a42*c2+b5*a54*a43*c3+b6*a63*a32*c2+b6*a64*a42*c2+b6*a64*a43*c3+b6*a65*a52*c2+b6*a65*a53*c3+b6*a65*a54*c4-1/24),
127: (+b2*c2^4+b3*c3^4+b4*c4^4+b5*c5^4+b6*c6^4-1/5),
128: (+b3*c3^2*a32*c2+b4*c4^2*a42*c2+b4*c4^2*a43*c3+b5*c5^2*a52*c2+b5*c5^2*a53*c3+b5*c5^2*a54*c4+b6*c6^2*a62*c2+b6*c6^2*a63*c3+b6*c6^2*a64*c4+b6*c6^2*a65*c5-1/10),
129: (+b3*c2^2*a32*c3+b4*c2^2*a42*c4+b4*c3^2*a43*c4+b5*c2^2*a52*c5+b5*c3^2*a53*c5+b5*c4^2*a54*c5+b6*c2^2*a62*c6+b6*c3^2*a63*c6+b6*c4^2*a64*c6+b6*c5^2*a65*c6-1/15),
130: (+b4*c4*a43*a32*c2+b5*c5*a53*a32*c2+b5*c5*a54*a42*c2+b5*c5*a54*a43*c3+b6*c6*a63*a32*c2+b6*c6*a64*a42*c2+b6*c6*a64*a43*c2+b6*c6*a65*a52*c2+b6*c6*a65*a53*c3+b6*c6*a65*a54*c4-1/30),
131: (+b3*a32^2*c2^2+b4*a42^2*c2^2+2*b4*a42*c2*a43*c3+b4*a43^2*c3^2+b5*a52^2*c2^2+b5*a53^2*c3^2+b5*a54^2*c4^2+2*b5*a52*c2*a53*c3+2*b5*a52*c2*a54*c4+2*b5*a53*c3*a54*c4+b6*a62^2*c2^2+b6*a63^2*c3^2+b6*a64^2*c4^2+b6*a65^2*c5^2+2*b6*a62*c2*a63*c3+2*b6*a62*c2*a64*c4+2*b6*a62*c2*a65*c5+2*b6*a63*c3*a64*c4+2*b6*a63*c3*a65*c5+2*b6*a64*c4*a65*c5-1/20),
132: (+b3*a32*c2^3+b4*a42*c2^3+b4*a43*c3^3+b5*a52*c2^3+b5*a53*c3^3+b5*a54*c4^3+b6*a62*c2^3+b6*a63*c3^3+b6*a64*c4^3+b6*a65*c5^3-1/20),
133: (+b4*a43*c3*a32*c2+b5*a53*c3*a32*c2+b5*a54*c4*a42*c2+b5*a54*c4*a43*c3+b6*a63*c3*a32*c2+b6*a64*c4*a42*c2+b6*a64*c4*a43*c3+b6*a65*c5*a52*c2+b6*a65*c5*a53*c3+b6*a65*c5*a54*c4-1/40),
134: (+b4*a43*a32*c2^2+b5*a53*a32*c2^2+b5*a54*a42*c2^2+b5*a54*a43*c3^2+b6*a63*a32*c2^2+b6*a63*a42*c2^2+b6*a64*a43*c3^2+b6*a65*a52*c2^2+b6*a65*a53*c3^2+b6*a65*a54*c4^2-1/60),
135: (+b5*a54*a43*a32*c2+b6*a64*a43*a32*c2+b6*a65*a53*a32*c2+b6*a65*a54*a42*c2+b6*a65*a54*a43*c3-1/20)
136: ]]$
137:
138: /*$(butcher,runge-kutta,20 1 1984 s=3 pt=4)
139: d=q
140: r=d(b,c2,c3,a,b3,b2,a32,b1)
141: opt=liope10*/
142: Butcher = [
143: [b1,a32,b2,b3,a,c3,c2,b],[
144: (b1+b2+b3
145: -(a+b)),
146: (b2*c2+b3*c3
147: -(1/2+1/2*b+b^2-a*b)),
148: (b2*c2^2+b3*c3^2
149: -(a*(1/3+b^2)-4/3*b-b^2-b^3)),
150: (b3*a32*c2
151: -(a*(1/6+1/2*b+b^2)-2/3*b-b^2-b^3)),
152: (b2*c2^3+b3*c3^3
153: -(1/4+1/4*b+5/2*b^2+3/2*b^3+b^4
154: -a*(b+b^3))),
155: (b3*c3*a32*c2
156: -(1/8+3/8*b+7/4*b^2+3/2*b^3+b^4
157: -a*(1/2*b+1/2*b^2+b^3))),
158: (b3*a32*c2^2
159: -(1/12+1/12*b+7/6*b^2+3/2*b^3+b^4
160: -a*(2/3*b+b^2+b^3))),
161: (1/24+7/24*b+13/12*b^2+3/2*b^3+b^4
162: -a*(1/3*b+b^2+b^3))
163: ]]$
164:
165: /*$(gerdt,10.10.84)
166: d=q
167: r=d(l1,l2,l3,l4,l5,l6,l7)
168: opt=oil pe10*/
169: Gerdt = [
170: [l7,l6,l5,l4,l3,l2,l1],[
171: (l1*(l4-1/2*l5+l6)),
172: ((2/7*l1^2-l4)*(-10*l1+5*l2-l3)),
173: ((2/7*l1^2-l4)*(3*l4-l5+l6)),
174: ((-2*l1^2+l1*l2+2*l1*l3-l2^2-7*l5+21*l6) *(-3*l1+2*l2)+21*(7*l7-2*l1*l4+3/7*l1^3)),
175: ((-2*l1^2+l1*l2+2*l1*l3-l2^2-7*l5+21*l6) *(2*l4-2*l5)+(7*l7-2*l1*l4+3/7*l1^3) *(-45*l1+15*l2-3*l3)),
176: (2*(-2*l1^2+l1*l2+2*l1*l3-l2^2-7*l5+21*l6) *l7+(7*l7-2*l1*l4+3/7*l1^3)* (12*l4-3*l5+2*l6)),
177: ((l1*(5*l1-3*l2+l3))* (2*l2-l1) +7*(l1*(2*l6-4*l4))),
178: ((l1*(5*l1-3*l2+l3))* l3+7*(l1*(2*l6-4*l4))),
179: ((l1*(5*l1-3*l2+l3))* (-2*l4-2*l5)+(l1*(2*l6-4*l4))* (2*l2-8*l1)+84*1/2*l1*l7),
180: ((l1*(5*l1-3*l2+l3))* (8/3*l5+6*l6)+(l1*(2*l6-4*l4))* (11*l1-17/3*l2+5/3*l3)-168*1/2*l1*l7),
181: (15*l7* (l1*(5*l1-3*l2+l3)) +(l1*(2*l6-4*l4))*(5*l4-2*l5) +1/2*l1*l7*(-120*l1+30*l2-6*l3)),
182: (-3*(l1*(5*l1-3*l2+l3))* l7+(l1*(2*l6-4*l4))* (-1/2*l4+1/4*l5-1/2*l6)+1/2*l1*l7* (24*l1-6*l2)),
183: (3*(l1*(2*l6-4*l4))* l7+1/2*l1*l7* (40*l4-8*l5+4*l6))
184: ]]$
185:
186:
187: /*$(raksanyi 1,1983 rational*functions.)
188: d=f(a1,a2,a3,a4)
189: r=(x1,x2,x3,x4)
190: opt=oil*/
191: Raksanyi = [
192: [x4,x3,x2,x1],[
193: (x4-(a4-a2)),
194: (x1+x2+x3+x4-(a1+a3+a4)),
195: (x1*x3+x1*x4+x2*x3+x3*x4-(a1*a4+a1*a3+a3*a4)),
196: (x1*x3*x4-(a1*a3*a4))
197: ]]$
198:
199:
200: /*$(rose,general equilibrium model,1984)
201: d=q
202: r=d(u3,u4,a46)
203: opt=iog*/
204: Rose = [
205: [u3,u4,a46],[
206: /*[a46,u4,u3],[*/
207: (u4^4-20/7*a46^2),
208: (a46^2*u3^4+7/10*a46*u3^4+7/48*u3^4-50/27
209: *a46^2-35/27*a46-49/216),
210: (a46^5*u4^3+7/5*a46^4*u4^3+609/1000*a46^3
211: *u4^3+49/1250*a46^2*u4^3-27391/800000*a46*u4^3
212: -1029/160000*u4^3+3/7*a46^5*u3*u4^2+3/5*a46^6
213: *u3*u4^2+63/200*a46^3*u3*u4^2+147/2000*a46^2
214: *u3*u4^2+4137/800000*a46*u3*u4^2-7/20*a46^4
215: *u3^2*u4-77/125*a46^3*u3^2*u4-23863/60000*a46^2
216: *u3^2*u4-1078/9375*a46*u3^2*u4-24353/1920000
217: *u3^2*u4-3/20*a46^4*u3^3-21/100*a46^3*u3^3
218: -91/800*a46^2*u3^3-5887/200000*a46*u3^3
219: -343/128000*u3^3)
220: ]]$
221:
222:
223:
224: /*$(university of waterloo,19.03,1984)
225: d=q
226: r=d(a0,a2,a3,a4,a5,b0,b1,b2,b3,b4,b5,c0,c1,c2,c3,c4,c5)
227: opt=oil*pe10*/
228: Waterloo = [
229: [c5,c4,c3,c2,c1,c0,b5,b4,b3,b2,b1,b0,a5,a4,a3,a2,a0],[
230: (a4*b4),
231: (a5*b1+b5+a4*b3+a3*b4),
232: (a2*b2),
233: (a5*b5),
234: (a0*b2+b2+a4*b2+a2*b4+c2+a2*b0+a2*b1),
235: (a0*b0+a0*b1+a0*b4+a3*b2+b0+b1+b4+a4*b0 +a4*b1 +a2*b5+a4*b4+c1+c4+a5*b2+a2*b3+c0),
236: (a3*b0+a0*b3+a0*b5+a5*b0+b3+b5+a5*b4+a4*b3+ a4*b5+a3*b4+a5*b1+a3*b1+c3+c5-1),
237: (a5*b3+a5*b5+a3*b5+a3*b3),
238: (a5*b3+2*a5*b5+a3*b5),
239: (a0*b5+a5*b0+a3*b4+2*a5*b4+a5*b1+b5+a4*b3 +2*a4*b5+c5),
240: (a4*b0+2*a4*b4+a2*b5+b4+a4*b1+a5*b2+a0*b4 +c4),
241: (a2*b4+a4*b2),
242: (a4*b5+a5*b4),
243: (2*a3*b3+a5*b3+a3*b5),
244: (c3+a0*b3+2*b3+b5+a4*b3+a3*b0+2*a3*b1+ a5*b1+a3*b4),
245: (c1+a0*b1+2*b1+a4*b1+a2*b3+b0+a3*b2+b4),
246: (a2*b1+b2),
247: (a5*b3+a3*b5),
248: (b4+a4*b1)
249: ]]$
250:
251:
252: /*$(trinks 1,ideal a. 09.12.1983)
253: d=q
254: r=d(b,s,t,z,p,w)
255: opt=1*/
256: Trinks1 = [
257: /*[z,t,w,b,p,s],[*/
258: [w,p,z,t,s,b],[
259: (+45*p+35*s-165*b-36),
260: (+35*p+40*z+25*t-27*s),
261: (+15*w+25*p*s+30*z-18*t-165*b^2),
262: (-9*w+15*p*t+20*z*s),
263: (w*p+2*z*t-11*b^3),
264: (99*w-11*s*b+3*b^2)
265: ]]$
266:
267:
268: /*$(trinks 2,ideal p=a+f7lr.10.12.1983)
269: d=q
270: r=d(b,s,t,z,p,w)
271: opt=il*/
272: Trinks2 = [
273: [w,p,z,t,s,b],[
274: +45*p+35*s-165*b-36,
275: +35*p+40*z+25*t-27*s,
276: +15*w+25*p*s+30*z-18*t-165*b^2,
277: -9*w+15*p*t+20*z*s,
278: w*p+2*z*t-11*b^3,
279: 99*w-11*s*b+3*b^2,
280: b^2+33/50*b+2673/10000
281: ]]$
282:
283: Ge = [
284: [x,y,z,t,u,v,w],[
285: (w*(t-1/2*z+y)),
286: ((2/7*w^2-t)*(-10*w+5*v-u)),
287: ((2/7*w^2-t)*(3*t-z+y)),
288: ((-2*w^2+w*v+2*w*u-v^2-7*z+21*y) *(-3*w+2*v)+21*(7*x-2*w*t+3/7*w^3)),
289: ((-2*w^2+w*v+2*w*u-v^2-7*z+21*y) *(2*t-2*z)+(7*x-2*w*t+3/7*w^3) *(-45*w+15*v-3*u)),
290: (2*(-2*w^2+w*v+2*w*u-v^2-7*z+21*y) *x+(7*x-2*w*t+3/7*w^3)* (12*t-3*z+2*y)),
291: ((w*(5*w-3*v+u))* (2*v-w) +7*(w*(2*y-4*t))),
292: ((w*(5*w-3*v+u))* u+7*(w*(2*y-4*t))),
293: ((w*(5*w-3*v+u))* (-2*t-2*z)+(w*(2*y-4*t))* (2*v-8*w)+84*1/2*w*x),
294: ((w*(5*w-3*v+u))* (8/3*z+6*y)+(w*(2*y-4*t))* (11*w-17/3*v+5/3*u)-168*1/2*w*x),
295: (15*x* (w*(5*w-3*v+u)) +(w*(2*y-4*t))*(5*t-2*z) +1/2*w*x*(-120*w+30*v-6*u)),
296: (-3*(w*(5*w-3*v+u))* x+(w*(2*y-4*t))* (-1/2*t+1/4*z-1/2*y)+1/2*w*x* (24*w-6*v)),
297: (3*(w*(2*y-4*t))* x+1/2*w*x* (40*t-8*z+4*y))
298: ]]$
299: end$
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>