Question: Plotting Piecewise Function with Units

I'm trying to plot a piecewise function whose return value has units, but I get an error saying that it found a "name" (i.e., the unit symbol).


> f := t -> 2*t;

> fp := piecewise(f(tt) <= 4, 1*Unit(W), f(tt) > 4 and f(tt) <= 8, 2*Unit(W), f(tt) > 8, 3*Unit(W));

> plot(fp, tt = 0..10);


I've tried using the option useunits, but no success. Any help will be appreciated.

Please Wait...