# Solving a simple system of equations

 0 Hey Guys, New to Sage and just trying to solve a simple system of equations. The system is below: x,y,z,w,ha,hb,e,c = var('x y z w ha hb e c') f1 = (c*(x+y)*(ha-x))-(e*x) f2 = (c*(z+w)*(ha-x-z))-(c*z*(x+y)) - (e*z) f3 = (c*(x+y)*(hb-y-w))-(c*y*(z+w)) - (e*y) f4 = (c*(z+w)*(hb-w))-(e*w)  I want to find the equilibrium solutions, solving for x, y, z, w, when equations f1-f4 are equal to zero. So I try: solve([f1==0,f2==0,f3==0,f4==0],x,y,z,w)  Unfortunately this causes Sage to hang (or it takes a remarkably long time to solve that I interrupt the process). This problem shouldn't be difficult to solve, but I am at a loss as to what to do. Perhaps I am going about this the wrong way?? asked Jan 07 '12 Balder 1 ● 1 ● 1 DSM 4882 ● 12 ● 65 ● 105

## 3 Answers:

 1 You should be using Groebner bases (and the Singular interface) instead of general purpose symbolics (via Maxima) for systems of polynomial equations. The standard way of doing what you want is to compute a lexicographic Groebner basis along the lines of what I commented here. posted Jan 07 '12 Volker Braun 2666 ● 9 ● 24 ● 59
 0 I replaced cz with c * z and cy with c * y and got a (somewhat lengthy) solution immediatly. Does this solve it? posted Jan 07 '12 Emil Widmann 263 ● 2 ● 6 ● 14 Hey, thanks for the answer. Unfortunately I am not following what you did. Where exactly did you make the change? In my original code I see no cz or cy...??Balder (Jan 07 '12)
 0 I think your original question was edited, because when I answered before there were the lines f2 = (c(z+w)(ha-x-z))-(cz*(x+y)) - (e*z) f3 = (c(x+y)(hb-y-w))-(cy*(z+w)) - (e*y)  I added multiplication signs between cz and cy and pasted the following code into the cell x,y,z,w,ha,hb,e,c = var('x y z w ha hb e c') f1 = (c(x+y)(ha-x))-(e*x) f2 = (c(z+w)(ha-x-z))-(c*z(x+y)) - (e*z) f3 = (c(x+y)(hb-y-w))-(c*y(z+w)) - (e*y) f4 = (c(z+w)(hb-w))-(e*w) solve([f1==0,f2==0,f3==0,f4==0],x,y,z,w)  I then get the answer [[x == (c*e*hb - e^2*hb + (2*c^2 - e^3 + (c^2 + c)*e - e^2 + 3*c + 1)*ha)/(4*c^2 - e^4 + (c^2 - 1)*e^2 - 2*e^3 + 2*(2*c^2 + c)*e + 4*c + 1), y == -(e^3*hb - (c*hb - hb)*e^2 - c*e*hb - (c*e^2 - (c^2 - 2*c - 1)*e - 2*c^2 - c)*ha)/(4*c^2 - e^4 + (c^2 - 1)*e^2 - 2*e^3 + 2*(2*c^2 + c)*e + 4*c + 1), z == (c*e^2*hb - 2*c^2*hb - (c^2*hb - 2*c*hb - hb)*e + ((c - 1)*e^2 - e^3 + c*e)*ha - c*hb)/(4*c^2 - e^4 + (c^2 - 1)*e^2 - 2*e^3 + 2*(2*c^2 + c)*e + 4*c + 1), w == -(e^3*hb - 2*c^2*hb + e^2*hb - (c*e - e^2)*ha - (c^2*hb + c*hb)*e - 3*c*hb - hb)/(4*c^2 - e^4 + (c^2 - 1)*e^2 - 2*e^3 + 2*(2*c^2 + c)*e + 4*c + 1)]]  I just see that * sign is removed from normal text postings on this site, so your original system probably contained all *. In the current form with all * I get no solution either. - sorry PS: Question to the site admins: Is it a bug or a feature of this site that * is removed? posted Jan 07 '12 Emil Widmann 263 ● 2 ● 6 ● 14 @Emil Widmann: I'm not a site admin, but I can explain. It's a feature, although it's often troublesome for us mathy types: the asterisk is used to put things in italics (e.g. fred). I edited the original post to use the code blocks to get the formatting right when I saw that it had led to a misunderstanding.DSM (Jan 07 '12)

## Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

## Stats:

Asked: Jan 07 '12

Seen: 421 times

Last updated: Jan 07 '12

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.