Hello,
What if we introduce a # numeric 1e-10 doctest flag (like
#optional, etc.) that does just that---reads in the doctest answer, gets the
output of the function, and does an abs(actual-expected) epsilon (where
epsilon can be specified in the flag, or it has a default).
sage:
Dox ask :
I'd like to know if there is a way of finding the series expansion of
a given function around zero and infinity.
Around 0 :
sage: taylor (2*x/sinh(2*x), x, 0, 10)
-292/13365*x^10 + 254/4725*x^8 - 124/945*x^6 + 14/45*x^4 - 2/3*x^2 + 1
I see that the serie is right, even if partial
mmarco a écrit :
Dealing with polynomial ringsi found something that seems incorrect
sage: R=QQ['x','y']
sage: S=QQ['x']['y']
Shouldn't there be natural coercions from rings like QQ[x,y][z] or
QQ[x][y][z] to QQ[x,y,z] and vice-versa?
One easy way to coerce is Domain(the-expression)
Andrzej Chrzeszczyk finds this numerical error in this equation :
sage: s=solve(3*x^3-9*x+10,x,solution_dict=True)
sage: ns=[n(s[k][x]) for k in range(3)]
sage: ns
[1.06780542232902 - 1.84949324407141*I,
0.0277635108030695 + 1.24902476648341*I,
-1.09556893313209 + 0.600468477588001*I]
Hello,
I test
sage: var ('n,k')
sage: sum (binomial(n,k)*k^2, k, 0, n) # seems right
sage: sum (binomial(n,k)*k^2, k, 1, n) # seems right n(n+1)2^(n-2)
sage: sum (binomial(n,k)*k^2, k, 2, n) # is false : I get 0
Is it a maxima bug ?
Do I push a Sage ticket for it ?
F.
--
To post to this
Dox a écrit :
Hi guys! I have an easy question... got an expression with
exponentials, say exp(x)+exp(-x), How can I get the result in terms of
hyperbolic functions
1/ First you can use the expr.subs method :
y=exp(x)+exp(-x)
y.subs(exp(x)==sinh(x)+cosh(x)).subs(exp(-x)=cosh(x)-sinh(x))
[You
Hello Jean-Pierre,
It would be nice to add an option to set Maxima simpsum option when
calling Sage symbolic_sum function, or to enable it by default.
Indeed, without it Maxima (and so Sage) does not evaluate symbolic
sums of sums, i.e. something as
sage: var('n')
n
sage: sum(2^x+2^-x,x,0,n)
Hello,
I plot and analyse timeit (a-calculus(n)) in a log-log scale from
n=1..to..10..100..10^5...even...10^6
and I find some curious features in timesit, so I post these remarks and
questions :
/1/ I get the timeit result by timeit.eval(string_2+2).stats
but timeit(string_2+2) displays a
Dear kcrisman,
While reviewing #7981, I discoverd something a little interesting.
sage: animate([plot(sin(x + float(k)), (0, 2*pi), ymin=-5, ymax=5)
...for k in srange(0,2*pi,0.3)]).show() # optional
You'd think this would be optional. Nope - it creates a file in
doctesting.
I
Hello,
Any chance that we can add simplify_full on matrices? So that each
element is simplified if possible?
/1/ I suppose you know the map function that operate over each term of a
list.
map (lambda x: 3*x, [1,2,3]) # computes [3,6,9]
# you can replace 3*x by the function
Hello,
(and copy to Sage-edu)
Currently, both riemann_sum and riemann_sum_integral_approximation
does not support trapezoid mode. But instead there are separate
function which computes these for trapezoid mode .
I am added this mode to both riemann_sum and
Hi,
I would like something like this to work:
L = line([ some 2d points ])
L.translate(1, -1)
I don't find how to transform a line to a list of points.
But L[0] seens almost right (when L is a line)
You apply the function lambda (x,y):(x+1,y+1) to each point.
So map
Hi,
I use Sage in emacs in the shell buffer named *Sage-main*, in Inferior
Sage Mode.
I get an error when I type this input bellow with indent spaces.
But the input is right without any indent space.
In a xterm Sage adds theses spaces after the prompt,
so I type the indented code without any
are welcome !
Francois Maltey (in France)
I use ;
GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.16.1)
of 2010-03-26 on palmer, modified by Ubuntu
The sage part in my .emacs file :
(add-to-list 'load-path (expand-file-name
/usr/local/sage-4.1.1-test/data/emacs))
(require 'sage-view sage
Dear all,
Students discover Sage for mathematical computations,
and the functions are the most usual way to write mathematics.
So I prefer a light interface with the matrix function trace(...).
The determinant is a function and a method... but trace is only a method.
And .methods() aren't
David Roe wrote :
I posted a patch there that should fix it; I have to work on other
stuff, but if someone else wants to take over and write some doctests,
make sure it works in lots of cases...
David
On Mon, Oct 25, 2010 at 17:14, Burcin Erocal bur...@erocal.org
mailto:bur...@erocal.org
Georg wrote :
while calculating the integer part of square roots I realized that
sqrt() returns wrong results for large inputs (although the sqrt()
command itself accepts bignum values).
example: int(sqrt(2^94533))
int isn't a mathematical Sage type, but Integer is a Sage type.
And Integer
Hi Karl-Dieter and Burcin,
You wrote (I cut a lot)
Yup, I see what you are talking about - e.g.
if (x.is_equal(_ex1)) // log(1) - 0
return _ex0;
Although it might be nice to stay relatively close to Ginac and fix
such things on the Sage level if that's
Hi Burcin and Karl-Dieter,
// 1 // And what do you think about log ? Look at these test :
exp(x).operator() == exp # is True, and all(?) trigonometric functions
are fine
log(x).operator() == ln # is True, yes the alias ln is better than the
log name
log(x).operator() == log # is False (this
Hello,
I play with expressions, and transform sin(x) to (exp(i*x)-exp(-i*x))/2.
So I use a lot of test as
var ('x')
y = cos(x) # or any other expression
op = y.operator # so op == cos
if op == cos : ... # this test is fine, not the next one
else : ...
Now I want to test an expression
dagss wrote :
op = y.operator # so op == cos
if op == cos : ... # this test is fine, not the next one
Now I want to test an expression with the binomial function call.
y = binomial (3*x, x)# is fine
op = y.operator() # is also fine
Why is there a () here, but not in the
Hello,
Maybe I'm wrong, but I don't understand the last 0.
Test :
var('m') ; y=sqrt(m^2-1)
y(m=0) # =I, is right
imag(y)# = feels right, arctan2(0,-1)=pi when m=0
imag(y(m=0)) # =1, is right
(imag(y))(m=0) # is 0 and I don't understand why !
Francois in France.
--
To
Hello,
I play with random in order to approximate Pi by Monte-Carlo method.
sage: n=10^5 ; len(filter(lambda t:t, [random()^2+random^2() 1 for k
in [1..n]])) / len([1..n])
The test looks at the point (random(), random()) and tests if it's in
the quarter circle.
The result may be about
Sebastian Pancratz wrote :
The problem is here:
http://trac.sagemath.org/sage_trac/attachment/ticket/6441/trac_6441_b_df_charpoly_412rebase.patch
new lines 1084--1089
When I wrote the code for computing characteristic polynomials in a
division-free way in order for it to work over
Hello,
This purpose about expression has 3 differents aspects.
A/ The first aspect we discover is the user interface. This interface
must be coherent.
This means that 1/ it's possible to describe it with few word 2/ The
most common calculus has no option 3/ This system will be able to be
William wrote :
But isn't it just operator()???
sage: var('x,y'); a = x+y
(x, y)
sage: a.operator()
built-in function add
Sage also need tests over theses operators :
In an expression we test
op = expr.operator
if op == sin : ... # is right
elif op == + : ... # doesn't work (or add or
Many thanks for the 2 previous help !
About operator.add and expr.variables()...
The (real-?) last question is
a=4*x
b=4/3*x
c=4.0*x
d=4*I*x
I can get the constant by a.operands(), a.operands()[-1], but how can I
test (without error) if this term is an integer, a rational, a float or
a
Jason wrote :
The calculation below caused some concern for a few minutes with one of
my students the other day. We reasoned through it and saw that
everything was mathematically correct, but it seemed odd that Sage/pynac
would automatically pull a negative one out of (x-2t) and square
a few conceptually defined methods like rewrite(), expand
() and combine()( or contract()?).
Francois Maltey had a proposal for a possible interface to all this.
Maybe he can comment here, or we can discuss his proposal on sage-
devel.
--
It would be great
kcrisman wrote
It would also be great to see how to integrate your ideas with
#6878, which probably should still stand alone as a ticket since one
might wish to exclude points for reasons other than asymptotes or
jumps.
Why not try to make this patch within the current plot code...
I study
Hello,
I test the plot command, decode the plot.py file and also follow the
patch #6878.
So I understand that a plot is one line between points.
The exclude option seems to cut this lines at each break point after the
computation.
Of corse a continuous plot is a such line. But the plot result
Hello Nathann,
I know this is totally useless, but why shouldn't it work nevertheless
? :-)
sage: n(pi,digits=1000)
Useless indeed... Maple often fails between 10^4 and 10^5 digits and
axiom around 10^5.
I don't know the reason : Ligther mathematics or bad code.
It seems that numerical
About 0^0
Even for discrete things like elements of GF(5)? I haven't thought
about what 0^0 is for things where the continuous limit doesn't make sense.
In any ring, integer power x^n is défined by x^0 = 1, because an empty
product is the unit element.
The reason is the same for 0!=1.
Hello,
Functions plot is fine with singular functions as
plot (sin(1/x), x, 0, 5)
Plot has also a symbolic option detect_poles=True.
But this option isn't designed for theses plots.
There are unpleasant vertical lines.
plot (floor(10*x), x, 0, 2)
plot (x*floor(1/x), x, 0, 2)
plot (arctan
Hello !
I test with success :
var('m')
plot (m^2,m,0,6) # for one plot
plot ([m^3],m,0,6) # for one plot
plot(sqrt(m^2+1),m,0,6)
plot([sqrt(m^2+1)],m,0,6)
plot(real (sqrt(m^2+1)),m,0,6)
They are all right
But this one fails :
plot([real (sqrt(m^2+1))],m,0,6)
Of corse I don't want to plot
I run upgrade from a sage-4.1.1 built at home on an ubuntu jaunty with a
dual-core pentium by
./sage -upgrade
http://sage.math.washington.edu/home/mvngu/release/upgrade/sage-4.1.2.alpha4
Then I get an error with an unknown function PC when I ran the updated sage.
The ticket #6990 gives a new
Hello,
If I am right, the symbolic manipulations of Sage come from the
(py)ginac librairies.
In ginac documentation I find very intersting functions for my use of
expressions :
is_anumeric
is_areal
is_arational
There are about 30 tests for possible types.
The types I can test by
Maurizio wrote :
At the beginning of the worksheet I could write in a cell something like:
a,b = any live data
So, three cells later I have:
c = a + b; c
And whenever I update a or b, the evaluation of that cell is repeated
and c gets updated accordingly...
With students all cells will
Hi,
I'm testing sage, the expressions and I play with expr.expand().
After test = 3*x, I find test.expand? and get the help text, and
test.expand?? and the main call about expand.
Then emacs goes to expression.pyx at the lines defining the interface
(outer) function expand.
In this code I
Hi,
I'm not sure that discuss about the interface design of sage notebook
inside firefox is at the right place.
But let me give my advise during the first uses of sage 2 weeks ago or
forget this mail.
Even if I also use sage.el in emacs, the web-interface is really a very
great-great-great
Hello,
sage: a = RIF(1.5,2.3)
I see no way to easily get 1 2 or 3 from a.
I propose, but I'm perhaps missunderstanding.
a.lower().floor()
a.upper().ceil()
a.center().round()
François
--~--~-~--~~~---~--~~
To post to this group, send an email to
William Stein wrote :
2009/9/17 Jason Grout jason-s...@creativetrax.com:
Currently, round(), floor(), and ceil() on interval objects return
intervals.
There is a patch up at #2899 that changes these functions to return
integers (round- round the midpoint, floor - largest integer below
mirko wrote :
Would it be possible to support both ln(x) and log(x), tg(x) and tan
(x) and so on via a locale setting?
If one locale is selected log, tan and so on, will be used, if another
that ln, tg, etc.
The input and the output must be the same, even in tex output and help
files.
An
43 matches
Mail list logo