showing the answer of solve in the notebook.

2 views
Skip to first unread message

adrian

unread,
Feb 5, 2009, 12:56:06 AM2/5/09
to sage-support
If, in the notebook one writes:
a,b,c,d,n=var('a b c d n')
solve([a*d-b*c==1,a*d/(a*d - b*c) - c*(a*n + b)/(a*d - b*c)==1,c*d/
(a*d - b*c) - c*(c*n + d)/(a*d - b*c)==0, a*(c*n + d)/(a*d - b*c) -b*c/
(a*d - b*c)==1],a,b,c,d)

sage does not return anything.

if one does, instead
a,b,c,d,n=var('a b c d n')
r=solve([a*d-b*c==1,a*d/(a*d - b*c) - c*(a*n + b)/(a*d - b*c)==1,c*d/
(a*d - b*c) - c*(c*n + d)/(a*d - b*c)==0, a*(c*n + d)/(a*d - b*c) -b*c/
(a*d - b*c)==1],a,b,c,d)
print(r) #show(r) also works

Then sage does return
[
[a == 1/r14, b == r13, c == 0, d == r14]
]
(The answer has two degrees of freedom...)

This behavior is different than

solve([a*x+b*n==c,c*x+d*n==e],x,n)

which does display the answer without first assigning and then showing
the answer.

In the console, sage has no problem in giving the answer for both.

Thanks, and I think SAGE is a wonderful program.

-Adrian.
Reply all
Reply to author
Forward
0 new messages