Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

implicit_plot3d(A(a,b,c,d).determinant()==0,...), variable not found

Hi!; i've just today used sage for the first time in my life in order to do this one thing described below. I failed, so if anyone would share some helpful thoughts, Id be very grateful.

I have: four real variables: a,b,c,d, each one satisfying: 0=< a,b,c,d,a+b,a+c,...,c+d=<1, (so that m, the 3x3 matrix, is doubly stochastic:) m=[(a,b,1-a-b), (c,d, 1-c-d), (1-a-c, 1-b-d, a+b+c+d-1)]. I do some simple algerba with m end its elements, ending up with a 4x4, (a,b,c,d)-dependent matrix, A. I want to have a look at a plot of an implicit function det(A)==0. I figured i could use implicit_plot3d e.g. in (a,b,c) space with fixed d.

Yet something went wrong; last line of the error message says:

ValueError: Variable 'd' not found

here's, what I've typed from the top:

e_1=matrix(SR,3,3, [1,0,-1, 0,0,0, -1,0,1])

e_2=matrix(SR,3,3, [0,1,-1, 0,0,0, 0,-1,1])

e_3=matrix(SR,3,3, [0,0,0, 1,0,-1, -1,0,1])

e_4=matrix(SR,3,3, [0,0,0, 0,1,-1, 0,-1,1]);

var('a,b,c,d')

m=matrix(SR,3,3, [a,b,1-a-b, c,d,1-c-b, 1-a-c, 1-b-d,a+b+c+d-1])

m_1=e_1m+me_1

m_2=e_2m+me_2

m_3=e_3m+me_3

m_4=e_4m+me_4

A=matrix(SR,4,4, [ m_1[0,0], m_1[0,1],m_1[1,0],m_1[1,1], m_2[0,0], m_2[0,1],m_2[1,0],m_2[1,1], m_3[0,0], m_3[0,1],m_3[1,0],m_3[1,1], m_4[0,0], m_4[0,1],m_4[1,0],m_4[1,1] ])

d=0.5

f(a,b,c)=A.determinant()

implicit_plot3d(f, (a, 0,1), (b, 0,1), (c, 0,1))

click to hide/show revision 2
No.2 Revision

implicit_plot3d(A(a,b,c,d).determinant()==0,...), variable not found

Hi!; i've just today used sage for the first time in my life in order to do this one thing described below. I failed, so if anyone would share some helpful thoughts, Id be very grateful.

I have: four real variables: a,b,c,d, each one satisfying: 0=< a,b,c,d,a+b,a+c,...,c+d=<1, (so that m, the 3x3 matrix, is doubly stochastic:) m=[(a,b,1-a-b), (c,d, 1-c-d), (1-a-c, 1-b-d, a+b+c+d-1)]. I do some simple algerba with m end its elements, ending up with a 4x4, (a,b,c,d)-dependent matrix, A. I want to have a look at a plot of an implicit function det(A)==0. I figured i could use implicit_plot3d e.g. in (a,b,c) space with fixed d.

Yet something went wrong; last line of the error message says:

ValueError: Variable 'd' not found

here's, what I've typed from the top:

e_1=matrix(SR,3,3, [1,0,-1, 0,0,0, -1,0,1])

-1,0,1]) e_2=matrix(SR,3,3, [0,1,-1, 0,0,0, 0,-1,1])

0,-1,1]) e_3=matrix(SR,3,3, [0,0,0, 1,0,-1, -1,0,1])

-1,0,1]) e_4=matrix(SR,3,3, [0,0,0, 0,1,-1, 0,-1,1]);

var('a,b,c,d')

0,-1,1]); var('a,b,c,d') m=matrix(SR,3,3, [a,b,1-a-b, c,d,1-c-b, 1-a-c, 1-b-d,a+b+c+d-1])

m_1=e_1m+me_1

m_2=e_2m+me_2

m_3=e_3m+me_3

m_4=e_4m+me_4

1-b-d,a+b+c+d-1]) m_1=e_1*m+m*e_1 m_2=e_2*m+m*e_2 m_3=e_3*m+m*e_3 m_4=e_4*m+m*e_4 A=matrix(SR,4,4, [ m_1[0,0], m_1[0,1],m_1[1,0],m_1[1,1], m_2[0,0], m_2[0,1],m_2[1,0],m_2[1,1], m_3[0,0], m_3[0,1],m_3[1,0],m_3[1,1], m_4[0,0], m_4[0,1],m_4[1,0],m_4[1,1] ])

d=0.5

f(a,b,c)=A.determinant()

m_1[0,0],m_1[0,1],m_1[1,0],m_1[1,1], m_2[0,0], m_2[0,1],m_2[1,0],m_2[1,1],m_3[0,0],m_3[0,1],m_3[1,0],m_3[1,1], m_4[0,0],m_4[0,1],m_4[1,0],m_4[1,1] ]) d=0.5 f(a,b,c)=A.determinant() implicit_plot3d(f, (a, 0,1), (b, 0,1), (c, 0,1))

0,1))
click to hide/show revision 3
retagged

implicit_plot3d(A(a,b,c,d).determinant()==0,...), variable not found

Hi!; i've just today used sage for the first time in my life in order to do this one thing described below. I failed, so if anyone would share some helpful thoughts, Id be very grateful.

I have: four real variables: a,b,c,d, each one satisfying: 0=< a,b,c,d,a+b,a+c,...,c+d=<1, (so that m, the 3x3 matrix, is doubly stochastic:) m=[(a,b,1-a-b), (c,d, 1-c-d), (1-a-c, 1-b-d, a+b+c+d-1)]. I do some simple algerba with m end its elements, ending up with a 4x4, (a,b,c,d)-dependent matrix, A. I want to have a look at a plot of an implicit function det(A)==0. I figured i could use implicit_plot3d e.g. in (a,b,c) space with fixed d.

Yet something went wrong; last line of the error message says:

ValueError: Variable 'd' not found

here's, what I've typed from the top:

e_1=matrix(SR,3,3, [1,0,-1, 0,0,0, -1,0,1])
e_2=matrix(SR,3,3, [0,1,-1, 0,0,0, 0,-1,1])
e_3=matrix(SR,3,3, [0,0,0, 1,0,-1, -1,0,1])
e_4=matrix(SR,3,3, [0,0,0, 0,1,-1, 0,-1,1]);
var('a,b,c,d')
m=matrix(SR,3,3, [a,b,1-a-b, c,d,1-c-b, 1-a-c, 1-b-d,a+b+c+d-1])
m_1=e_1*m+m*e_1
m_2=e_2*m+m*e_2
m_3=e_3*m+m*e_3
m_4=e_4*m+m*e_4
A=matrix(SR,4,4, [ m_1[0,0],m_1[0,1],m_1[1,0],m_1[1,1], m_2[0,0], m_2[0,1],m_2[1,0],m_2[1,1],m_3[0,0],m_3[0,1],m_3[1,0],m_3[1,1], m_4[0,0],m_4[0,1],m_4[1,0],m_4[1,1] ])
d=0.5
f(a,b,c)=A.determinant()
implicit_plot3d(f, (a, 0,1), (b, 0,1), (c, 0,1))