Express your equations in vector form, e.g.
f <- function(xycd){
x <- xycd[1]
y <- xycd[2]
cc <- xycd[3] # don't use the name "c"
d <- xycd[4]
# Return difference between two sides of equation; solution will be
# when this is rep(0,4):
c(3059738 - 0.62653*x + cc
783717 - 0.53653*y + d
y - 0.320*x
0.256138456 - ((5.52868E-08*x*cc) + d - (2.04766E-07*d*x))/cc)
}
Then you could use e.g. solveNonlinear (in help(nlmin)).
Tim Hesterberg
>I was wondering if S-Plus could help me solve the equations in the example
>below. Normally I use the function solve to get results for a linear
>equation system but now I have to deal with nonlineair equations.
>
>3,059,738 = 0.62653*x + c
>783,717 = 0.53653*y + d
>y = 0.320*x
>0.256138456 = ((5.52868E-08*x*c) + d - (2.04766E-07*d*x))/c
>
>Anybody an idea? Is this possible in S-Plus?
>Normally the equation above should give a unique solution, can I check this
>in a way?
>
>Thx a lot for helping me out,
>Bert
|