Sponsored links: Algebra eBooks
 

Related

hipow-is-length-split-sqrt-string

answer: x-2*sqrt(x)-8=0;

hipow(answer,x);

length(split(string(a...

Calculate

hipow-num-reveal-sqrt

reveal((sqrt(h+3)-sqr...

hipow(num((sqrt(h+3)-...

Calculate

hipow-is-lopow

eq:x*4;

is(lopow(eq,x)=1);

is(hipow(eq,x)=1);

Calculate

hipow

hipow(x^2*3*(x+3),2);

Calculate

hipow-listp-part-reveal

hh: [x=2,y=4];

listp(hh);

is(hipow(hh[1],x)=0);

Calculate

hipow

hipow(-5/x^2,x,0);

Calculate

hipow-is-rhs

answer: x+y=2+z;

rhs(answer);

hipow(z,rhs(answer));

Calculate

hipow-is-length-split-sqrt-string

answer: x-2*sqrt(x)-8=0;

hipow(answer,x)=1;

length(split(string(a...

Calculate

hipow-is-lopow

eq:x*4;

is(lopow(eq,x)=1);

is(hipow(eq,x)=1);

Calculate

hipow-lopow

f: (a*x+b)/(c*x^2+d);

hipow(f,x);

lopow(f,x);

Calculate

hipow

Run Example
(%i1)get_deg_occ(eq,alist):=block(	[atomlistlen,deglist,occlist,i],	atomlistlen: length(alist),	deglist: makelist(0,ii,1,atomlistlen),	occlist: makelist(0,ii,1,atomlistlen),	for i:1 thru atomlistlen do (		deglist[i]: hipow(eq,alist[i]),		if deglist[i]>
0 then (			occlist[i]: 1		)	),	return([deglist,occlist]));
(%o1) get_deg_occ(eq, alist) := block([atomlistlen, deglist, occlist, i], 
atomlistlen : length(alist), deglist : makelist(0, ii, 1, atomlistlen), 
occlist : makelist(0, ii, 1, atomlistlen), 
for i thru atomlistlen do (deglist  : hipow(eq, alist ), 
                                  i                  i
if deglist  > 0 then occlist  : 1), return([deglist, occlist]))
          i                 i
(%i2) remove_col_row(dmatrix,omatrix,aelist,atomlistlen,eqlistlen,sumvalue):=block(	[degmatrix,occmatrix,llist,llistlen,latomlistlen,leqlistlen,ret,pos,i],	degmatrix: copymatrix(dmatrix),	occmatrix: copymatrix(omatrix),	llist: copylist(aelist),	latomlistlen: atomlistlen,	leqlistlen: eqlistlen,	ret: false,	while ret=false do (		pos: 0,		for i:1 thru latomlistlen do (			if sum(occmatrix[ii,i],ii,1,leqlistlen)=sumvalue then (				if sumvalue=0 then (					print("Column ",i," has sum=0 (atom=",llist[i],") and must be removed")				)				else (					/* sumvalue=1 */					print("Column ",i," has sum=1 and must be removed")				),				pos: i,				return(pos)			)		),		if pos>
0 then (			if sumvalue=0 then (				/* remove column pos from degmatrix and occmatrix, remove pos-th atom from atomlist */				degmatrix: submatrix(degmatrix,pos),				occmatrix: submatrix(occmatrix,pos),				llist: delete(llist[pos],llist),				latomlistlen: length(llist)			)			else (				/* sumvalue=1 */				/* remove row pos from degmatrix and occmatrix, remove pos-th equation from eqlist */				degmatrix: submatrix(pos,degmatrix),				occmatrix: submatrix(pos,occmatrix),				llist: delete(llist[pos],llist),				leqlistlen: length(llist)			)		)		else (			ret: true		),		if sumvalue=0 and latomlistlen=0 then (			error("no atoms remaining")		)		else if sumvalue=1 and leqlistlen=0 then (			error("no equations remaining")		)	),	return([degmatrix,occmatrix,llist]));
(%o2) remove_col_row(dmatrix, omatrix, aelist, atomlistlen, eqlistlen, 
sumvalue) := block([degmatrix, occmatrix, llist, llistlen, latomlistlen, 
leqlistlen, ret, pos, i], degmatrix : copymatrix(dmatrix), 
occmatrix : copymatrix(omatrix), llist : copylist(aelist), 
latomlistlen : atomlistlen, leqlistlen : eqlistlen, ret : false, 
while ret = false do (pos : 0, for i thru latomlistlen 
do if sum(occmatrix     , ii, 1, leqlistlen) = sumvalue
                   ii, i
 then (if sumvalue = 0 then print("Column ", i, " has sum=0 (atom=", llist , 
                                                                          i
") and must be removed") else print("Column ", i, 
" has sum=1 and must be removed"), pos : i, return(pos)), 
if pos > 0 then (if sumvalue = 0 then (degmatrix : submatrix(degmatrix, pos), 
occmatrix : submatrix(occmatrix, pos), llist : delete(llist   , llist), 
                                                           pos
latomlistlen : length(llist)) else (degmatrix : submatrix(pos, degmatrix), 
occmatrix : submatrix(pos, occmatrix), llist : delete(llist   , llist), 
                                                           pos
leqlistlen : length(llist))) else ret : true, 
if (sumvalue = 0) and (latomlistlen = 0) then error("no atoms remaining")
 else (if (sumvalue = 1) and (leqlistlen = 0)
 then error("no equations remaining"))), return([degmatrix, occmatrix, llist]))
(%i3) pdesys2pde(alist,atlist,elist,etlist):=block(	[atomlist,atomtlist,eqlist,eqtlist,atomlistlen,atomtlistlen,eqlistlen,eqtlistlen,degmatrix,occmatrix,deglist,occlist,i,j,deg,ret,pos,neqlist,neqlistlen,nneqlist],	eqlist: copylist(elist),	eqtlist: copy(etlist),	atomlist: copylist(alist),	atomtlist: copylist(atlist),	eqlistlen: length(eqlist),	eqtlistlen: length(eqtlist),	atomlistlen: length(atomlist),	atomtlistlen: length(atomtlist),	/* for each equation, get the highest degree for each t-atom */	degmatrix: matrix(),	/* for each atom, get the number of occurrences in the equation set */	occmatrix: matrix(),	for i:1 thru eqtlistlen do (		[deglist,occlist]: get_deg_occ(eqtlist[i],atomtlist),		degmatrix: addrow(degmatrix,deglist),		occmatrix: addrow(occmatrix,occlist)	),print("Start: ",degmatrix),print("Start: ",occmatrix),return(0),	/* remove (recursively) all rows, whose sum is 1, that is, all equation containing atom occuring only once */	[degmatrix,occmatrix,eqlist]: remove_col_row(degmatrix,occmatrix,eqlist,atomlistlen,eqlistlen,1),	eqlistlen: length(eqlist),/*	ret: false,	while ret=false do (		pos: 0,		for i:1 thru atomlistlen do (			if sum(occmatrix[ii,i],ii,1,eqlistlen)=1 then (				print("Column ",i," has sum=1 and must be removed"),				pos: i,				return(pos)			)		),		if pos>
0 then (			-- remove row pos from degmatrix and occmatrix, remove pos-th equation from eqlist --			degmatrix: submatrix(pos,degmatrix),			occmatrix: submatrix(pos,occmatrix),			eqlist: delete(eqlist[pos],eqlist),			eqlistlen: length(eqlist)		)		else (			ret: true		),		if eqlistlen=0 then (			error("no equations remaining")		)	),*/	/* now remove (recursively) all columns, whose sum is 0: these variables are not used */	[degmatrix,occmatrix,atomlist]: remove_col_row(degmatrix,occmatrix,atomlist,atomlistlen,eqlistlen,0),	atomlistlen: length(atomlist),/*	ret: false,	while ret=false do (		pos: 0,		for i:1 thru atomlistlen do (			if sum(occmatrix[ii,i],ii,1,eqlistlen)=0 then (				print("Column ",i," has sum=0 (atom=",atomlist[i],") and must be removed"),				pos: i,				return(pos)			)		),		if pos>
0 then (			/* remove column pos from degmatrix and occmatrix, remove pos-th atom from atomlist */			degmatrix: submatrix(degmatrix,pos),			occmatrix: submatrix(occmatrix,pos),			atomlist: delete(atomlist[pos],atomlist),			atomlistlen: length(atomlist)		)		else (			ret: true		),		if atomlistlen=0 then (			error("no atoms remaining")		)	),*//*	for i:atomlistlen thru 1 step -1 do (		if sum(occmatrix[ii,i],ii,1,eqlistlen)=0 then (			-- remove column i from degmatrix and occmatrix, remove i-th atom from atomlist --			degmatrix: submatrix(degmatrix,i),			occmatrix: submatrix(occmatrix,i),			print("Column ",i," has sum=0 (atom=",atomlist[i],") and must be removed"),			atomlist: delete(atomlist[pos],atomlist)		)	),	atomlistlen: length(atomlist),*/print("End: ",atomlist),print("End: ",eqlist),print("End: ",degmatrix),print("End: ",occmatrix),return(0),	/* now, each atom exists in at least 2 equations */	/* reduce the set of equations, by eliminating the atoms starting by the highest derivative (x+t) */print("***"),	/* WWWHHH */	pos: atomlistlen,	neqlist: [],	for i:eqlistlen thru 1 step -1 do (		if occmatrix[i,pos]=1 then (print(i),			neqlist: append(neqlist,[eqlist[i]]),			/* remove row i from degmatrix and occmatrix */			degmatrix: submatrix(degmatrix,i),			occmatrix: submatrix(occmatrix,i)		)	),	nneqlist: [],	/* choose the data based on the degree! */	/* this is the basic variation: first equation is fixed */	for i:2 thru neqlistlen do (		nneqlist: append(nneqlist,[resultant(neqlist[1],neqlist[i],atomlist[pos])])	),	neqlist: copylist(nneqlist),	neqlistlen: length(neqlist),	atomlist: delete(atomlist[pos],atomlist),	atomlistlen: length(atomlist),	/* add row to degmatrix and occmatrix */	for i:1 thru neqlistlen do (		[deglist,occlist]: get_deg_occ(neqlist[i],atomlist),		degmatrix: addrow(degmatrix,deglist),		occmatrix: addrow(occmatrix,occlist)	),	/* now remove columns with sum=0 */	/* WWWHHH */	return(0));
(%o3) pdesys2pde(alist, atlist, elist, etlist) := 
block([atomlist, atomtlist, eqlist, eqtlist, atomlistlen, atomtlistlen, 
eqlistlen, eqtlistlen, degmatrix, occmatrix, deglist, occlist, i, j, deg, ret, 
pos, neqlist, neqlistlen, nneqlist], eqlist : copylist(elist), 
eqtlist : copy(etlist), atomlist : copylist(alist), 
atomtlist : copylist(atlist), eqlistlen : length(eqlist), 
eqtlistlen : length(eqtlist), atomlistlen : length(atomlist), 
atomtlistlen : length(atomtlist), degmatrix : matrix(), occmatrix : matrix(), 
for i thru eqtlistlen do ([deglist, occlist] : 
get_deg_occ(eqtlist , atomtlist), degmatrix : addrow(degmatrix, deglist), 
                   i
occmatrix : addrow(occmatrix, occlist)), print("Start: ", degmatrix), 
print("Start: ", occmatrix), return(0), 
[degmatrix, occmatrix, eqlist] : remove_col_row(degmatrix, occmatrix, eqlist, 
atomlistlen, eqlistlen, 1), eqlistlen : length(eqlist), 
[degmatrix, occmatrix, atomlist] : remove_col_row(degmatrix, occmatrix, 
atomlist, atomlistlen, eqlistlen, 0), atomlistlen : length(atomlist), 
print("End: ", atomlist), print("End: ", eqlist), print("End: ", degmatrix), 
print("End: ", occmatrix), return(0), print("***"), pos : atomlistlen, 
neqlist : [], for i from eqlistlen step - 1 thru 1 
do if occmatrix       = 1 then (print(i), 
               i, pos
neqlist : append(neqlist, [eqlist ]), degmatrix : submatrix(degmatrix, i), 
                                 i
occmatrix : submatrix(occmatrix, i)), nneqlist : [], 
for i from 2 thru neqlistlen do nneqlist : 
append(nneqlist, [resultant(neqlist , neqlist , atomlist   )]), 
                                   1         i          pos
neqlist : copylist(nneqlist), neqlistlen : length(neqlist), 
atomlist : delete(atomlist   , atomlist), atomlistlen : length(atomlist), 
                          pos
for i thru neqlistlen do ([deglist, occlist] : 
get_deg_occ(neqlist , atomlist), degmatrix : addrow(degmatrix, deglist), 
                   i
occmatrix : addrow(occmatrix, occlist)), return(0))
(%i4) pdesys2pde([v,vx,vxx,vxxx],[vt,vxt],[vt-ux*vxx,utt-vt*vx-v*vxt,vxt-uxx*vxx-ux*vxxx],[ut-v*vx,uxt-vx^2-v*vxx,uxxt-3*vx*vxx-v*vxxx]);
        [ 0  0 ]
        [      ]
Start:  [ 0  0 ] 
        [      ]
        [ 0  0 ]
        [ 0  0 ]
        [      ]
Start:  [ 0  0 ] 
        [      ]
        [ 0  0 ]
(%o4)                                  0
(%i5) 
Run Example
bellc(n,x):=block(	[h,i,j],	h[i,j]:=binomial(j-1,i-1)*x[j-i+1]-kron_delta(j-i+1,0),	return(expand(determinant(genmatrix(h,n,n)))));
(%o1) bellc(n, x) := block([h, i, j], h     := 
                                       i, j
binomial(j - 1, i - 1) x          - kron_delta(j - i + 1, 0), 
                        j - i + 1
return(expand(determinant(genmatrix(h, n, n)))))
(%i2) bellp(n,k,x):=block(	[cpol,ppol,i],	cpol: bellc(n,x),	ppol: 0,	for i:1 thru length(cpol) do (	    tmp: part(cpol,i),	    print(tmp),	    deglist: makelist(hipow(tmp,x[ii]),ii,1,n),	    v: sum(deglist[ii],ii,1,n),	    print(deglist,v),	    if v=k then (	        ppol: ppol+tmp	    )	),		return(ppol));
(%o2) bellp(n, k, x) := block([cpol, ppol, i], cpol : bellc(n, x), ppol : 0, 
for i thru length(cpol) do (tmp : part(cpol, i), print(tmp), 
deglist : makelist(hipow(tmp, x  ), ii, 1, n), v : sum(deglist  , ii, 1, n), 
                               ii                             ii
print(deglist, v), if v = k then ppol : ppol + tmp), return(ppol))
(%i3) bellp(5,3,x);
x  
 5
[0, 0, 0, 0, 1] 1 
5 x  x  
   1  4
[1, 0, 0, 1, 0] 2 
10 x  x  
    2  3
[0, 1, 1, 0, 0] 2 
    2
10 x  x  
    1  3
[2, 0, 1, 0, 0] 3 
       2
15 x  x  
    1  2
[1, 2, 0, 0, 0] 3 
    3
10 x  x  
    1  2
[3, 1, 0, 0, 0] 4 
 5
x  
 1
[5, 0, 0, 0, 0] 5 
                                  2             2
(%o3)                         10 x  x  + 15 x  x
                                  1  3       1  2
(%i4) 
Run Example
bellc(n,x):=block(	[h,i,j],	h[i,j]:=binomial(j-1,i-1)*x[j-i+1]-kron_delta(j-i+1,0),	return(expand(determinant(genmatrix(h,n,n)))));
(%o1) bellc(n, x) := block([h, i, j], h     := 
                                       i, j
binomial(j - 1, i - 1) x          - kron_delta(j - i + 1, 0), 
                        j - i + 1
return(expand(determinant(genmatrix(h, n, n)))))
(%i2) bellp(n,k,x):=block(	[cpol,ppol,i,tmp,deglist],	cpol: bellc(n,x),	ppol: 0,	for i:1 thru length(cpol) do (	    tmp: part(cpol,i),	    deglist: makelist(hipow(tmp,x[ii]),ii,1,n),	    if sum(deglist[ii],ii,1,n)=k then (	        ppol: ppol+tmp	    )	),		return(ppol));
(%o2) bellp(n, k, x) := block([cpol, ppol, i, tmp, deglist], 
cpol : bellc(n, x), ppol : 0, for i thru length(cpol) 
do (tmp : part(cpol, i), deglist : makelist(hipow(tmp, x  ), ii, 1, n), 
                                                        ii
if sum(deglist  , ii, 1, n) = k then ppol : ppol + tmp), return(ppol))
              ii
(%i3) belltransform(n,k,x,y,a):=block(    [subslist,pol,pollist],        subslist: makelist(x[ii]=sum(a[ii,jj]*y[jj],jj,1,ii),ii,1,n),    pol: expand(subst(subslist, bellp(n,k,x))),    print(bellp(n,1,y)),    pollist: makelist(bellp(n,ii,y),ii,1,n),    print(pollist));
(%o3) belltransform(n, k, x, y, a) := block([subslist, pol, pollist], 
subslist : makelist(x   = sum(a       y  , jj, 1, ii), ii, 1, n), 
                     ii        ii, jj  jj
pol : expand(subst(subslist, bellp(n, k, x))), print(bellp(n, 1, y)), 
pollist : makelist(bellp(n, ii, y), ii, 1, n), print(pollist))
(%i4) belltransform(6,3,x,y,a);
0 
[0, 0, 0, 0, 0, 0] 
(%o4)                         [0, 0, 0, 0, 0, 0]
(%i5) bellp(6,3,y);
(%o5)                                  0
(%i6) 
[addrow,append,block,copylist,copymatrix,delete,error,expand,hipow,length,makelist,print,resultant,return,row,submatrix] [addrow,append,block,copylist,copymatrix,delete,error,hipow,length,makelist,print,remove,resultant,return,submatrix] [addrow,append,block,copylist,copymatrix,delete,error,hipow,length,makelist,print,resultant,return,row,submatrix] [addrow,block,copylist,copymatrix,delete,error,hipow,length,makelist,print,return,row,submatrix] [append,block,do,expand,hipow,length,makelist,part,print,product,rat,return,sqrt,unique] [append,block,ev,expand,hipow,ratsimp,simp] [append,hipow,length,makelist,return] [binomial,block,delta,determinant,divide,do,expand,genmatrix,hipow,kron_delta,lambda,makelist,part,print,return,subst] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,lambda,length,makelist,part,return,subst,sum] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,lambda,length,makelist,part,return,sum] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,lambda,makelist,part,print,return,subst] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,makelist,part,print,return,subst] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,makelist,part,print,return,sum] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,makelist,part,print,return] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,makelist,part,return] [binomial,block,delta,determinant,expand,genmatrix,hipow,kron_delta,listofvars,makelist,part,sum] [binomial,block,delta,determinant,expand,genmatrix,hipow,length,makelist,part,subst,sum] [block,cos,hipow,is] [block,determinant,expand,hipow,length,makelist,matrix,part,sum] [block,equal,ev,hipow,if,is,or,radcan,subst] [block,equal,hipow,if,is,or,radcan,subst] [block,expand,hipow,length,listofvars,makelist,part,sum] [block,expand,hipow,length,makelist,part,print,sum] [block,expand,hipow,length,makelist,part,sum] [block,expand,hipow,listofvars,makelist,part,print,sum] [block,expand,hipow,listofvars,makelist,part,sum] [coeff,do,ev,expand,hipow,linsolve,nterms,num,part,print,while] [coeff,do,ev,expand,hipow,linsolve,nterms,num,part,while] [coeff,do,ev,expand,hipow,linsolve,nterms,part,print,while] [coeff,do,ev,expand,hipow,linsolve,print,while] [coeff,expand,hipow,lhs,makelist,num,rat,resultant,rhs,subst,sum] [coeff,expand,hipow,makelist,num,rat,solve,subst,sum] [coeff,hipow,makelist,num,rat,solve,subst,sum] [coeff,hipow,makelist,num,rat,subst] [coeff,hipow] [concat,disp,expand,hipow,listofvars,makelist,part,ratcoef,slength,string,subst,sum,taylor] [cos,hipow,is] [diff,factor,gcd,hipow,is,linel,resultant,sqfr,var] [hipow,is,length,reveal,solve,split,sqrt,string] [hipow,is,length,split,sqrt,string] [hipow,is,lhs,part,rhs] [hipow,is,lopow,subst] [hipow,is,lopow] [hipow,is,rhs] [hipow,is,subst] [hipow,is] [hipow,length] [hipow,part] [hipow,taylor,taytorat] [hipow]

Related Help

Help for Hipow