Re: [R] Solve equations

2007-08-06 Thread Moshe Olshansky
Hi Sebastian, Your equations can be easily solved - no programming is required! Let's number you equations: (1) 0.007= 2VZ (2) 0.03= W(Y+Z) (3) 0.034= X(y+Z) (4) 0.013 = (X+W)Y +(X-W)Z (5) X = W+V Substitute (5) into (3) and then divide (2) by (3) to get (W+V)/W = 0.034/0.03 so that (6) V = (

Re: [R] Solve equations

2007-08-06 Thread Gabor Grothendieck
Try brute force: > f <- function(x) { + V <- x[1]; W <- x[2]; X <- x[3]; Y <- x[4]; Z <- x[5] + if (!(V < W && W < X && Y < Z)) return(Inf) + ((0.007 - 2*V*Z)^2 + + (0.03 - W*(Y+Z))^2 + + (0.034 - X*(Y+Z))^2 + + (X - W+V)^2 + + (0.013 - (X+W)*Y +(X-W)*Z))^2 + } > s <- 1:10/10 > g <- expand.grid(V

[R] Solve equations

2007-08-06 Thread sebastien puechmaille
Hello, I have a system of five equations to solve with five 'unknows'(V, W, X, Y and Z) and constraints. The equations are: 0.007= 2VZ 0.03= W(Y+Z) 0.034= X(y+Z) 0.013 = (X+W)Y +(X-W)Z X = W+V Constraints: 0https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.

Re: [R] solve equations

2006-03-30 Thread Henrik Andersson
It is probably very well explained in a basic math book which you either own or can borrow at many libraries. The method is called substitution and you most probably dont get much help or insight from R. If it is a linear equation system with more unknowns use the function 'solve' which you wo

[R] solve equations

2006-03-30 Thread wafa
Hi everyone, I need your help to use R to solve two equations with two unknown variables= __ R-help@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