问题描述
我正在尝试在Java程序中计算扭矩,但是在如何将公式转换为代码方面遇到一些问题
这是我的代码:
torque = CYLINDER_LOAD_FACTOR * ( ( Math.pow( (displacement / numberOfCylinders),2) * Math.exp(TORQUE_CONSTANT) * 0.59 ) );
解决方法
整个表达式应提高到0.59的幂,
( Math.pow( (displacement / numberOfCylinders),2) * Math.exp(TORQUE_CONSTANT) )
但是您要乘以那个数量。请尝试以下操作:
torque = CYLINDER_LOAD_FACTOR * Math.pow( Math.pow( (displacement / numberOfCylinders),2) * Math.exp(TORQUE_CONSTANT),0.59 );