Thanks a lot, both for the explanation and the solution! globals() did
the trick for me.
Georg.
On Dec 22, 4:19 pm, "Mike Hansen" wrote:
> On Mon, Dec 22, 2008 at 6:12 AM, Timothy Clemans
>
> wrote:
>
> > sage: sage0("var('a b c')")
> > (a, b, c)
> > sage: sage0("a = b/c")
>
> > b
>
> That's n
A quick question: If one is given a variable name as a string s, how
can one assign a symbolic expression to it? Here is what I try that
doesn't work:
var('a b c')
s = "a"
eval(s + " = b/c")
Traceback (most recent call last):
...
a = b/c
^
SyntaxError: invalid syntax
--~--~--
This is interesting. I guess one way to represent numbers with units
is as Laurent monomials with the number as coefficient and the units
as symbols. This seems to fit in the framework for symbolic
expressions. There will be various predefined relations between these
monomials like 1000*m = 1*km.
You can use the plot_vector_field command:
# Declare your variables:
var('x t')
# Define you function, for instance:
def f(t,x):
return t*x
# Plot the associated vector field:
plot_vector_field((lambda t, x: 1, f(t,x)), (-1, 1), (-2, 2))
There seems to be something awry, however, compare
p
Actually, I think this would be very nice to have. (Infinite)
continued fractions pop up everywhere (I recently saw them in the
resolution of toric singularities!). Moreover, they are so easy to
understand that they also pop up in popular scientific math questions,
like at Project Euler.
So yes,
, 6:23 pm, Georg Muntingh <[EMAIL PROTECTED]> wrote:
>
>
>
> > I just installed Sage 2.11 on an old computer that I upgraded to
> > Ubuntu Gutsy a couple of hours before. Any idea what's wrong?
>
> > [EMAIL PROTECTED]:
I just installed Sage 2.11 on an old computer that I upgraded to
Ubuntu Gutsy a couple of hours before. Any idea what's wrong?
[EMAIL PROTECTED]:~/Apps/sage-2.11-ubuntu32-intel-i686-Linux$ ./sage
--
| SAGE Version 2.11, Release D