C++で二次電流の一次変換値を求める。二次電流の一次変換値は
\begin{align}
I=\dfrac{\dfrac{V_1}{\sqrt{3}}}{\sqrt{\left ( r_1+\dfrac{r_2}{s} \right )^2 + \left ( x_1+x_2 \right )^2}}
\end{align}
で求まる。
実行結果
r1->0.1
r2->0.15
x1->0.3
x2->0.4
s->0.05
V->200
I->36.3336
ソースコード。
#include <iostream>
#define pi 3.14
class IM{
public:
std::string name = "";
double r1 = 0.0;
double r2 = 0.0;
double x1 = 0.0;
double x2 = 0.0;
double s = 0.0;
double V = 0.0;
double I = 0.0;
void show(void) {
std::cout << "r1->" << r1 << std::endl;
std::cout << "r2->" << r2 << std::endl;
std::cout << "x1->" << x1 << std::endl;
std::cout << "x2->" << x2 << std::endl;
std::cout << "s->" << s << std::endl;
std::cout << "V->" << V << std::endl;
std::cout << "I->" << I << std::endl;
}
};
double torque(double P, int N) {
return P / (2 * pi * N / 60);
}
double current(IM motor) {
double Z, R, X;
R = motor.r1 + motor.r2 / motor.s;
X = motor.x1 + motor.x2;
Z = sqrt(std::pow(R, 2) + std::pow(X, 2));
return motor.V / (sqrt(3) * Z);
}
int main() {
double P0;
IM motor1;
motor1.r1 = 0.1;
motor1.r2 = 0.15;
motor1.x1 = 0.3;
motor1.x2 = 0.4;
motor1.s = 0.05;
motor1.V = 200;
motor1.I = current(motor1);
motor1.show();
return 0;
}
コメント