Bryan Wilcox wrote:
> Hi all,
>
> Sorry for the slow response. I got inundated with work and couldn't
> get back to this until now.
>
> If I'm following this correctly the state of the keepfloat environment
> variable changes the results of the computation. If this variable is
> kept as true, per Sage's default and for the reasons in
> http://trac.sagemath.org/sage_trac/ticket/2400, something breaks. If
> 'keepfloat' is set to false and Maxima is allowed to approximate a
> float with a rational number, the computation finishes without
> throwing an error.
>
> Is it reasonable to expect that Maxima should be able to handle
> partial fractions with floats?
>
> I'm working on downloading and compiling source codes. First time for
> me for these projects. Let me know how I might be of help.
>
I don't know. However, Sage can handle such things; maybe we should be
converting to Sage to do these sorts of computations? Note that Sage
can carry them out to whatever precision is necessary.
sage: f=RR['z'].fraction_field()
sage: theta_a_RR=f(theta_a.numerator())/f(theta_a.denominator())
sage: theta_a_RR
(0.262230543091745*z + 0.245323348289905)/(z^2 - 1.81873075307798*z +
0.818730753077982)
sage: theta_a_RR.partial_fraction_decomposition()
(0,
[2.80000000000001/(z - 0.999999999999999),
-2.53776945690827/(z - 0.818730753077982)])
Thanks,
Jason
P.S. Why doesn't this work? It seems like it should, given that theta_a
definitely can be converted to something in f.
sage: f(theta_a)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (838, 0))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (838, 0))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/grout/<ipython console> in <module>()
/home/grout/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:4241)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so
in sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3109)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so
in sage.structure.coerce_maps._call_ (sage/structure/coerce_maps.c:3000)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/rings/fraction_field.pyc
in _element_constructor_(self, x, coerce)
407 return self._element_class(self, x.numerator(),
x.denominator())
408 return self._element_class(self, x, 1,
--> 409 coerce=coerce, reduce = self.is_exact())
410
411 def construction(self):
/home/grout/sage/local/lib/python2.6/site-packages/sage/rings/fraction_field_element.so
in sage.rings.fraction_field_element.FractionFieldElement.__init__
(sage/rings/fraction_field_element.c:1825)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:4241)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so
in sage.structure.coerce_maps.NamedConvertMap._call_
(sage/structure/coerce_maps.c:4074)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression._polynomial_
(sage/symbolic/expression.cpp:17658)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression.polynomial
(sage/symbolic/expression.cpp:17419)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/symbolic/expression_conversions.pyc
in polynomial(ex, base_ring, ring)
987 converter = PolynomialConverter(ex, base_ring=base_ring,
ring=ring)
988 res = converter()
--> 989 return converter.ring(res)
990
991 ##############
/home/grout/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:4241)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so
in sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3109)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so
in sage.structure.coerce_maps._call_ (sage/structure/coerce_maps.c:3000)()
/home/grout/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/polynomial_ring.pyc
in _element_constructor_(self, x, check, is_gen, construct, **kwds)
304 x = x.numerator() *
x.denominator().inverse_of_unit()
305 else:
--> 306 raise TypeError, "denominator must be a unit"
307
308 elif isinstance(x, pari_gen):
TypeError: denominator must be a unit
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---