Kai, I'm pretty sure the problem is specific to the unit package,
and it's not a general problem with batch.
Maybe you can try the ezunits package (another units package)
instead. With the script as shown in the PS of this message,
I get .3089480549171595 ` J as the final result. Does that seem right?
ezunits is still under development -- this example will work very
slightly differently in Maxima 5.17 (to be released soon).
HTH
Robert Dodier
PS.
load (ezunits);
g:9.81`m/s^2;
D:20`millimeter;
P_L:0.05`N;
my:0.02;
L:10`millimeter;
Wi:0.9;
J_S:0.00017712946`kg*m^2;
J_Z1:0.000011568173`kg*m^2;
J_Z2:0.00022234309`kg*m^2;
J_M:0.000094`kg*m^2;
Um:4000`minute^-1;
Z_1:20;
Z_2:40;
M_x:25`kg;
M_y:50`kg;
V:20`m/minute;
t:0.3`s;
F:50`N;
T_1(M):=(F+my*M*g)*L/(2*%pi*Wi)*(Z_1/Z_2);
J_D(M):=J_Z1+J_M+(Z_1/Z_2)^2*(J_Z2+J_S+M*(L/(2*%pi))^2);
T_2(t,M):=J_D(M)*(2*%pi*Um/(t));
foo : T_2(t,M_x);
bar : ev (foo, millimeter=mm, minute=min);
baz : expand (bar);
quux : baz `` J;
ev (quux, numer);