ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 30 Apr 2018 10:58:31 +0200"partial_fraction_decomposition" with possibly "complex roots", againhttps://ask.sagemath.org/question/42220/partial_fraction_decomposition-with-possibly-complex-roots-again/ Hi I come back to this question, even though it's been answered before, since I am still not able to make it work. I should mention maybe that I am just trying to teach undergraduate students to invert
rational Laplace transforms (for myself I am able to afford a Mathematica licence, but it would be nice to be able to show students that such simple things may be done nowadays for free). Following a previous answer, I tried
L = 2*(s + 3)/(3*s^2 + 13*s + 10)
Ks=FractionField(PolynomialRing(CC,names='s'))
Lr=Ks(L)
Of course, with quadratic rational roots, I could do this by hand, but the purpose here is to do it when you do not know the roots. The first two commands work, but the third has error message
TypeError: ('cannot convert {!r}/{!r} to an element of {}', 2*(s + 3)/(3*s^2 + 13*s + 10), 1.00000000000000, Fraction Field of Univariate Polynomial Ring in s over Complex Field with 53 bits of precision)
I should add that a different attempt which used to work last year
C=ComplexField(53);
dec=Frac(C['s'])(Lrs).partial_fraction_decomposition();
gets now same error message. So, this is probably due to an "improvement" of sageflorinMon, 30 Apr 2018 10:58:31 +0200https://ask.sagemath.org/question/42220/"partial_fraction_decomposition" with "complex roots"https://ask.sagemath.org/question/41893/partial_fraction_decomposition-with-complex-roots/ Hi six months ago I used a hint from Zimmerman's book
var('s')
L=2*(s + 3)/(3*s^2 + 13*s + 10)
C=ComplexField(53)
dec=Frac(C['s'])(L).partial_fraction_decomposition()
but this does not work anymore (see below). How to do this? Thanks
----> 2 dec=Frac(C['s'])(Lrs).partial_fraction_decomposition();
TypeError: ('cannot convert {!r}/{!r} to an element of {}', 2*(s + 3)/(3*s^2 + 13*s + 10), 1.00000000000000, Fraction Field of Univariate Polynomial Ring in s over Complex Field with 53 bits of precision)
/opt/sagemath-8.1/src/sage/structure/parent.pyx in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9641)()
937 if mor is not None:
938 if no_extra_args:
--> 939 return mor._call_(x)
940 else:
941 return mor._call_with_args(x, args, kwds)
/opt/sagemath-8.1/src/sage/structure/coerce_maps.pyx in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4928)()
152 print(type(C), C)
153 print(type(C._element_constructor), C._element_constructor)
--> 154 raise
155
156 cpdef Element _call_with_args(self, x, args=(), kwds={}):
/opt/sagemath-8.1/src/sage/structure/coerce_maps.pyx in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4796)()
147 cdef Parent C = self._codomain
148 try:
--> 149 return C._element_constructor(x)
150 except Exception:
151 if print_warnings:
/opt/sagemath-8.1/local/lib/python2.7/site-packages/sage/rings/fraction_field.py in _element_constructor_(self, x, y, coerce)
616 except AttributeError:
617 raise TypeError("cannot convert {!r}/{!r} to an element of {}",
--> 618 x0, y0, self)
619 try:
620 return self._element_class(self, x, y, coerce=coerce)
florinFri, 06 Apr 2018 21:42:27 +0200https://ask.sagemath.org/question/41893/