Last issue for today: I think that there is a flaw in the computation of power performance in ‘userDefinedFunction.m’.
This is the current code:
force = output.ptos.forceActuation(ii:end,3);
vel = output.ptos.velocity(ii:end,3);
power = force.*vel;
eff = 0.7;
for i = 1:length(power)
if power(i)>= 0
power_eff(i) = power(i)*eff;
else
power_eff(i) = power(i)/eff;
end
end
When a positive damping is applied (cc = 10, for instance), the resulting instantaneous power (power = force.*vel) is negative. The convention seems to be that a negative instantaneous power corresponds to power production. Changing the sign of the damping leads to simulation errors, so my guess should be correct.
However, if power being produced has a negative sign, the code above should be modified as follows:
for i = 1:length(power)
if power(i)<0
power_eff(i) = power(i)*eff;
else
power_eff(i) = power(i)/eff;
end
end
Otherwise, produced electric power will be greater than mechanical power. Of course, one could change the power sign convention instead (power = –force.*vel;).
Best regards,
Paolino Tona
IFPEN Team