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.Wed, 27 Jan 2021 19:34:41 +0100Simplifying when solving Einstein equationhttps://ask.sagemath.org/question/55475/simplifying-when-solving-einstein-equation/ Hello
I'm solving Einstein equation in vacuum. I already computed the Ricci tensor. For example, de first Ricci component is saved in the following variable eq1:
eq1=EE[0,0]
The denominator of the component should vanish since since the other part of the equation is zero. How can I extract numerator of the expression. I have tried:
eq1.denominator()
But it does not work.ThanksWed, 27 Jan 2021 18:37:30 +0100https://ask.sagemath.org/question/55475/simplifying-when-solving-einstein-equation/Comment by slelievre for <p>Hello</p>
<p>I'm solving Einstein equation in vacuum. I already computed the Ricci tensor. For example, de first Ricci component is saved in the following variable eq1:</p>
<p>eq1=EE[0,0]</p>
<p>The denominator of the component should vanish since since the other part of the equation is zero. How can I extract numerator of the expression. I have tried:</p>
<p>eq1.denominator()</p>
<p>But it does not work.Thanks</p>
https://ask.sagemath.org/question/55475/simplifying-when-solving-einstein-equation/?comment=55476#post-id-55476Welcome to Ask Sage!
Thank you for your question!Wed, 27 Jan 2021 18:47:57 +0100https://ask.sagemath.org/question/55475/simplifying-when-solving-einstein-equation/?comment=55476#post-id-55476Comment by slelievre for <p>Hello</p>
<p>I'm solving Einstein equation in vacuum. I already computed the Ricci tensor. For example, de first Ricci component is saved in the following variable eq1:</p>
<p>eq1=EE[0,0]</p>
<p>The denominator of the component should vanish since since the other part of the equation is zero. How can I extract numerator of the expression. I have tried:</p>
<p>eq1.denominator()</p>
<p>But it does not work.Thanks</p>
https://ask.sagemath.org/question/55475/simplifying-when-solving-einstein-equation/?comment=55477#post-id-55477Please provide code that can be copied and pasted in a fresh Sage session to reproduce the problem.Wed, 27 Jan 2021 18:48:16 +0100https://ask.sagemath.org/question/55475/simplifying-when-solving-einstein-equation/?comment=55477#post-id-55477Comment by slelievre for <p>Hello</p>
<p>I'm solving Einstein equation in vacuum. I already computed the Ricci tensor. For example, de first Ricci component is saved in the following variable eq1:</p>
<p>eq1=EE[0,0]</p>
<p>The denominator of the component should vanish since since the other part of the equation is zero. How can I extract numerator of the expression. I have tried:</p>
<p>eq1.denominator()</p>
<p>But it does not work.Thanks</p>
https://ask.sagemath.org/question/55475/simplifying-when-solving-einstein-equation/?comment=55478#post-id-55478To display blocks of code or error messages in Ask Sage, skip a line
above and below, and do one of the following (all give the same result):
- indent all code lines with 4 spaces
- select all code lines and click the "code" button (the icon with '101 010')
- select all code lines and hit ctrl-K
For instance, typing
> If we define `f` by
>
> def f(x, y, z):
> return x * y * z
>
> then `f(2, 3, 5)` returns `30` but `f(2*3*5)` gives:
>
> TypeError: f() takes exactly 3 arguments (1 given)
produces:
> If we define `f` by
>
> def f(x, y, z):
> return x * y * z
>
> then `f(2, 3, 5)` returns `30` but `f(2*3*5)` gives:
>
> TypeError: f() takes exactly 3 arguments (1 given)Wed, 27 Jan 2021 18:48:48 +0100https://ask.sagemath.org/question/55475/simplifying-when-solving-einstein-equation/?comment=55478#post-id-55478Answer by eric_g for <p>Hello</p>
<p>I'm solving Einstein equation in vacuum. I already computed the Ricci tensor. For example, de first Ricci component is saved in the following variable eq1:</p>
<p>eq1=EE[0,0]</p>
<p>The denominator of the component should vanish since since the other part of the equation is zero. How can I extract numerator of the expression. I have tried:</p>
<p>eq1.denominator()</p>
<p>But it does not work.Thanks</p>
https://ask.sagemath.org/question/55475/simplifying-when-solving-einstein-equation/?answer=55481#post-id-55481`EE[0,0]` is a [chart function](https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/chart_func.html), which does not have any method `denominator()`. To access to the underlying symbolic expression, on which you can invoke `denominator()`, use `expr()`:
eq1.expr().denominator()
Wed, 27 Jan 2021 19:34:41 +0100https://ask.sagemath.org/question/55475/simplifying-when-solving-einstein-equation/?answer=55481#post-id-55481