Solve'ing piecewise defined functions
- To: mathgroup at yoda.physics.unc.edu
- Subject: Solve'ing piecewise defined functions
- From: xinwei at otter.stanford.edu (Sha Xin Wei)
- Date: Mon, 18 Apr 94 19:00:59 -0700
What's the state of the M-- art using
Solve[{f1[x]==0, ... , fn[x]==0}, x]
where fi[] are piecewise linear functions?
Simple-minded usage doesn't work:
gg[x_] := x + 2 /; x < 0;
gg[x_] := x -5 /; x >= 0;
Solve[gg[t]==0,t]
(-1)
{{t -> gg [0]}}
nor does resorting to numerics,
f = Interpolation[{{-1,1}, {0-$MachineEpsilon,2}, {0, -5},
{1,-4}}, InterpolationOrder->1]
Solve[ f[x] == 0, x]
(-1)
{{x -> InterpolatingFunction[{-1, 1}, <>] [0]}}
Xin Wei
Stanford