Skip to content

can R solve these paired equations

3 messages · Xin Shi, Charilaos Skiadas, robin hankin

#
Turn your problem into an optimization one and use the various  
optimization abilities of R, for instance have a look at nlm:

?nlm

As an example to solve the rather simple:
x-y=0
x+y=2

We could do:

f <- function(vals) {
	x <- vals[1]
	y <- vals[2]
	sum(c(x-y,x+y-2)^2)
}
nlm(f, c(2,2))

PS: A google search for "rhelp solving nonlinear system of equations"  
would likely have given you some starting points.
PS2: Perhaps someone more expert could comment on the differences  
between optim, nlm and nlminb.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College
On Dec 17, 2007, at 12:43 AM, Xin wrote:

            
#
Hello

[An answer was posted just now using numerical ideas;
here is an answer from a symbolic perspective]

These equations involve x^y in more than one unknown,
so inverse functions cannot be used.

I do not think you will be able to characterize even the number
of solutions, let alone their nature.

To see the difficulty, look at the Lambert W function.

My advice would be to simplify, simplify, simplify
your problem as far as possible; remove terms
successively until you are left with a trivial
system, then add *one* term and see if
this produces any insights.

HTH

rksh
On 17 Dec 2007, at 05:43, Xin wrote:

            
--
Robin Hankin
Uncertainty Analyst and Neutral Theorist,
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743