ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 23 Jun 2020 04:41:20 +0200Variables r and R are gobbledhttps://ask.sagemath.org/question/52168/variables-r-and-r-are-gobbled/If implicit multiplication is not active, something like `4y^2` should raise an error. This is what actually happens:
sage: var("y"); 4y^2
File "<ipython-input-22-25bcbc82148c>", line 1
var("y"); 4y**Integer(2)
^
SyntaxError: invalid syntax
If we replace `y` by a different variable or consider a similar expression, we also get an error... except if the variable is `r` or `R`. For example,
sage: var("r, R"); 4r^2, 3R + 5r + 2R^3
(16, 16)
Surprisingly, there is no error. Variables `r` and `R` seem to be gobbled, so that SageMath parses `4r^2` as `4**Integer(2)` and `3R + 5r + 2R^3` as `3 + 5 + 2**Integer(3)`. Why? Is this a bug?JuanjoTue, 23 Jun 2020 04:41:20 +0200https://ask.sagemath.org/question/52168/Why does implicit multiplication not work in the Sage Cell Server?https://ask.sagemath.org/question/52060/why-does-implicit-multiplication-not-work-in-the-sage-cell-server/Hello, Sage Community!
Is there any reason for `implicit_multiplication(True)` not having any effect in SageCell? Is there any way of solving this?
Thanks in advance for your answers! dsejasWed, 17 Jun 2020 22:37:41 +0200https://ask.sagemath.org/question/52060/basic algebra with several variables-why won't it work?https://ask.sagemath.org/question/8317/basic-algebra-with-several-variables-why-wont-it-work/Hi,
I'm trying to use Sage-Notebook as a basic calculator and want to do some basic algebra for two variables. However, it keeps giving me syntax error messages when I type in the below. What am I doing wrong?
x, y = var('x, y')
solve([20*(6400-x-2y)==0, 80*(3200-x-y)==0], x, y)
Traceback (click to the left of this block for traceback)
...
SyntaxError: invalid syntax
Thank you!HunMon, 26 Sep 2011 19:12:19 +0200https://ask.sagemath.org/question/8317/Is it possible to get implicitly multiplied output?https://ask.sagemath.org/question/7609/is-it-possible-to-get-implicitly-multiplied-output/With `implicit_multiplication(True)`, we can enter expressions using spaces instead of `*` to separate multiplied subexpressions:
`sage: var('x, y, z')
sage: implicit_multiplication(True)
sage: 3 x^4 y + 2 z sin(x z 3 y) - 3 y^2
3*x^4*y - 3*y^2 + 2*z*sin(3*x*y*z)
`
This works similarly for polynomials.
Is it possible to set (or implement practically) an option that automatically postparses output to use implicit multiplication? For example,
`
sage: R.<a,b,c> = QQ[]; R
Multivariate Polynomial Ring in a, b, c over Rational Field
sage: implicit_multiplication_output(True)
sage: R.random_element()
1/7 a b - 1/4 a c - c^2 + c
`
Mitesh PatelSun, 22 Aug 2010 05:39:55 +0200https://ask.sagemath.org/question/7609/