@tbfl1919 Hmmm... this unfortunately requires more invasive changes. The piecewise command is not well-supported by any of the units subpackages; this post made me realize this and I'll try to make some improvements here, as well, for the next version of Maple. This case is particularly tricky, because there is interaction with the int command, as well: for the condition to evaluate, it needs the units from the range of the integral.
I think the only solution here might, for now, be to extend the "cheating" approach I proposed in my previous post. So that means, we replace the integral int(f(t), t = T__1 .. T__2) by int(f(t*Unit(ms)), t = T__1/Unit(ms) .. T__2/Unit(ms)) * Unit(ms), where f(t) = V__tot(t)2.
Similarly, for plotting, we need to do some surgery to the plot command, to something like the following: plot('combine(V__tot(t*Unit(ms))/Unit(V), units)', t=0..5)
As for converting the output unit to volts: I would suggest any of the following.
- Right click the end result; click Units / simplify.
- Right click the end result; click Units / convert / system / SI.
- Type combine(V__tot_rms, 'units')
- Type convert(V__tot_rms, 'units', 'V')
Let me know if any of these do not work for you.