suppose I have this equation: (x^2+y^2+3z^3)/(5*z^2*x^3)=0 and I want to find x in relation to the other variables which actually is: x=sqrt(-3*z^3-y^2) or x=-sqrt(-3*z^3-y^2) Can R give me this expression solution? I know there is uniroot, but here I want the "expression" not the value, because I do not have values for y and z. Thanks -- View this message in context: http://www.nabble.com/How-can-R-be-used-to-solve-algebra-equations--tf4899794.html#a14034422 Sent from the R help mailing list archive at Nabble.com.
The Ryacas package might be able to do it... S?ren ________________________________ Fra: r-help-bounces at r-project.org p? vegne af francogrex Sendt: to 29-11-2007 22:00 Til: r-help at r-project.org Emne: [R] How can R be used to solve algebra equations? suppose I have this equation: (x^2+y^2+3z^3)/(5*z^2*x^3)=0 and I want to find x in relation to the other variables which actually is: x=sqrt(-3*z^3-y^2) or x=-sqrt(-3*z^3-y^2) Can R give me this expression solution? I know there is uniroot, but here I want the "expression" not the value, because I do not have values for y and z. Thanks -- View this message in context: http://www.nabble.com/How-can-R-be-used-to-solve-algebra-equations--tf4899794.html#a14034422 Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
On Thu, Nov 29, 2007 at 01:00:59PM -0800, francogrex wrote:> > suppose I have this equation: > (x^2+y^2+3z^3)/(5*z^2*x^3)=0 > > and I want to find x in relation to the other variables which actually is: > > x=sqrt(-3*z^3-y^2) or x=-sqrt(-3*z^3-y^2) > > Can R give me this expression solution? I know there is uniroot, but here I > want the "expression" not the value, because I do not have values for y and > z.I suggest the use of maxima rather than R. The two complement each other very nicely: http://maxima.sf.net -- Daniel Lakeland dlakelan at street-artists.org http://www.street-artists.org/~dlakelan
Gabor Grothendieck
2007-Nov-29 22:24 UTC
[R] How can R be used to solve algebra equations?
Yes, try this:> library(Ryacas)Loading required package: XML> x <- Sym("x") > y <- Sym("y") > z <- Sym("z") > Solve((x^2+y^2+3*z^3)/(5*z^2*x^3)==0, x)[1] "Starting Yacas!" expression(list(x == root(-(4 * (y^2 + 3 * z^3)), 2)/2, x = -root(-(4 * (y^2 + 3 * z^3)), 2)/2)) On Nov 29, 2007 5:06 PM, S?ren H?jsgaard <Soren.Hojsgaard at agrsci.dk> wrote:> The Ryacas package might be able to do it... > S?ren > > ________________________________ > > Fra: r-help-bounces at r-project.org p? vegne af francogrex > Sendt: to 29-11-2007 22:00 > Til: r-help at r-project.org > Emne: [R] How can R be used to solve algebra equations? > > > > > > suppose I have this equation: > (x^2+y^2+3z^3)/(5*z^2*x^3)=0 > > and I want to find x in relation to the other variables which actually is: > > x=sqrt(-3*z^3-y^2) or x=-sqrt(-3*z^3-y^2) > > Can R give me this expression solution? I know there is uniroot, but here I > want the "expression" not the value, because I do not have values for y and > z. > > Thanks > -- > View this message in context: http://www.nabble.com/How-can-R-be-used-to-solve-algebra-equations--tf4899794.html#a14034422 > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
francogrex said the following on 11/29/2007 1:00 PM:> suppose I have this equation: > (x^2+y^2+3z^3)/(5*z^2*x^3)=0 > > and I want to find x in relation to the other variables which actually is: > > x=sqrt(-3*z^3-y^2) or x=-sqrt(-3*z^3-y^2) > > Can R give me this expression solution? I know there is uniroot, but here I > want the "expression" not the value, because I do not have values for y and > z. > > ThanksTry: library(Ryacas) yacas("Solve((x^2+y^2+3*z^3)/(5*z^2*x^3)==0, x)") expression(list(x == root(-(4 * (y^2 + 3 * z^3)), 2)/2, x = -root(-(4 * (y^2 + 3 * z^3)), 2)/2)) HTH, --sundar