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

Edit detail for SandBoxCollect revision 1 of 7

1 2 3 4 5 6 7
Editor: Bill page
Time: 2014/09/24 02:09:16 GMT+0
Note:

changed:
-
**Collect terms in x with given factor k.**
\begin{axiom}
QF==>PolynomialCategoryQuotientFunctions(IndexedExponents Kernel Expression Integer,_
                                         Kernel Expression Integer,_
                                         Integer,_
                                         SparseMultivariatePolynomial(Integer,Kernel Expression Integer),_
                                         Expression Integer)
--collect(x:Expression Integer,k:Kernel Expression Integer):Expression Integer ==
collect(x,k) ==
  n1:=univariate(x::Expression Integer,k::Kernel Expression Integer)$QF
  n2:=(leadingMonomial numer n1)/(denom n1)
  n3:=multivariate(n2,k::Kernel Expression Integer)$QF
  n4:=factor(numer n3)/factor(denom n3)
--
collector(x:Expression Integer,k:Expression Integer):List Expression Integer ==
  s1:=solve(%k=k,variables(k)(1))
  x2:=eval(collect(eval(x,s1),%k::Expression Integer::Kernel Expression Integer)::Expression Integer,%k=k)
  x2=0 => []
  concat(x2,collector(x-x2,k))
--
collector((r2-r1+1)^3,(r2-r1)::Expression Integer)
test(sum % = (r2-r1+1)^3)
\end{axiom}

Collect terms in x with given factor k.

fricas
QF==>PolynomialCategoryQuotientFunctions(IndexedExponents Kernel Expression Integer,_
                                         Kernel Expression Integer,_
                                         Integer,_
                                         SparseMultivariatePolynomial(Integer,Kernel Expression Integer),_
                                         Expression Integer)
Type: Void
fricas
--collect(x:Expression Integer,k:Kernel Expression Integer):Expression Integer ==
collect(x,k) ==
  n1:=univariate(x::Expression Integer,k::Kernel Expression Integer)$QF
  n2:=(leadingMonomial numer n1)/(denom n1)
  n3:=multivariate(n2,k::Kernel Expression Integer)$QF
  n4:=factor(numer n3)/factor(denom n3)
Type: Void
fricas
--
collector(x:Expression Integer,k:Expression Integer):List Expression Integer ==
  s1:=solve(%k=k,variables(k)(1))
  x2:=eval(collect(eval(x,s1),%k::Expression Integer::Kernel Expression Integer)::Expression Integer,%k=k)
  x2=0 => []
  concat(x2,collector(x-x2,k))
Function declaration collector : (Expression(Integer),Expression( Integer)) -> List(Expression(Integer)) has been added to workspace.
Type: Void
fricas
--
collector((r2-r1+1)^3,(r2-r1)::Expression Integer)
fricas
Compiling function collect with type (Expression(Integer),Kernel(
      Expression(Integer))) -> Fraction(Factored(
      SparseMultivariatePolynomial(Integer,Kernel(Expression(Integer)))
      ))
fricas
Compiling function collector with type (Expression(Integer),
      Expression(Integer)) -> List(Expression(Integer))

\label{eq1}\begin{array}{@{}l}
\displaystyle
\left[{{{r 2}^{3}}-{3 \  r 1 \ {{r 2}^{2}}}+{3 \ {{r 1}^{2}}\  r 2}-{{r 1}^{3}}}, \:{{3 \ {{r 2}^{2}}}-{6 \  r 1 \  r 2}+{3 \ {{r 1}^{2}}}}, \: \right.
\
\
\displaystyle
\left.{{3 \  r 2}-{3 \  r 1}}, \: 1 \right] 
(1)
Type: List(Expression(Integer))
fricas
test(sum % = (r2-r1+1)^3)
There are no exposed library operations named sum having 1 argument(s) though there are 1 unexposed operation(s) with 1 argument(s). Use HyperDoc Browse, or issue )display op sum to learn more about the available operations.
Cannot find a definition or applicable library operation named sum with argument type(s) List(Expression(Integer))
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.