1 | initial version |
Define a as a *function* of
i`. Possible use :
a = function("a")
d = var("d")
j, k = var("j, k", domain="integer")
S = sum(a(j)*d, j, 1, k+1)
HTH,
2 | No.2 Revision |
Define a
as a as function of a *function* ofii`. . Possible use :
a = function("a")
d = var("d")
# I don't like to scratch Sage's predefined identifiers...
j, k = var("j, k", domain="integer")
S = sum(a(j)*d, j, 1, k+1)
HTH,
3 | No.3 Revision |
Define a
as a function of i
. Possible use :
a = function("a")
d = var("d")
# I don't like to scratch Sage's predefined identifiers...
j, k = var("j, k", domain="integer")
S = sum(a(j)*d, j, 1, k+1)
EDIT : If you want to fiddle with output cosmetics, you might try :
a = function("a", nargs=1,
print_func=lambda self, *args: r"%s[%s]"%(self, args[0]),
print_latex_func=lambda self, *args: r"%s_{%s}"%(self, args[0]))
d = SR.var("d")
j, k = SR.var("j, k", domain="integer")
which allows for :
sage: sum(a(j)d(), j, 0, k + 1) dsum(a[j], j, 0, k + 1)
and latex(sum(a(j)*d(), j, 0, k + 1))
gets interpreted as expected (but ask.sagemath.org
's Mathjax is currently unable to display it...).
HTH,
4 | No.4 Revision |
Define a
as a function of i
. Possible use :
a = function("a")
d = var("d")
# I don't like to scratch Sage's predefined identifiers...
j, k = var("j, k", domain="integer")
S = sum(a(j)*d, j, 1, k+1)
EDIT : If you want to fiddle with output cosmetics, you might try :
a = function("a", nargs=1,
print_func=lambda self, *args: r"%s[%s]"%(self, args[0]),
print_latex_func=lambda self, *args: r"%s_{%s}"%(self, args[0]))
d = SR.var("d")
j, k = SR.var("j, k", domain="integer")
which allows for :
sage: and latex(sum(a(j)*d(), j, 0, k + 1))
gets interpreted as expected (but ask.sagemath.org
's Mathjax is currently unable to display it...).
HTH,
5 | No.5 Revision |
Define a
as a function of i
. Possible use :
a = function("a")
d = var("d")
# I don't like to scratch Sage's predefined identifiers...
j, k = var("j, k", domain="integer")
S = sum(a(j)*d, j, 1, k+1)
EDIT : If you want to fiddle with output cosmetics, you might try :
a = function("a", nargs=1,
print_func=lambda self, *args: r"%s[%s]"%(self, args[0]),
print_latex_func=lambda self, *args: r"%s_{%s}"%(self, args[0]))
d = SR.var("d")
j, k = SR.var("j, k", domain="integer")
which allows for :
sage: sum(a(j)*d(), j, 0, k + 1)
d*sum(a[j], j, 0, k + 1)
and latex(sum(a(j)*d(), j, 0, k + 1))
gets interpreted as expected (but ask.sagemath.org
's Mathjax is currently unable to display it...).
$$d {\sum_{j=0}^{k + 1} a_{j}}$$
HTH,
6 | No.6 Revision |
Define a
as a function of i
. Possible use :
a = function("a")
d = var("d")
# I don't like to scratch Sage's predefined identifiers...
j, k = var("j, k", domain="integer")
S = sum(a(j)*d, j, 1, k+1)
EDIT : If you want to fiddle with output cosmetics, you might try :
a = function("a", nargs=1,
print_func=lambda self, *args: r"%s[%s]"%(self, args[0]),
print_latex_func=lambda self, *args: r"%s_{%s}"%(self, args[0]))
d = SR.var("d")
j, k = SR.var("j, k", domain="integer")
which allows for :
sage: sum(a(j)*d(), j, 0, k + 1)
d*sum(a[j], j, 0, k + 1)
and latex(sum(a(j)*d(), j, 0, k + 1))
gets interpreted as expected (but :ask.sagemath.org
's Mathjax is currently unable to display it...).
$$d {\sum_{j=0}^{k + 1} a_{j}}$$
HTH,