Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "iostream"
- #include <iomanip>
- void BM() {
- float I1 = 0.1024f, I2 = 1.9511f, I3 = 0.8245f, I4 = 0.8245f;
- float I5 = 4.2290f, I6 = 3.7710f, I7 = 1.1266f, I8 = 2.9465f;
- float R1 = 730.f, R2 = 260.f, R3 = 590.f, R4 = 260.f;
- float R5 = 860.f, R6 = 770.f, R7 = 770.f, R8 = 410.f;
- float J1 = 5.f, J2 = 8.f;
- float E1 = 900.f, E2 = 400.f;
- float U35 = (I5 * R5);
- float U21 = (I1 * R1) + E2;
- float left = (-1) * (E2 * I1) + (E1 * I7) + (J2 * U35) + (J1 * U21);
- float right = (I1 * I1 * R1) + (I2 * I2 * R2) + (I3 * I3 * R3) + (I4 * I4 * R4) + (I5 * I5 * R5) + (I6 * I6 * R6) + (I7 * I7 * R7) + (I8 * I8 * R8);
- std::cout << "\n\n\n";
- std::cout << I1 * I1 << "* " << R1 << "+ ";
- std::cout << I2 * I2 << "* " << R2 << "+ ";
- std::cout << I3 * I3 << "* " << R3 << "+ ";
- std::cout << I4 * I4 << "* " << R4 << "+ ";
- std::cout << I5 * I5 << "* " << R5 << "+ ";
- std::cout << I6 * I6 << "* " << R6 << "+ ";
- std::cout << I7 * I7 << "* " << R7 << "+ ";
- std::cout << I8 * I8 << "* " << R8 << "= ";
- std::cout << "-" << (E2 * I1) << " + " << E1 * I7 << " + " << J2 * U35 << " + " << J1 * U21 << "\n\n\n";
- //
- std::cout << (I1 * I1 * R1) << " + " << (I2 * I2 * R2) << " + " << (I3 * I3 * R3) << " + " << (I4 * I4 * R4) << " + ";
- std::cout << (I5 * I5 * R5) << " + " << (I6 * I6 * R6) << " + " << (I7 * I7 * R7) << " + " << (I8 * I8 * R8) << " = ";
- std::cout << left << "\n\n";
- //
- std::cout <<std::setprecision(10) << left << ", " << right << std::endl;
- }
- void MUP() {
- float R1 = 730.f, R2 = 260.f, R3 = 590.f, R4 = 260.f;
- float R5 = 860.f, R6 = 770.f, R7 = 770.f, R8 = 410.f;
- float J1 = 5.f, J2 = 8.f;
- float E1 = 900.f, E2 = 400.f;
- float g22 = 1 / R1 + 1 / R6 + 1 / R7;
- float g33 = 1 / (R3+R4) + 1 / (R5 + R6) + 1 / R8;
- float g44 = 1 / R2 + 1 / (R3 + R4) + 1 / R7;
- float g23 = 1 / (R5 + R6);
- float g24 = 1 / R7;
- float g34 = 1 / (R3 + R4);
- float Iy2 = -E1 / R7 + E2 / R1 + J1;
- float Iy3 = J2;
- float Iy4 = E1 / R7;
- float g32 = g23, g42 = g24, g43 = g34;
- std::cout << "\n\n\n";
- std::cout << g22 << " " << g23 << " " << g24 << " " << Iy2 << std::endl;
- std::cout << g32 << " " << g33 << " " << g34 << " " << Iy3 << std::endl;
- std::cout << g42 << " " << g43 << " " << g44 << " " << Iy4 << std::endl;
- std::cout << "\n\n\n";
- }
- int main() {
- MUP();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement