Regarding the 'feature' when the operator abs is applied to ps domain
elements, I agree with Rainer that taking the sign of the coefficient of
the lowest order term would be a quick fix when the coefficient is
numeric. When the coefficient is algebraic, abs could simply return abs
of its argument as it does for 'normal' algebraic expressions .
Alternatively abs could simply return abs of its argument; correct but
not very useful!
The first approach would have the desirable property that
abs(ps1*ps2) = abs(ps1)*abs(ps2)
but, of course, evaluations of the resulting power series at even
'small' values of the expansion variable would not necessarily be positive.
When the ps package was written (was it really 26 years ago?), the ideas
of representing power series by domain elements and using simulated lazy
evaluation (so that the series were extendible) were experimental. Prior
to that domain elements were always constant. The experiment was, I
think, only moderately successful and if I were writing the package now,
I would use some other representation (but retain the lazy evaluation
approach).
Although the ps code works reasonably well when the underlying domain is
constant (rational, complex, complex rational etc), the idea of
representing a bivariate power series as a univariate power series over
a univariate power series domain (etc.) opened a 'can of worms' as
there is no support in Reduce for parameterised domains.
Alan Barnes
On 07/02/2013 21:23, Rainer Schöpf wrote:
> The recent bug report
>
> https://sourceforge.net/p/reducealgebra/bugs/44/
>
> unconvered a problem with the abs operator: Applying the abs operator to certain
> domain elements yields inconsistent results, e.g. for domain mode ps or atensor.
>
> 
> 1: load atensor;
> 2: tensor a2;
>
> 3: a2(k,k);
>
> a2(k,k)
>
> 4: abs(ws);
>
> a2(k,k)
>
> 5: abs(ws);
>
>  a2(k,k)
> 
>
> The reason: all domain elements of type ps or atensor are considered positive
> (by virtue of the corresponding "minusp" function), so that abs always returns
> its argument.
>
> For ps, taking the sign of the constant term of a power series as "sign" of the
> whole series might be a solution.
>
> In general, the only solution I can think of is to add an optional "abs"
> property to a domain mode, pointing to a function that returns a sensible result
> (or an error).
>
> Rainer
>
> 
> Free NextGen Firewall Hardware Offer
> Buy your Sophos nextgen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophosd2dfeb
> _______________________________________________
> Reducealgebradevelopers mailing list
> Reducealgebradevelopers@...
> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers
>
