piecewise functions from logical relationships (ie. solving with constraints)

*To*: mathgroup at smc.vnet.net*Subject*: [mg81239] piecewise functions from logical relationships (ie. solving with constraints)*From*: "Ben Lewis" <benjamin.r.lewis at gmail.com>*Date*: Mon, 17 Sep 2007 03:34:33 -0400 (EDT)

G'day all, Say I have an equation that defines some arbitrary relationship between two variables x and y (or N equations and 2N variables), and furthermore that I know a specific region for which the relationship is one-to-one and onto. In other words, some function f (such that y=f[x]) and it's inverse g (x=g[y]) are mathematically well-defined in that region by my equation. Is there then any way to obtain both functions using Mathematica? I want the specific functions (f and g) so that, for particular points in the region, I can change (coordinate) variables in either direction, and also to compute various derivatives of these functions (particularly the Jacobian matrix). For example: eq := y+1/2==Mod[x+0.1,1] constr := -1/2<y<1/2 && 0<x<1 && y!=-0.4 && x!=0.9 Reduce produced output in a different form: (x==2/5+y && -2/5<y<1/2) || (x==7/5+y && -1/2<y<-2/5) Something in a form like "g->Mod[#+2/5,1]&" would be ideal, or similarly: "x->Piecewise[{{2/5+y,-2/5<y<1/2},{7/5+y,-1/2<y<-2/5}}]". -Ben