MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


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



  • Prev by Date: Single-step evaluation in Mathematica
  • Next by Date: raster and aspectratio
  • Previous by thread: Re: Single-step evaluation in Mathematica
  • Next by thread: Re: piecewise functions from logical relationships (ie. solving with constraints)