I am trying to do a partial fraction expansion as follows
var('z')
theta_c=1.4
k=10
T=0.1
D=1
G=k*((2*T-1+exp(-2*T))*z+1-exp(-2*T)-2*T*exp(-2*T))/(z-1)/(z-exp(-2*T))
theta_a=G*theta_c
theta_a.partial_fraction(z)
sage returns the following error traceback:
--
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_36.py", line 5, in <module>
theta_a.partial_fraction(z)
File "", line 1, in <module>
File "expression.pyx", line 5035, in
sage.symbolic.expression.Expression.partial_fraction
(sage/symbolic/expression.cpp:20197)
File
"/home/bryan/Software/sage/sage-4.2-linux-Ubuntu_9.04-x86_64-Linux/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
line 1404, in __call__
return self._obj.parent().function_call(self._name, [self._obj] +
list(args), kwds)
File
"/home/bryan/Software/sage/sage-4.2-linux-Ubuntu_9.04-x86_64-Linux/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
line 1312, in function_call
return self.new(s)
File
"/home/bryan/Software/sage/sage-4.2-linux-Ubuntu_9.04-x86_64-Linux/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
line 1096, in new
return self(code)
File
"/home/bryan/Software/sage/sage-4.2-linux-Ubuntu_9.04-x86_64-Linux/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
line 1031, in __call__
return cls(self, x, name=name)
File
"/home/bryan/Software/sage/sage-4.2-linux-Ubuntu_9.04-x86_64-Linux/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
line 1447, in __init__
raise TypeError, x
TypeError: Error executing code in Maxima
CODE:
sage35 : partfrac(sage33,sage34)$
Maxima ERROR:
Inverse of zero divisor?
--
If I enter this directly into Maxima I get the expected result:
(%i5) expr:1.4*(.1873*z+.1752)/(z-1)/(z-.8187);
1.4 (0.1873 z + 0.1752)
(%o5) -----------------------
(z - 1) (z - 0.8187)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---