sage: plot(x^2*log(x,2)-1, 0,2)
[nice plot so you can understand what is going on]
sage: find_root(x^2*log(x,2)-1,1, 2)
1.4142135623730951
> sage: plot(x^2*log(x,2)-1, 0,2)
> [nice plot so you can understand what is going on]
>
> sage: find_root(x^2*log(x,2)-1,1, 2)
> 1.4142135623730951
> <<
>
> Hi, I'm trying out SAGE for the first time, so I entered what you
> suggested (see above).
>
> Now, from the plot, it there seems to be no other roots between 0
> and 2
> so I entered
>
>
> sage: find_root(x^2*log(x,2)-1,0, 2)
> and got the root = 0.0
>
> what am I missing here?
This function is not defined at the left endpoint, so you are
probably violating some assumption on the underlying optimization
algorithm used. However, I would much rather have an error here than
an incorrect value.
- Robert
> Exactly, the function log base 2 of x is not defined at 0.
> So, why won't sage return some sort of domain error?
Sage doesn't test to see if the function is defined on the whole
domain (if this is even a decidable question in general, and I bet
it's not), it just passes the expression to maxima and/or numpy. Of
course, there is lots of room for improvement, and I don't like the
current behavior.
> I noticed something similar when I plotted (x^2-1)/(x-1) and got the
> graph of x+1.
> I was hoping for a removeable discontinuity to show in the graph!
> IE a hole in y=x+1 at x=1.
If you evaluate (x^2-1)/(x-1) at 100, or even 1000s of random points
say, between 0 and 10, chances are very slim you'll try and evaluate
it at the point x=1. Thus when you interpolate the rest of the graph
it would come out as a straight line. Also, it's unclear how much of
a "hole" you would want to see--mathematically even one pixel would
be too large.
It would be nice to do something more clever than evaluate at a bunch
of points and "connect" the dots, but then there is no end to the
amount of cleverness one could ask for.
- Robert
Also, it's unclear how much of
a "hole" you would want to see--mathematically even one pixel would
be too large.
No.
> Also, I see that sage uses lots of great FOSS math apps. One I don't
> see, and wonder why its not included, is Octave which would give MATLAB
> functionality to sage. I'm wondering why Octave is not part of sage?
> I thought sage was to be an alternative to Magma, Mathematica and
> MATLAB.
1. Sage includes numpy and scipy, which are native Python libraries
that provide most MATLAB functionality to Sage. See, e.g.,
http://www.scipy.org/NumPy_for_Matlab_Users
To include Octave as well would be a huge duplication of
functionality. (Sage also includes GSL -- the Gnu Scientific Library
-- which again would overlap a lot with Octave for functionality.)
2. Octave is very time consuming to build from source, since it is a
large C++ program.
3. Octave as a binary is very easy to install on any modern system, so
there is little point in including it in Sage, since people can easily
just install it. There is a Sage/Octave interface, so you can use
Octave from Sage.
4. Octave is licensed GPLv3, so we can't include it with Sage anyways.
-- William
>
> Hi, I see that sage can call mathematica functions - I suppose that
> only works if I have mathematica installed.
>
> What I'm wondering is if I can import a mathmatica notebook into sage?
> We used to have mathematica at my school and I remember using some
> very
> nice mathematica notebooks by Jerry Uhl (University of Illinois?) that
> served as workbooks for teaching calculus. Can I use these notebooks
> with sage?
>
You could display the notebooks with Mathematica Player and if you want
to do more with them, try and convert them to Sage.
As for Octave, unless there is something specific, I highly recommend
Numpy and SciPy like William stated.
Cheers,
Tim.
---
Tim Lahey
PhD Candidate, Systems Design Engineering
University of Waterloo
http://www.linkedin.com/in/timlahey
You could display the notebooks with Mathematica Player and if you want
to do more with them, try and convert them to Sage.