I'm having trouble defining piecewise functions. What I have so far is a function that outputs something in a suitable format for Piecewise:
envpart = getpsipieces[LUs[[1]], LUs[[2]], eenv, ms, hbar]
{{(0.707118 + 0. I) E^((-0.138441 + 0. I) x) + (0.707082 + 0.00436397 I) E^((0.138441 + 0. I) x), 0 < x < 0.47619}, {(0.708113 + 0.0127916 I) E^((0. - 0.617118 I) (-0.47619 + x)) + (0.709159 - 0.00813024 I) E^((0. + 0.617118 I) (-0.47619 + x)), 0.47619 < x < 0.524036}, {(0.755281 + 0.00032215 I) E^((-0.138441 + 0. I) (-0.524036 + x)) + (0.661991 + 0.00436804 I) E^((0.138441 + 0. I) (-0.524036 + x)), 0.524036 < x < 1.}}
What I want to be able to do is make a function that looks like
f[x_]:=Piecewise[envpart]
for simple plotting, integrating, etc.
When I try this, f[x0] returns Piecewise[envpart], f[x_]=Piecewise[envpart] works, but it locks up Piecewise and I want three of these types of functions working at once.
f[x_]=Piecewise[(writing out actual argument)] works perfectly, but one of the functions I want to build has hundreds of cases, so this isn't feasible.