Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
var('x,y,z,K')
#K=4.48e-13   # use later for substitution
xi=0.75
yi=0
zi=0
eq1 = K==y^2*z/x^2
eq2 = xi+yi==x+y
eq3 = 2*xi+yi+2*zi==2*x+y+2*z

#  x , y dependent on z
solns = solve([eq2,eq3],x,y)
print solns

# z dependent on K
solns2 = solve(eq1.subs(solns),z)
print solns2

print solns2[2].subs(K=4.48e-13)   # using real solution
solns3 = solve([eq2,eq3.subs(z == 0.0000397877574911779)],x,y)
for s in solns3[0]: print s.lhs() == s.rhs().n(30)