Ask Your Question

NickS's profile - activity

2016-01-03 18:47:20 +0200 received badge  Popular Question (source)
2015-12-01 00:25:10 +0200 commented answer Solving Simultaneous Equations: Excluding Imaginary Numbers

Thank you for your help. Could you please explain what's happening in the following line?

"[answer for answer in answers if all([value.rhs() in RDF for value in answer])]"

If you have time to walk through the logic of each for, in, and if, I would really appreciate it. I have some experience programming, but I'm still a novice with Sage.

As far as polynomials go, all the keywords that you need to "set them up" correctly seems kind of daunting. What is the advantage to using polynomials? Actually, what does it mean to use polynomials instead of, err, normal math?

2015-11-30 23:34:08 +0200 received badge  Student (source)
2015-11-30 23:12:33 +0200 asked a question Solving Simultaneous Equations: Excluding Imaginary Numbers

Hello all,

I am working on a Calculus problem where you have to find the critical points of a function f(x,y,z) subject to a constraint function c(x,y,z) = constant. I managed to use Sagemath to output the answers, but it is including answers that have complex numbers. How can I exclude the answers with complex numbers?

Here's the code I have written:

var('x y z u p', domain='real')
f = x^6 + y^6 + z^6
c = x^2 + y^2 + z^2
c1 = c == 6
fx = f.diff(x)
fy = f.diff(y)
fz = f.diff(z)
cx = u*c.diff(x)
cy = u*c.diff(y)
cz = u*c.diff(z)
eq1 = fx - cx == 0
eq2 = fy - cy == 0
eq3 = fz - cz == 0
answers = solve([eq1,eq2,eq3,c1],x,y,z,u)
2015-11-30 23:12:33 +0200 asked a question Solving Simultaneous Equations: How to Exclude Imaginary Numbers?

Hello all,

I am working on a Calculus problem where you have to find the critical points of a function f(x,y,z) subject to a constraint function c(x,y,z) = constant. I managed to use Sagemath to output the answers, but it is including answers that have complex numbers. How can I exclude the answers with complex numbers?

Here's the code I have written:

Blockquote var('x y z u p', domain='real') f = x^6 + y^6 + z^6 c = x^2 + y^2 + z^2 c1 = c == 6 fx = f.diff(x) fy = f.diff(y) fz = f.diff(z) cx = uc.diff(x) cy = uc.diff(y) cz = u*c.diff(z) eq1 = fx - cx == 0 eq2 = fy - cy == 0 eq3 = fz - cz == 0 answers = solve([eq1,eq2,eq3,c1],x,y,z,u)