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.Fri, 04 Sep 2020 11:18:45 +0200Finding solution of expression with fractional powerhttps://ask.sagemath.org/question/53299/finding-solution-of-expression-with-fractional-power/I'm trying to solve this equation
$ 3(2.2+(\frac{64}{r})^{(1/3)})= 4(2.2+(\frac{128}{r-1})^{(1/4)})$ using solve function
I want to obtain the numerical solution
**but when i use `sol[0].n(30)`**
**TypeError:** cannot evaluate symbolic expression numerically
**when i try to `find_root(0,1,r)`**
**ValueError:** negative number to a fractional power not real
How to find the solution of this expression ?
deeppaul589Fri, 04 Sep 2020 11:18:45 +0200https://ask.sagemath.org/question/53299/solve maxima?https://ask.sagemath.org/question/36083/solve-maxima/The following in Jupyter (and sage cloud) produces the wrong output. I do have an (extremely similar) maxima batch file that works fine. I sort of presume that maxima "solve" is not really called. If needed I can provide all files and stuff; either link or inline. Or if the correct way to use maxima/solve isn't obvious I can shorten up the generation of the solve argument by direct assignment.
The last commented line is to prove that simpler problems yield the correct same answers in sagemath and maxima; when sagemath feels like.
jupyter:
******
%display latex
var('A B C D M r')
T =matrix([[A,B],[C,D]]);
m=1-2*M/r
G =matrix([[-m,0],[0,1/m]])
k = T.transpose()*G*T
eq1=k[0,0];
eq2=k[0,1];
eq3=k[1,0];
eq4=k[1,1];
eqd=A*D-B*C-1
eqd
sol=solve([eq1+m==0,eq3-sqrt(2*M/r)==0,eq4-1==0,eqd==0],[A,B,C,D]);
sol
####-comment---solve([eq1+m==0,eq3-sqrt(2*M/r)==0],[A,B])
****
Produces:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left[-B C + A D - 1 = 0, A^{2} {\left(\frac{2 \cdot M}{r} - 1\right)} - \frac{C^{2}}{\frac{2 \cdot M}{r} - 1} - \frac{2 \, M}{r} + 1 = 0, A B {\left(\frac{2 \cdot M}{r} - 1\right)} - \frac{C D}{\frac{2 \cdot M}{r} - 1} - \sqrt{2} \sqrt{\frac{M}{r}} = 0, B^{2} {\left(\frac{2 \, M}{r} - 1\right)} - \frac{D^{2}}{\frac{2 \, M}{r} - 1} - 1 = 0\right]$
Whereas : a maxima script produces
${\\left[ \left[ A=-1 , B={{\sqrt{2} \cdot r \cdot \sqrt{{{M}\over{r}}}}\over{r-2\cdot M}} , C=0 , D=-1 \right] , \left[ A=1 , B=-{{\sqrt{2} \cdot r \cdot \sqrt{{{M}\over{r}}}}\over{r-2\cdot M}}, C=0 , D=1 \right] \right] }$
rrogersSat, 24 Dec 2016 16:28:49 +0100https://ask.sagemath.org/question/36083/Solving systems of equations always returns [ ]https://ask.sagemath.org/question/25105/solving-systems-of-equations-always-returns/Suppose I have the set of equations and I'm trying to solve for f1, f2 and f3:
![formula][1]
[1]: http://latex.codecogs.com/gif.latex?f_1%20%26%3D%26%20a+b+f_2%20%5C%5C%202f_2%20%26%3D%26%20c+d+f_1%20%5C%5C%20f_3%20%26%3D%26%20f_1+f_2
I've tried solving it in the following way
eq1 = f1 == a + b + f2
eq2 = 2*f2 == c + d + f1
eq3 = f3 == f1 + f2
solve([eq1,eq2,eq3],f1,f2,f3)
[]
This is easy to solve using matrices, and I have double-checked that the answer is fully constrained, so why does sage always return [ ]? I would have expected answers for f1, f2 and f3 in terms of a, b , c and d. Is there another argument to solve() that tells Sage what I want my answer in terms of?
I would prefer to use solve() instead of matrices both for the sake of convenience and if I have a nonlinear system later on.
EvidloThu, 04 Dec 2014 01:07:57 +0100https://ask.sagemath.org/question/25105/determine consistency of nonlinear system of equationshttps://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/Hello,
I need to be able to determine the consistency of very large systems of polynomial equations, with 30-40 variables and as many equations. When I put such systems into ``solve``, I get the same system back again. Here are some equations typical of those in the systems I am dealing with:
``2*a0*b0 == 0,``
``2*a0*b5 + 2*a1*b4 + 2*a4*b1 + 2*a5*b0 - 4*a8*b8 == 0,``
``2*a0*b10 + 2*a1*b9 + 2*a10*b0 + 2*a2*b8 + 2*a8*b2 + 2*a9*b1 == 0,``
``3*b0^2*c6 + 6*b0*b1*c5 + 6*b0*b2*c4 + 6*b0*b4*c2 + 6*b0*b5*c1 + 6*b0*b6*c0 - 12*b0*b8*c9 - 12*b0*b9*c8 + 3*b1^2*c4 + 6*b1*b4*c1 + 6*b1*b5*c0 - 12*b1*b8*c8 + 6*b2*b4*c0 - 6*b8^2*c1 - 12*b8*b9*c0 + 2*a0*a6 + 2*a1*a5 + 2*a2*a4 - 4*a8*a9 == 0``
This is not a complete system - just a few equations to show the lengths of equations that tend to come up. Again, I don't care what any solutions are; I just need to know if any exist. Is there a way to do this in sage?
Thanks!shacsmugglerThu, 08 Dec 2011 14:32:48 +0100https://ask.sagemath.org/question/8540/