ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 02 Dec 2017 04:16:35 -0600can series make mistakes?https://ask.sagemath.org/question/39909/can-series-make-mistakes/ series seems to make errors . luckily, taylor works correctly.
start with L_F=(exp(-s)-1+s)/(s^2/2) (laplace transform of the "equilibrium" uniform density)
and switch to Pollaczek laplace transform L_F /(1- epsilon * L_F);
You can check that the moments expansions t, t1 differ
var('s');n=2
L_F=(exp(-s)-1+s)/(s^2/2) #satisfies L_F(s=0)=1
L_L=L_F/(1-L_F/3)
t = L_L.series(s,2*n+2)
t1= taylor(L_L,s,0,2*n+2)
print t1florinSat, 02 Dec 2017 04:16:35 -0600https://ask.sagemath.org/question/39909/comparing sets of roots of charpolyhttps://ask.sagemath.org/question/35729/comparing-sets-of-roots-of-charpoly/ I am missing something about how to compare list of roots.
During a small algorithm I need to know wether a matrix has or not complex eigenvalues. I did the following
A=matrix(QQ,[[1,2,1],[6,-1,0],[-1,-2,-1]])
a=(B.charpoly()).roots(ring= QQ, multiplicities=False)
b=(B.charpoly()).roots(ring= QQbar, multiplicities=False)
then a is the list [-4,0,3] and b is the list [3,0,-4].
I don't get the following :
set(a)==set(b)
return false while
set([-4,0,3])==set([3,0,-4])
return true.
Any help, either on the first pb (knowing that a QQ matrix has complex eigenvalues) or on the second would be greatly appreciated.
Cheers.Laurent BThu, 24 Nov 2016 14:15:42 -0600https://ask.sagemath.org/question/35729/How do you plot solutions of an O.D.E?https://ask.sagemath.org/question/24329/how-do-you-plot-solutions-of-an-ode/ One advantage of using technology is that often when a large number of problems are
solved, their solutions are compared and conjectures about general patterns can be dis-
covered and tested. Sage is capable of solving a variety of O.D.Eās. Use Sage to construct
a conjecture about the following:
(a) Compare the solutions of dy/dx + y = f(x) subject to y(0) = 0,
where f(x) = x, sin x, cos(x), and ex.
(b) Compare the solutions of dy/dx + y = x subject to y(0) = k,
where k = ā2, ā1, 0, 1, 0, 1, 2redshotzMon, 29 Sep 2014 17:16:33 -0500https://ask.sagemath.org/question/24329/Compare symbolic expressionshttps://ask.sagemath.org/question/10185/compare-symbolic-expressions/Following is the problem I am trying to solve:
I have multiple complex symbolic expressions f1(x1,x2,...,xn),f2(x1,x2,...,xn),...,fn(x1,x2,...,xn) which are functions of symbolic variables x1,x2,...,xn. I also have some constraints for the symbolic variables, e.g. 0 is smaller than x1, 2 is smaller than x2, x2 is integer, etc. How can I find out for two selected symbolic expressions which one is larger for given constraints?
I've tried something like:
<code> assume(0<x1,2<x2)
assume(x2,'integer')
bool(f1>f2) </code>
It seems to work for more simple symbolic expressions. For more complex symbolic expressions (where a solution definitely exists) SAGE seems not to be able to compare the expressions. Is there a way to overcome this?
KurtMMon, 03 Jun 2013 04:51:40 -0500https://ask.sagemath.org/question/10185/Compare elements of a recursive defined sequencehttps://ask.sagemath.org/question/10163/compare-elements-of-a-recursive-defined-sequence/I define the recursive sequence as:
A, b, c = var('A, b, c')
def Sequence_rec(k):
x = 0
for i in range(1,k+1):
x = x + (A - x)/((c-i+2)^b)
return x
For the parameters the assumptions are:
assume(A>0,c>0,b>0)
assume(c, 'integer')
I'm interested in the elements of Sequence_rec(k) with k<=c. The following relation has to be true for the defined sequence considering the given assumptions:
assume(c>2)
bool(Sequence_rec(4) > Sequence_rec(3))
But Sage computes it is false! The following plot shows the difference is positive:
plot((Sequence_rec(4) - Sequence_rec(3))(A=1,c=3),b,(0,100))
How can I force Sage to compare the elements of the sequence `bool(Sequence_rec(n+1) > Sequence_rec(n)) = true` for any positive integer n correctly? Thank you for your advice!
Kurt
KurtMWed, 29 May 2013 04:02:26 -0500https://ask.sagemath.org/question/10163/comparing in Pythonhttps://ask.sagemath.org/question/9477/comparing-in-python/I have the following function defined on a class:
> def __eq__(self,other):
> return self.get_object() == other.get_object() and str(self.get_genfunc()) ==
> str(other.get_genfunc())
When I use __cmp__ I get something weird.... What is the difference between cmp and eq?
SLOtoSFSun, 28 Oct 2012 11:01:51 -0500https://ask.sagemath.org/question/9477/Mac OS vs Ubuntu for high performance computinghttps://ask.sagemath.org/question/8011/mac-os-vs-ubuntu-for-high-performance-computing/Hi I am considering investing in a new PC which I'll be using Sage ( and R under Sage ) a lot and will be doing computations that will be intensive at times. I am considering either Mac Snow Leopard with a new quadcore MacBook or the latest Ubuntu running on a partition on a quad core Windows 7 machine. I would like to know what differences there might be running Sage on these two platforms, with special interest toward performance. I'm just getting involved with Sage but have to make a decision about hardware and OS very soon. Any info would be much appreciated.
DougDug_the_Math_GuyFri, 18 Mar 2011 10:35:33 -0500https://ask.sagemath.org/question/8011/Any way to define variables as constant?https://ask.sagemath.org/question/7768/any-way-to-define-variables-as-constant/I want to come up with a function that will return true when I compare $(x-1)^2+C$ and $x^2-2x+C$
where $C$ is an arbitrary constant. Any way that you know can do this ?
ShuWed, 17 Nov 2010 05:39:32 -0600https://ask.sagemath.org/question/7768/bool returns false with arcsin(x) and 2*arctan(x/(1+sqrt(1-x^2)))https://ask.sagemath.org/question/7762/bool-returns-false-with-arcsinx-and-2arctanx1sqrt1-x2/The two expression should be equal
but when I write
bool(arcsin(x) == 2*arctan(x/(1+sqrt(1-x^2))))
it returns false.
Any clue - Why it does that? Any get around?ShuFri, 12 Nov 2010 07:40:25 -0600https://ask.sagemath.org/question/7762/