Ask Your Question

NahsiN's profile - activity

2018-01-12 16:06:52 +0200 received badge  Popular Question (source)
2017-12-23 16:25:00 +0200 received badge  Famous Question (source)
2017-12-23 16:25:00 +0200 received badge  Notable Question (source)
2017-12-23 16:25:00 +0200 received badge  Popular Question (source)
2017-07-14 21:26:03 +0200 received badge  Famous Question (source)
2017-02-11 17:48:28 +0200 commented question Adding zero to an expression and avoiding simplification

Yes as they should. But when expressions are of the form $E_x =
\frac{1}{2} \, {\left({{E}_x^-} e^{\left(i \, k x\right)} + {E_x^+} e^{\left(-i \, k x\right)}\right)} e^{\left(i \, \omega t\right)} + \frac{1}{2} \, {\left(\overline{{E_x^+}} e^{\left(i \, k x\right)} + \overline{{{E}_x^-}} e^{\left(-i \, k x\right)}\right)} e^{\left(-i \, \omega t\right)}$ and $ E_y = \frac{1}{2} \, {\left({{E}_y^-} e^{\left(i \, k x\right)} + {E_y^+} e^{\left(-i \, k x\right)}\right)} e^{\left(i \, \omega t\right)} + \frac{1}{2} \, {\left(\overline{{E_y^+}} e^{\left(i \, k x\right)} + \overline{{{E}_y^-}} e^{\left(-i \, k x\right)}\right)} e^{\left(-i \, \omega t\right)}$. This can yield to two different expressions for pol_y that might seem different at first but are equivalent.

2017-02-10 23:34:49 +0200 asked a question Adding zero to an expression and avoiding simplification

Hi, I have an expression of the form

pol_y = chi_yyyy*Ey*Ey*Ey + (chi_yyxx + chi_yxyx + chi_yxxy)*Ey*Ex*Ex - (chi_yyxx + chi_yxyx + chi_yxxy)*Ey*Ex*Ex + (chi_yyxx + chi_yxyx + chi_yxxy)*Ey*Ex*Ex

Now the last two terms add 0 to the expression. The goal is to substitute complicated expressions for Ey, Ex (complex quantities) and compare the results of two different reformulations (with and without the 0 terms). So for my work, I need the last two terms to be there but sagemath is simplifying this expression automatically. How do I avoid this?

2017-02-10 23:26:30 +0200 commented question Typeset very slow in notebook

Sure, yes you are correct. I have large formulas that were having trouble rendering on sagemath cloud. On my own machine, the browser was slow at rendering mathjax but it was affecting my performance in other cells _after_ stuff had been rendered.

2017-02-09 04:42:46 +0200 asked a question Factoring out complex exponentials

Hi, If I have an expression as follows $\frac{3}{8} {{E}_y^-}^{2} \overline{{E_y^+}} e^{\left(i \omega t + 3 i k x\right)} + \frac{3}{8} \, {{E}_y^-}^{2} \overline{{{E}_y^-}} e^{\left(i \omega t + i k x\right)} + \frac{3}{4} \, {{E}_y^-} {E_y^+} \overline{{E_y^+}} e^{\left(i \, \omega t + i \, k x\right)} + \frac{3}{4} \, {{E}_y^-} {E_y^+} \overline{{{E}_y^-}} e^{\left(i \omega t - i k x\right)} + \frac{3}{8} \, {E_y^+}^{2} \overline{{E_y^+}} e^{\left(i \, \omega t - i \, k x\right)} + \frac{3}{8} \, {E_y^+}^{2} \overline{{{E}_y^-}} e^{\left(i \omega t - 3 i k x\right)}$

How do I factor out a complex exponential $e^{i\omega t - ikx}$ from the expression above using a command?

2017-02-09 04:26:49 +0200 asked a question Typeset very slow in notebook

Hi, running sagemath v7.2 using the AIMs PPA. Is there a reason typesetting output in notebook is so slow?

2017-02-09 00:07:29 +0200 received badge  Commentator
2017-02-09 00:07:29 +0200 commented answer Converting expression to list of terms and back

How does this work for converting [bxcos(x^3)sin(b), bcos(x), h*sin(x)] back into an expression, say using addition?

2017-02-08 22:11:20 +0200 received badge  Popular Question (source)
2017-02-08 22:11:20 +0200 received badge  Notable Question (source)
2016-12-18 18:18:43 +0200 received badge  Good Question (source)
2016-07-05 05:48:15 +0200 received badge  Notable Question (source)
2016-05-31 20:45:35 +0200 received badge  Famous Question (source)
2015-11-25 17:20:04 +0200 received badge  Notable Question (source)
2015-11-25 17:20:04 +0200 received badge  Popular Question (source)
2015-07-21 04:11:50 +0200 received badge  Popular Question (source)
2015-07-17 00:00:28 +0200 commented question setwd() function in R does not work in Sage

No they were in separate cells. Putting the two commands in one cell works. Thanks for the clarification. Now it makes sense.

2015-07-13 18:34:27 +0200 commented question simplify_full() Maxima ECL error

The same issue arises in sage 6.7. It seemed to have been fixed in 6.6 but it's back in 6.7.

2015-06-28 01:02:11 +0200 asked a question setwd() function in R does not work in Sage

Hello, I am trying to use setwd() for R in the sage notebook to set the current working directory. But it does not seem to work. I get the following

setwd("/home/foo/Code/")
getwd()   
[1] "/tmp/tmpR8Ukt0"

So as shown, the setwd() command has no effect. Any suggestions?

2015-06-27 23:52:41 +0200 asked a question help() in R mode produces underscores in output

Hello, I am using the sage notebook to interface with R. I am using the R interpreter for the whole sheet. Whenever I use help such as help(sort), the output has underscored. For e.g. sort package:base R Documentation

_S_o_r_t_i_n_g _o_r _O_r_d_e_r_i_n_g _V_e_c_t_o_r_s

_D_e_s_c_r_i_p_t_i_o_n:

 Sort (or _order_) a vector or factor (partially) into ascending or
 descending order.  For ordering along more than one variable,
 e.g., for sorting data frames, see ‘order’.

So basically whereever there should be a space there is an underscore. Does anyone else have this issue? I am using sage 6.7 on ubuntu using the ppa.

2015-06-27 23:35:14 +0200 commented answer How to use R with Sage?

Thank you for that plotting command. I couldn't get plot(x,y) to work but saving to png on Ubuntu works. Cheers

2015-05-12 22:02:19 +0200 commented question Error typesetting

Hi, I had the same problem after the latest update on Ubuntu. I was using the AIMS ppa. Uninstalling the ppa package and manually installing the pre built binary for Ubuntu 14.04 fixed the issue.

2015-03-11 20:35:01 +0200 commented question simplify_full() Maxima ECL error

Thank you for filing a ticket. Hopefully it's fixed soon.

2015-03-02 23:38:48 +0200 asked a question simplify_full() Maxima ECL error

Hi all, the following code was working fine in 6.4.1 (I am using the AIIMS ppa in Ubuntu) and now after the 6.5 upgrade, it doesn't work anymore. Assume I have defined all variables.

u(t) = exp(-(t-t_0)^2/(2*sigma^2)) + exp(-(t-t_1)^2/(2*sigma^2)) ; u(t);
u_tilde = integral(u(t)*exp(-I*omega*t), t, -infinity, +infinity, hold=False).simplify_full(); u_tilde;

The problem is in simplify_full(). The erf function and their limits are not evaluated for some reason. I have a hunch this problem has been posted before but I am not sure. The full traceback is given below. Any help is appreciated. Thanks

    ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-8-66e6236c7bf7> in <module>()
----> 1 u_tilde = integral(u(t)*exp(-I*omega*t), t, -infinity, +infinity, hold=False).simplify_full(); u_tilde;

/usr/lib/sagemath/src/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.simplify_full (build/cythonized/sage/symbolic/expression.cpp:40350)()
   8258         """
   8259         x = self
-> 8260         x = x.simplify_factorial()
   8261         x = x.simplify_rectform()
   8262         x = x.simplify_trig()

/usr/lib/sagemath/src/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.simplify_factorial (build/cythonized/sage/symbolic/expression.cpp:43472)()
   8729 
   8730         """
-> 8731         return self.parent()(self._maxima_().makefact().factcomb().minfactorial())
   8732 
   8733     factorial_simplify = simplify_factorial

/usr/lib/sagemath/src/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression._maxima_ (build/cythonized/sage/symbolic/expression.cpp:5512)()
    582             # Maybe not such a great idea because the "default" interface is another one
    583             from sage.calculus.calculus import maxima
--> 584             return super(Expression, self)._interface_(maxima)
    585         else:
    586             return super(Expression, self)._interface_(session)

/usr/lib/sagemath/src/sage/structure/sage_object.pyx in sage.structure.sage_object.SageObject._interface_ (build/cythonized/sage/structure/sage_object.c:5203)()
    592                 raise NotImplementedError, "coercion of object %s to %s not implemented:\n%s\n%s"%\
    593                   (repr(self), I)
--> 594         X = I(s)
    595         if c:
    596             try:

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in __call__(self, x, name)
    197 
    198         if isinstance(x, basestring):
--> 199             return cls(self, x, name=name)
    200         try:
    201             return self._coerce_from_special_method(x)

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in __init__(self, parent, value, is_name, name)
    624                 self._name = parent._create(value, name=name)
    625             except (TypeError, RuntimeError, ValueError) as x:
--> 626                 raise TypeError(x)
    627 
    628     def _latex_(self):

TypeError: ECL says: Error executing code in Maxima:

Update: I would like to add that the latest version of sage 6.7 still has this problem. Any updates?

2015-03-02 22:55:52 +0200 commented question How to change default font-size in shift-click-created cells inside Sage Notebook?

Did you figure out the solution for increasing font size while composing?

2015-02-26 22:45:56 +0200 commented question Bug with absolute value of a complex variable?

Thanks for asking this question. I had a similar problem in the latest release and this problem persists. Fortunately the workaround suggested by calc314 works.

2015-02-26 22:39:00 +0200 received badge  Supporter (source)
2015-01-27 22:27:12 +0200 commented answer Attaching files in notebook does not update contents

Ah I see, didn't know this was an ongoing issue. Sadly the "fix" is beyond my scope of the moment. Let's hope for the best. At least now I know my installation is not busted.

2015-01-27 22:25:05 +0200 commented question Attaching files in notebook does not update contents

You're right. Had a brain fart there. Edited

2015-01-27 22:24:27 +0200 received badge  Editor (source)
2015-01-27 04:30:02 +0200 asked a question Attaching files in notebook does not update contents

Hello, I am running Sage 6.4.1. Using the notebook interface, attaching files does not work as the files contents are not reloaded automatically. It just shows me the previous variable values.

echo "x=2" > foo.py 
attach foo.py 
x 
2
echo "x=4" > foo.py 
x 
2

As you can see the value of x isn't updated to 4. I can confirm that attach works as intended on the terminal, just the notebook interface is broken.

2015-01-08 02:07:48 +0200 received badge  Scholar (source)
2014-12-22 16:58:26 +0200 received badge  Nice Question (source)
2014-12-19 04:43:03 +0200 received badge  Student (source)
2014-12-19 04:14:35 +0200 asked a question How to delete blank text cells

When I create a text cell and then click "Cancel Changes", the text cell does not delete and it stays taking up extra space in the notebook. Has anyone else encountered this? If so, then how do I go about deleting the extra blank text cells created?

2014-10-07 22:58:01 +0200 asked a question Defining and manipulating vector equations with cross and dot products

Hello, I have been experimenting with Sage to see what it can or can't do. Consider the following simple problem. Show $[ \mathbf{A} \times (\mathbf{B} \times \mathbf{C}) ] + [ \mathbf{B} \times (\mathbf{C} \times \mathbf{A}) ] + [ \mathbf{C} \times (\mathbf{A} \times \mathbf{B}) ] = 0 $ where $\mathbf{A}, \mathbf{B}, \mathbf{C} \in \mathbb{R}^3$. In Sage I can do this in one line

eqn = A.cross_product(B.cross_product(C)) + B.cross_product(C.cross_product(A)) + C.cross_product(A.cross_product(B))

where A,B and C are elements of $SR^3$. Now I can show component wise eqn[0].expand() eqn[1].expand() eqn[2].expand() that it's zero. A much simpler way is to use the identity $\mathbf{A} \times ( \mathbf{B} \times \mathbf{C} ) = \mathbf{B}( \mathbf{A} \cdot \mathbf{C} ) - \mathbf{C}( \mathbf{A} \cdot \mathbf{B} )$ and plug it in. Yet this is easier done by hand than by computer. My question is can Sage do this? Can I define a vector equation in sage, and sub in vector identities to manipulate or simplify the equation? Thanks