Closed cmichelenstrofer closed 1 year ago
@ryancoe changes look good! Why "(mostly)" non-linear?
An approach for the suggested polynomial fitting is described in Mahmoudi2017. Assume you have a motor efficiency $\eta^{mtr} (\tau, \dot{\theta})$, thus
P_m^{mtr} = P_e^{mtr} \cdot \eta^{mtr} (\tau, \dot{\theta}).
With the current implementation $P_e = Pm + P{loss}$, we can convert the motor efficiency into an equivalent loss map
P_{loss}^{mtr} = P_e^{mtr} - P_m^{mtr} = \frac{1}{\eta^{mtr}}P_m^{mtr} - P_m^{mtr} = P_m^{mtr} \left( \frac{1-\eta^{mtr}}{\eta^{mtr}} \right)
Now, Mahmoudi2017 suggest fitting the motor losses with physics based polynomial of $\tau$ and $\dot{\theta}$. The parametric function $P_{loss}^{mtr,fit}(\tau, \dot{\theta})$ is very likely non-zero at the axes, thus extrapolates copper losses (such as $I^2R$) towards the axes, when $P_m \rightarrow 0^+$.
If we now assume symmetric power loss for generating and motor operation we can approximate the loss map over all quadrants
P_{loss} = P_{loss}^{mtr,fit}(|\tau|, |\dot{\theta}|).
Moving discussion from #173 here.
The description of the electric power as
where $\eta$ is the efficiency, which is dependent on motor torque, $\tau$, and shaft speed, $\dot{\theta}$, cannot correctly account for cases in the (torque-velocity) axes (i.e., where $\tau=0$ and/or $\dot{\theta}=0$). The loss factor is $\beta$.
Instead we should use
where $P_{loss}$ is a user-supplied function of torque and shaft (rotational) velocity. Note that
For simple (low velocity) cases a $I^2R$ loss model should work:
where $\tau$, $k_\tau$, and $R_w$ are the input torque, the motor's torque constant, and the motor's winding resistance, respectively. Note that torque is (mostly) linearly proportional to current.
For more complex cases, multiple mechanisms contribute to the electric power loss. On possible approach is determining this function for your motor and fitting a parametric function to it, such as a polynomial. This would allow for it to be differentiable and usable in WecOptTool.
Another approach that might be viable is a piecewise function (apparently
autograd
supports this: https://github.com/HIPS/autograd/issues/36)