Gabor G a ecrit: Check out the Ryacas package. There is a vignette with some examples. ---- Which led me to the manuals for yacas itself. I'm guessing there may be a way to use yacas' "AND" construct to combine a few equations and then hope the Newton Solver can work with that, but it's not clear that will work. TK!Solver is nice because you aren't limited to linear equations, nor to equations which "fit" into a matrix structure, and because it's legal to have more than one unknown to be back-solved (assuming the problem is not under- or over-defined, of course).
general inverse solver?
10 messages · Carl Witthoft, Erich Neuwirth, Stavros Macrakis +3 more
The forms of equations are limited but its not limited to just one:
library(Ryacas)
Loading required package: XML
x <- Sym("x")
y <- Sym("y")
Solve(List(x+y == 2, x-y == 0), List(x, y))
[1] "Starting Yacas!" expression(list(list(x == 2 - y, y == 1)))
On Mon, Feb 9, 2009 at 7:45 PM, Carl Witthoft <carl at witthoft.com> wrote:
Gabor G a ecrit: Check out the Ryacas package. There is a vignette with some examples. ---- Which led me to the manuals for yacas itself. I'm guessing there may be a way to use yacas' "AND" construct to combine a few equations and then hope the Newton Solver can work with that, but it's not clear that will work. TK!Solver is nice because you aren't limited to linear equations, nor to equations which "fit" into a matrix structure, and because it's legal to have more than one unknown to be back-solved (assuming the problem is not under- or over-defined, of course).
______________________________________________ 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.
I know that Ryacas is promoted here whenever requests about symbolic algebra or calculus appear on the R-help list. But to say the truth, Yacas itself is a very very limited Computer Algebra System and looking onto its home page it appears the development will stop or has stopped anyway. It would be fair to clearly state that there is no R package to solve somewhat more involved symbolic mathematical problems. One could then point the requestor to one of the open source Computer Algebra Systems (CAS) such as Maxima or Axiom. Interestingly, the free Math Toolbox Euler by Grossmann has integrated Maxima into its numerical environment in a way that is really useful for numerical and symbolic computations. I could imagine that in a similar way Maxima can be integrated into R bringing the full power of computer algebra to the R community. Hans W. Borchers ABB Corporate Research ---- Postscript "The Euler Mathematical Toolbox is a powerful, versatile, and open source software for numerical and symbolic computations ... Euler supports symbolic mathematics using the open algebra system Maxima." <http://mathsrv.ku-eichstaett.de/MGF/homes/grothmann/euler/>
Gabor Grothendieck wrote:
The forms of equations are limited but its not limited to just one:
library(Ryacas)
Loading required package: XML
x <- Sym("x")
y <- Sym("y")
Solve(List(x+y == 2, x-y == 0), List(x, y))
[1] "Starting Yacas!" expression(list(list(x == 2 - y, y == 1))) On Mon, Feb 9, 2009 at 7:45 PM, Carl Witthoft <carl at witthoft.com> wrote:
Gabor G a ecrit: Check out the Ryacas package. There is a vignette with some examples. ---- Which led me to the manuals for yacas itself. I'm guessing there may be a way to use yacas' "AND" construct to combine a few equations and then hope the Newton Solver can work with that, but it's not clear that will work. TK!Solver is nice because you aren't limited to linear equations, nor to equations which "fit" into a matrix structure, and because it's legal to have more than one unknown to be back-solved (assuming the problem is not under- or over-defined, of course).
______________________________________________ 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.
View this message in context: http://www.nabble.com/general-inverse-solver--tp21902788p21928972.html Sent from the R help mailing list archive at Nabble.com.
Yacas was completely rewritten in java (Ryacas interfaces to the C version) since the Ryacas project started so I would not exactly characterize yacas as dead. The work that is going on in yacas may not have high visibility but that does not mean there is none. Also while Maxima is more sophisticated in terms of algorithms, yacas is actually more sophisticated from the viewpoint of its language which borrows ideas from both imperative and prolog programming and its interfaces are more sophisticated (it is one of the few CAS systems that developed an OpenMath interface) and its socket server is used by the Ryacas interface. yacas can also translate math expressions to TeX and do exact arithmetic. Also to put this in the correct context, yacas does seem capable of answering the majority of questions that are posed on r-help that need a CAS in the answer. From a practical viewpoint it does seem to have the facilities that are most often needed. The Ryacas vignette has a survey of some of its algebra capabilities. That being said, without taking away from yacas there is work going on to interface R to a second CAS. On Tue, Feb 10, 2009 at 2:33 AM, Hans W. Borchers
<hwborchers at googlemail.com> wrote:
I know that Ryacas is promoted here whenever requests about symbolic algebra or calculus appear on the R-help list. But to say the truth, Yacas itself is a very very limited Computer Algebra System and looking onto its home page it appears the development will stop or has stopped anyway. It would be fair to clearly state that there is no R package to solve somewhat more involved symbolic mathematical problems. One could then point the requestor to one of the open source Computer Algebra Systems (CAS) such as Maxima or Axiom. Interestingly, the free Math Toolbox Euler by Grossmann has integrated Maxima into its numerical environment in a way that is really useful for numerical and symbolic computations. I could imagine that in a similar way Maxima can be integrated into R bringing the full power of computer algebra to the R community. Hans W. Borchers ABB Corporate Research ---- Postscript "The Euler Mathematical Toolbox is a powerful, versatile, and open source software for numerical and symbolic computations ... Euler supports symbolic mathematics using the open algebra system Maxima." <http://mathsrv.ku-eichstaett.de/MGF/homes/grothmann/euler/> Gabor Grothendieck wrote:
The forms of equations are limited but its not limited to just one:
library(Ryacas)
Loading required package: XML
x <- Sym("x")
y <- Sym("y")
Solve(List(x+y == 2, x-y == 0), List(x, y))
[1] "Starting Yacas!" expression(list(list(x == 2 - y, y == 1))) On Mon, Feb 9, 2009 at 7:45 PM, Carl Witthoft <carl at witthoft.com> wrote:
Gabor G a ecrit: Check out the Ryacas package. There is a vignette with some examples. ---- Which led me to the manuals for yacas itself. I'm guessing there may be a way to use yacas' "AND" construct to combine a few equations and then hope the Newton Solver can work with that, but it's not clear that will work. TK!Solver is nice because you aren't limited to linear equations, nor to equations which "fit" into a matrix structure, and because it's legal to have more than one unknown to be back-solved (assuming the problem is not under- or over-defined, of course).
______________________________________________ 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.
-- View this message in context: http://www.nabble.com/general-inverse-solver--tp21902788p21928972.html 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.
My main problem is that yacas can only factorize polynomials in one variable. Any CAS which is not able to factor a^2 - b^2 into (a+b)*(a-B) for me is less than satisfactory.
On Feb 10, 2009, at 1:51 PM, Gabor Grothendieck wrote:
Yacas was completely rewritten in java (Ryacas interfaces to the C version) since the Ryacas project started so I would not exactly characterize yacas as dead. The work that is going on in yacas may not have high visibility but that does not mean there is none. Also while Maxima is more sophisticated in terms of algorithms, yacas is actually more sophisticated from the viewpoint of its language which borrows ideas from both imperative and prolog programming and its interfaces are more sophisticated (it is one of the few CAS systems that developed an OpenMath interface) and its socket server is used by the Ryacas interface. yacas can also translate math expressions to TeX and do exact arithmetic. Also to put this in the correct context, yacas does seem capable of answering the majority of questions that are posed on r-help that need a CAS in the answer. From a practical viewpoint it does seem to have the facilities that are most often needed. The Ryacas vignette has a survey of some of its algebra capabilities. That being said, without taking away from yacas there is work going on to interface R to a second CAS. On Tue, Feb 10, 2009 at 2:33 AM, Hans W. Borchers <hwborchers at googlemail.com> wrote:
I know that Ryacas is promoted here whenever requests about symbolic algebra or calculus appear on the R-help list. But to say the truth, Yacas itself is a very very limited Computer Algebra System and looking onto its home page it appears the development will stop or has stopped anyway. It would be fair to clearly state that there is no R package to solve somewhat more involved symbolic mathematical problems. One could then point the requestor to one of the open source Computer Algebra Systems (CAS) such as Maxima or Axiom. Interestingly, the free Math Toolbox Euler by Grossmann has integrated Maxima into its numerical environment in a way that is really useful for numerical and symbolic computations. I could imagine that in a similar way Maxima can be integrated into R bringing the full power of computer algebra to the R community. Hans W. Borchers ABB Corporate Research ---- Postscript "The Euler Mathematical Toolbox is a powerful, versatile, and open source software for numerical and symbolic computations ... Euler supports symbolic mathematics using the open algebra system Maxima." <http://mathsrv.ku-eichstaett.de/MGF/homes/grothmann/euler/> Gabor Grothendieck wrote:
The forms of equations are limited but its not limited to just one:
library(Ryacas)
Loading required package: XML
x <- Sym("x")
y <- Sym("y")
Solve(List(x+y == 2, x-y == 0), List(x, y))
[1] "Starting Yacas!" expression(list(list(x == 2 - y, y == 1))) On Mon, Feb 9, 2009 at 7:45 PM, Carl Witthoft <carl at witthoft.com> wrote:
Gabor G a ecrit: Check out the Ryacas package. There is a vignette with some examples. ---- Which led me to the manuals for yacas itself. I'm guessing there may be a way to use yacas' "AND" construct to combine a few equations and then hope the Newton Solver can work with that, but it's not clear that will work. TK!Solver is nice because you aren't limited to linear equations, nor to equations which "fit" into a matrix structure, and because it's legal to have more than one unknown to be back-solved (assuming the problem is not under- or over-defined, of course).
______________________________________________ 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.
-- View this message in context: http://www.nabble.com/general-inverse-solver--tp21902788p21928972.html 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.
-- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-39464 Fax: +43-1-4277-39459
Gabor Grothendieck <ggrothendieck <at> gmail.com> writes:
Yacas was completely rewritten in java (Ryacas interfaces to the C version) since the Ryacas project started so I would not exactly characterize yacas as dead. The work that is going on in yacas may not have high visibility but that does not mean there is none. Also while Maxima is more sophisticated in terms of algorithms, yacas is actually more sophisticated from the viewpoint of its language which borrows ideas from both imperative and prolog programming and its interfaces are more sophisticated (it is one of the few CAS systems that developed an OpenMath interface) and its socket server is used by the Ryacas interface. yacas can also translate math expressions to TeX and do exact arithmetic. Also to put this in the correct context, yacas does seem capable of answering the majority of questions that are posed on r-help that need a CAS in the answer. From a practical viewpoint it does seem to have the facilities that are most often needed. The Ryacas vignette has a survey of some of its algebra capabilities.
I do not agree with this statement. Looking back into some of the requests for symbolic computations on this help list, [R]Yacas showed off weaknesses such as: - extremely slow in high-precision arithmetic - not solving very high-dimensional polynomials - does not simplify expressions in several variables - does not solve systems of equations except linear ones - does not symbolically solve medium to complex integrals - has very few special functions - therefore differentiation is unsatisfying
From a statistics point of view or application this may not be so relevant, but
considering the requests it illustrates that Yacas is not providing necessary CAS features. Especially the missing capabilities in symbolic integration can be painful in a statistics environment. Many times Ryacas was pointed out, it was actually not solving the problem. The examples in the Ryacas vignette are -- in my opinion -- trivial ones and do not display advanced capabilities. This is not meant to diminish the efforts invested in the Yacas software over the years. I know a bit how difficult it is to write software for symbolic computations. But in my opinion it also is evidence that a more advanced computer algebra module could be very valuable for extending and improving the R system. Hans W. Borchers
That being said, without taking away from yacas there is work going on to interface R to a second CAS. On Tue, Feb 10, 2009 at 2:33 AM, Hans W. Borchers <hwborchers <at> googlemail.com> wrote:
I know that Ryacas is promoted here whenever requests about symbolic algebra or calculus appear on the R-help list. But to say the truth, Yacas itself is a very very limited Computer Algebra System and looking onto its home page it appears the development will stop or has stopped anyway. It would be fair to clearly state that there is no R package to solve somewhat more involved symbolic mathematical problems. One could then point the requestor to one of the open source Computer Algebra Systems (CAS) such as Maxima or Axiom. Interestingly, the free Math Toolbox Euler by Grossmann has integrated Maxima into its numerical environment in a way that is really useful for numerical and symbolic computations. I could imagine that in a similar way Maxima can be integrated into R bringing the full power of computer algebra to the R community. Hans W. Borchers ABB Corporate Research
On Tue, Feb 10, 2009 at 7:51 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
...Also while Maxima is more sophisticated in terms of algorithms,
Glad to hear it... (I first worked on Maxima in 1971...)
yacas is actually more sophisticated from the viewpoint of its language which borrows ideas from both imperative and prolog programming
It is true that Yacas has a nicer syntax for its pattern-matching functionality than Maxima, but I think they are fundamentally very similar. In particular, as far as I can tell, neither does backtracking or unification, so neither is very Prolog-like.
and its interfaces are more sophisticated (it is one of the few CAS systems that developed an OpenMath interface) and its socket server is used by the Ryacas interface.
Maxima interfaces to a variety of other systems via sockets. It does not have an OpenMath interface (yet!), but I don't know how useful that is compared to other linearized tree structures.
yacas can also translate math expressions to TeX and do exact arithmetic.
Maxima can also output TeX and do exact rational arithmetic and
arbitrary-precision floating-point arithmetic. Maxima also handles a
variety of cases which apparently Yacas doesn't, like factorization of
multivariate polynomials (seems pretty basic!), many special
functions, etc. Maxima also has an active user and development
community.
-s
I am not sure what the point of all this is. This is an R list, not a CAS list. The recommendation to use yacas is based on the fact that there is an interface between R and yacas. There is no interface between R and Maxima so Maxima is not in the running. Anyone who has used Maxima knows that is an impressive piece of software but that's not the point. Regarding, why there is no interface to Maxima, its because its harder to interface to Maxima than yacas. There are two problems here: 1. Maxima does not incorporate a socket server as far as I know. You would have to write it and that may or may not need an in depth understanding of Maxima to do so but in any case represents work. With yacas you don't have to write a server since yacas itself already contains a server. Just run: yacas --server .,. and the server side is done. (In the case of yacas it would also be possible to use its C interface for an in-process interface or presumably the java interface of the new java version of yacas. With Maxima it would be more problematic since its written in Lisp.) 2. Once you have created some sort of communications channel then what? If you want more than a crude interface that passes an unprocessed character string to the CAS and then passes one back then you will want to translate between R and the CAS. With yacas, OpenMath facilitates this greatly. The end result is that its more work to meaningfullly interface with Maxima than with yacas yet yacas satisfies the majority of needs of a CAS. There is the minority who need more powerful algorithms but I think it was a reasonable step to handle the 80% that can be accommodated most easily first by using yacas. The remaining 20%, which is what the other respondents to this thread are discussing will in part be addressed in the future possibly, in part, by the second project I am working on now. Perhaps some would quibble with the 80/20 and if you are in the 20 it probably seems like 100 but we will never settle that question definitively.
Gabor Grothendieck <ggrothendieck <at> gmail.com> writes:
I am not sure what the point of all this is.
The point of all this is: 1. Some users of R here on the list apparently would like to have more powerful CAS functionalities than Yacas can provide. 2. Many of the solution hints to Ryacas on this list were simply not solving the resp. problem, so the 80/20 statement of yours may be downright wrong. 3. Maxima does incorporate a socket server and can be integrated into other systems, see EULER (do you never listen?). What are you mourning about? Of course, it was great that you made available Yacas for R. But others have the right to discuss their wishes here w/o being 'slammed' every time with questionable hints to Ryacas. I agree arguments have been exchanged and we should stop here. After this discussion, I wish someone would think about an Rmaxima package (along the lines of EULER, e.g.), I cant do it, unfortunately. Hans Werner Borchers
This is an R list, not a CAS list. The recommendation to use yacas is based on the fact that there is an interface between R and yacas. There is no interface between R and Maxima so Maxima is not in the running. Anyone who has used Maxima knows that is an impressive piece of software but that's not the point. Regarding, why there is no interface to Maxima, its because its harder to interface to Maxima than yacas. There are two problems here: 1. Maxima does not incorporate a socket server as far as I know. You would have to write it and that may or may not need an in depth understanding of Maxima to do so but in any case represents work. With yacas you don't have to write a server since yacas itself already contains a server. Just run: yacas --server .,. and the server side is done. (In the case of yacas it would also be possible to use its C interface for an in-process interface or presumably the java interface of the new java version of yacas. With Maxima it would be more problematic since its written in Lisp.) 2. Once you have created some sort of communications channel then what? If you want more than a crude interface that passes an unprocessed character string to the CAS and then passes one back then you will want to translate between R and the CAS. With yacas, OpenMath facilitates this greatly. The end result is that its more work to meaningfullly interface with Maxima than with yacas yet yacas satisfies the majority of needs of a CAS. There is the minority who need more powerful algorithms but I think it was a reasonable step to handle the 80% that can be accommodated most easily first by using yacas. The remaining 20%, which is what the other respondents to this thread are discussing will in part be addressed in the future possibly, in part, by the second project I am working on now. Perhaps some would quibble with the 80/20 and if you are in the 20 it probably seems like 100 but we will never settle that question definitively.
In a different perspective the sage project might also be an option, it seems to interface to Maxima and R among other things. I haven't tested it myself though. http://www.sagemath.org/index.html Best wishes, baptiste PS: sagemath.org is a well-thought website, perhaps a good inspiration for the new design discussed recently?
On 11 Feb 2009, at 07:56, Hans W. Borchers wrote:
Gabor Grothendieck <ggrothendieck <at> gmail.com> writes:
I am not sure what the point of all this is.
The point of all this is: 1. Some users of R here on the list apparently would like to have more powerful CAS functionalities than Yacas can provide. 2. Many of the solution hints to Ryacas on this list were simply not solving the resp. problem, so the 80/20 statement of yours may be downright wrong. 3. Maxima does incorporate a socket server and can be integrated into other systems, see EULER (do you never listen?). What are you mourning about? Of course, it was great that you made available Yacas for R. But others have the right to discuss their wishes here w/o being 'slammed' every time with questionable hints to Ryacas. I agree arguments have been exchanged and we should stop here. After this discussion, I wish someone would think about an Rmaxima package (along the lines of EULER, e.g.), I cant do it, unfortunately. Hans Werner Borchers
This is an R list, not a CAS list. The recommendation to use yacas is based on the fact that there is an interface between R and yacas. There is no interface between R and Maxima so Maxima is not in the running. Anyone who has used Maxima knows that is an impressive piece of software but that's not the point. Regarding, why there is no interface to Maxima, its because its harder to interface to Maxima than yacas. There are two problems here: 1. Maxima does not incorporate a socket server as far as I know. You would have to write it and that may or may not need an in depth understanding of Maxima to do so but in any case represents work. With yacas you don't have to write a server since yacas itself already contains a server. Just run: yacas --server .,. and the server side is done. (In the case of yacas it would also be possible to use its C interface for an in-process interface or presumably the java interface of the new java version of yacas. With Maxima it would be more problematic since its written in Lisp.) 2. Once you have created some sort of communications channel then what? If you want more than a crude interface that passes an unprocessed character string to the CAS and then passes one back then you will want to translate between R and the CAS. With yacas, OpenMath facilitates this greatly. The end result is that its more work to meaningfullly interface with Maxima than with yacas yet yacas satisfies the majority of needs of a CAS. There is the minority who need more powerful algorithms but I think it was a reasonable step to handle the 80% that can be accommodated most easily first by using yacas. The remaining 20%, which is what the other respondents to this thread are discussing will in part be addressed in the future possibly, in part, by the second project I am working on now. Perhaps some would quibble with the 80/20 and if you are in the 20 it probably seems like 100 but we will never settle that question definitively.
______________________________________________ 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.
_____________________________ Baptiste Augui? School of Physics University of Exeter Stocker Road, Exeter, Devon, EX4 4QL, UK Phone: +44 1392 264187 http://newton.ex.ac.uk/research/emag