# Last modified on Tue Jan 25 18:54:16 PST 1994 by heydon # This file is designed to test how the non-linear numeric solver performs # when the input system contains a subsystem that is linear is a subset of the # unknowns, but non-linear for the rest of the constraints. The question is # whether the solver will converge on the exact solution for the linearly # constrained variables immediately or not. # Here is the linear subsystem: # y = x + 2 # y = -1 * x # This system has the solution x = -1, y = 1. 2 2 1 x ~ 0 y y = PLUS(x, 2) y = TIMES(-1, x) # Now we add an additional constraint: # d^2 = (x - 3)^2 + (y - 4)^2 # We must introduce locals to express this constraint in normal form. 8 8 6 d ~ 10 x ~ 0 y dx dy dxx dyy dd y = PLUS(x, 2) dx = PLUS(x, -3) dy = PLUS(y, -4) dxx = TIMES(dx, dx) dyy = TIMES(dy, dy) dd = PLUS(dxx, dyy) dd = TIMES(d, d) y = TIMES(-1, x) 3 3 2 x ~ 0 y z z = TIMES(x, 2) y = PLUS(x, 2) y = TIMES(-1, x) 3 3 2 x ~ 0 y z y = PLUS(x, 2) z = TIMES(x, y) y = TIMES(-1, x) 3 3 1 x ~ 0 z ~ 2 y y = TIMES(z, z) y = PLUS(x, 2) y = TIMES(-1, x) 6 5 4 x ~ 1 a ~ 2 y b aa aaa y = PLUS(x, 2) aa = TIMES(a, a) aaa = TIMES(a, aa) b = PLUS(aaa, x) y = TIMES(-1, x)