Joshi, Yogesh
2004-Sep-17 02:54 UTC
[R] help with numerical solution for two simultaneous nonlinear equations in 2 variables
Hi, I am relatively new to R and am trying to solve two simultaneous nonlinear equations in two variables numerically, and was wondering if anyone knew if any of the packages could do that. An alternative is writing my own code using Newton-Raphson; I did that but was not able to get good convergence. Any ideas please? Thanks Yogesh [[alternative HTML version deleted]]
Charles Annis, P.E.
2004-Sep-17 03:07 UTC
[R] help with numerical solution for two simultaneous nonlinearequations in 2 variables
?optim will be helpful. Charles Annis, P.E. Charles.Annis at StatisticalEngineering.com phone: 561-352-9699 eFax: 503-217-5849 http://www.StatisticalEngineering.com -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Joshi, Yogesh Sent: Thursday, September 16, 2004 10:54 PM To: r-help at stat.math.ethz.ch Subject: [R] help with numerical solution for two simultaneous nonlinearequations in 2 variables Hi, I am relatively new to R and am trying to solve two simultaneous nonlinear equations in two variables numerically, and was wondering if anyone knew if any of the packages could do that. An alternative is writing my own code using Newton-Raphson; I did that but was not able to get good convergence. Any ideas please? Thanks Yogesh [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Ravi Varadhan
2004-Sep-17 12:17 UTC
[R] help with numerical solution for two simultaneous nonlinearequations in 2 variables
Hi, Suppose you have p equations in p unknowns: F1(x1,x2,...,xp) =0 . . . Fp(x1,x2,...,xp) = 0 You can solve the equivalent minimization problem: G(x1,x2,...,xp) = F1^2 + ... + Fp^2 = 0 So, you can use "optim" with G as your objective function. Hope this is helpful, Ravi. -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Joshi, Yogesh Sent: Thursday, September 16, 2004 10:54 PM To: r-help at stat.math.ethz.ch Subject: [R] help with numerical solution for two simultaneous nonlinearequations in 2 variables Hi, I am relatively new to R and am trying to solve two simultaneous nonlinear equations in two variables numerically, and was wondering if anyone knew if any of the packages could do that. An alternative is writing my own code using Newton-Raphson; I did that but was not able to get good convergence. Any ideas please? Thanks Yogesh [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html