Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

hypothetical bug on nonlinear system output

hypothetical bug on nonlinear system output

var('N p M a b c A B C D S')


eq0 = N-187 == 0

eq1 = 3*((p^2-4*p+N)/(8*p)+p)*((p^2-4*p+N)/(8*p)+p+1)/2-M == 0
eq2 = 3*((2*(3*((N-3)/8+p^2)+1)-3*(1-((-p^2+2*p+N)/(4*p)+2*p))+1)/24 + M)+1 - A == 0
eq3 = 3*((2*A - 3*a + 1)/24 + M) + 1 - B == 0
eq4 = A + (3*a*(a - 1))/2 - 3*M-1-M == 0
eq5 = 3*((2*B - 3*b + 1)/24 + M) + 1 - C == 0
eq6 = B + (3*b*(b - 1))/2 - 3*M-1-M == 0
eq7 = 3*((2*C - 3*c + 1)/24 + M) + 1 - D == 0
eq8 = C + (3*c*(c - 1))/2 - 3*M-1-M == 0
eq9 = 3*((2*D + 3 + 1)/24 + M) + 1 - 3*M-1-M == 0
eq10 = D + 3 - 3*M-1-M == 0
eq11 = 3*((2*( 3*M+1+M) - 3*1 + 1)/24 + M) + 1 - 3*M-1-M == 0

solutions = solve([eq0,eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11],N,p,M,a,b,c,A,B,C,D,S)
sol = solutions 
print(sol)

OUTPUT

(N, p, M, a, b, c, A, B, C, D, S)
[
[N == 187, p == 11, M == 315, a == -11, b == -5, c == 3, A == 1063, B == 1216, C == 1252, D == 1258, S == r1],
[N == 187, p == (17/7), M == (11205/49), a == -11, b == -5, c == 3, A == (35167/49), B == (42664/49), C == (44428/49), D == (44722/49), S == r2]
]

We assign for example (-p^2+2p+N)/(4p)+2*p == 22

and we will have a different output

var('N p M a b c A B C D S')


eq0 = N-187 == 0

eq1 = 3*((p^2-4*p+N)/(8*p)+p)*((p^2-4*p+N)/(8*p)+p+1)/2-M == 0
eq2 = 3*((2*(3*((N-3)/8+p^2)+1)-3*(1-((-p^2+2*p+N)/(4*p)+2*p))+1)/24 + M)+1 - A == 0
eq3 = 3*((2*A - 3*a + 1)/24 + M) + 1 - B == 0
eq4 = A + (3*a*(a - 1))/2 - 3*M-1-M == 0
eq5 = 3*((2*B - 3*b + 1)/24 + M) + 1 - C == 0
eq6 = B + (3*b*(b - 1))/2 - 3*M-1-M == 0
eq7 = 3*((2*C - 3*c + 1)/24 + M) + 1 - D == 0
eq8 = C + (3*c*(c - 1))/2 - 3*M-1-M == 0
eq9 = 3*((2*D + 3 + 1)/24 + M) + 1 - 3*M-1-M == 0
eq10 = D + 3 - 3*M-1-M == 0
eq11 = 3*((2*(3*M+1+M) - 3*1 + 1)/24 + M) + 1 - 3*M-1-M == 0

eq12 = (-p^2+2*p+N)/(4*p)+2*p-22 ==0

solutions = solve([eq0,eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12],N,p,M,a,b,c,A,B,C,D,S)
sol = solutions 
print(sol)

OUTPUT

(N, p, M, a, b, c, A, B, C, D, S)
[
[N == 187, p == -6/7*sqrt(15) + 43/7, M == -387/49*sqrt(15) + 44505/196, a == 11, b == -5, c == 3, A == -1548/49*sqrt(15) + 36469/49, B == -1548/49*sqrt(15) + 42349/49, C == -1548/49*sqrt(15) + 44113/49, D == -1548/49*sqrt(15) + 44407/49, S == r73],
[N == 187, p == 6/7*sqrt(15) + 43/7, M == 387/49*sqrt(15) + 44505/196, a == 11, b == -5, c == 3, A == 1548/49*sqrt(15) + 36469/49, B == 1548/49*sqrt(15) + 42349/49, C == 1548/49*sqrt(15) + 44113/49, D == 1548/49*sqrt(15) + 44407/49, S == r74]
]

How does SageMath calculate the output of the first system?

click to hide/show revision 2
retagged

hypothetical bug on nonlinear system output

hypothetical bug on nonlinear system output

var('N p M a b c A B C D S')


eq0 = N-187 == 0

eq1 = 3*((p^2-4*p+N)/(8*p)+p)*((p^2-4*p+N)/(8*p)+p+1)/2-M == 0
eq2 = 3*((2*(3*((N-3)/8+p^2)+1)-3*(1-((-p^2+2*p+N)/(4*p)+2*p))+1)/24 + M)+1 - A == 0
eq3 = 3*((2*A - 3*a + 1)/24 + M) + 1 - B == 0
eq4 = A + (3*a*(a - 1))/2 - 3*M-1-M == 0
eq5 = 3*((2*B - 3*b + 1)/24 + M) + 1 - C == 0
eq6 = B + (3*b*(b - 1))/2 - 3*M-1-M == 0
eq7 = 3*((2*C - 3*c + 1)/24 + M) + 1 - D == 0
eq8 = C + (3*c*(c - 1))/2 - 3*M-1-M == 0
eq9 = 3*((2*D + 3 + 1)/24 + M) + 1 - 3*M-1-M == 0
eq10 = D + 3 - 3*M-1-M == 0
eq11 = 3*((2*( 3*M+1+M) - 3*1 + 1)/24 + M) + 1 - 3*M-1-M == 0

solutions = solve([eq0,eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11],N,p,M,a,b,c,A,B,C,D,S)
sol = solutions 
print(sol)

OUTPUT

(N, p, M, a, b, c, A, B, C, D, S)
[
[N == 187, p == 11, M == 315, a == -11, b == -5, c == 3, A == 1063, B == 1216, C == 1252, D == 1258, S == r1],
[N == 187, p == (17/7), M == (11205/49), a == -11, b == -5, c == 3, A == (35167/49), B == (42664/49), C == (44428/49), D == (44722/49), S == r2]
]

We assign for example (-p^2+2p+N)/(4p)+2*p == 22

and we will have a different output

var('N p M a b c A B C D S')


eq0 = N-187 == 0

eq1 = 3*((p^2-4*p+N)/(8*p)+p)*((p^2-4*p+N)/(8*p)+p+1)/2-M == 0
eq2 = 3*((2*(3*((N-3)/8+p^2)+1)-3*(1-((-p^2+2*p+N)/(4*p)+2*p))+1)/24 + M)+1 - A == 0
eq3 = 3*((2*A - 3*a + 1)/24 + M) + 1 - B == 0
eq4 = A + (3*a*(a - 1))/2 - 3*M-1-M == 0
eq5 = 3*((2*B - 3*b + 1)/24 + M) + 1 - C == 0
eq6 = B + (3*b*(b - 1))/2 - 3*M-1-M == 0
eq7 = 3*((2*C - 3*c + 1)/24 + M) + 1 - D == 0
eq8 = C + (3*c*(c - 1))/2 - 3*M-1-M == 0
eq9 = 3*((2*D + 3 + 1)/24 + M) + 1 - 3*M-1-M == 0
eq10 = D + 3 - 3*M-1-M == 0
eq11 = 3*((2*(3*M+1+M) - 3*1 + 1)/24 + M) + 1 - 3*M-1-M == 0

eq12 = (-p^2+2*p+N)/(4*p)+2*p-22 ==0

solutions = solve([eq0,eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12],N,p,M,a,b,c,A,B,C,D,S)
sol = solutions 
print(sol)

OUTPUT

(N, p, M, a, b, c, A, B, C, D, S)
[
[N == 187, p == -6/7*sqrt(15) + 43/7, M == -387/49*sqrt(15) + 44505/196, a == 11, b == -5, c == 3, A == -1548/49*sqrt(15) + 36469/49, B == -1548/49*sqrt(15) + 42349/49, C == -1548/49*sqrt(15) + 44113/49, D == -1548/49*sqrt(15) + 44407/49, S == r73],
[N == 187, p == 6/7*sqrt(15) + 43/7, M == 387/49*sqrt(15) + 44505/196, a == 11, b == -5, c == 3, A == 1548/49*sqrt(15) + 36469/49, B == 1548/49*sqrt(15) + 42349/49, C == 1548/49*sqrt(15) + 44113/49, D == 1548/49*sqrt(15) + 44407/49, S == r74]
]

How does SageMath calculate the output of the first system?