SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "iostream"
  2. #include <iomanip>
  3.  
  4. void BM() {
  5.     float I1 = 0.1024f, I2 = 1.9511f, I3 = 0.8245f, I4 = 0.8245f;
  6.     float I5 = 4.2290f, I6 = 3.7710f, I7 = 1.1266f, I8 = 2.9465f;
  7.     float R1 = 730.f, R2 = 260.f, R3 = 590.f, R4 = 260.f;
  8.     float R5 = 860.f, R6 = 770.f, R7 = 770.f, R8 = 410.f;
  9.     float J1 = 5.f, J2 = 8.f;
  10.     float E1 = 900.f, E2 = 400.f;
  11.     float U35 = (I5 * R5);
  12.     float U21 = (I1 * R1) + E2;
  13.     float left = (-1) * (E2 * I1) + (E1 * I7) + (J2 * U35) + (J1 * U21);
  14.     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);
  15.     std::cout << "\n\n\n";
  16.     std::cout << I1 * I1 << "* " << R1 << "+ ";
  17.     std::cout << I2 * I2 << "* " << R2 << "+ ";
  18.     std::cout << I3 * I3 << "* " << R3 << "+ ";
  19.     std::cout << I4 * I4 << "* " << R4 << "+ ";
  20.     std::cout << I5 * I5 << "* " << R5 << "+ ";
  21.     std::cout << I6 * I6 << "* " << R6 << "+ ";
  22.     std::cout << I7 * I7 << "* " << R7 << "+ ";
  23.     std::cout << I8 * I8 << "* " << R8 << "= ";
  24.     std::cout << "-" << (E2 * I1) << " + " << E1 * I7 << " + " << J2 * U35 << " + " << J1 * U21 << "\n\n\n";
  25.  
  26.     //
  27.     std::cout << (I1 * I1 * R1) << " + " << (I2 * I2 * R2) << " + " << (I3 * I3 * R3) << " + " << (I4 * I4 * R4) << " + ";
  28.     std::cout << (I5 * I5 * R5) << " + " << (I6 * I6 * R6) << " + " << (I7 * I7 * R7) << " + " << (I8 * I8 * R8) << " = ";
  29.     std::cout << left << "\n\n";
  30.     //
  31.     std::cout << std::setprecision(10) << left << ", " << right << std::endl;
  32. }
  33.  
  34. void MUP() {
  35.     float R1 = 730.f, R2 = 260.f, R3 = 590.f, R4 = 260.f;
  36.     float R5 = 860.f, R6 = 770.f, R7 = 770.f, R8 = 410.f;
  37.     float J1 = 5.f, J2 = 8.f;
  38.     float E1 = 900.f, E2 = 400.f;
  39.     float g11 = 1 / R1 + 1 / R2 + 1 / R8;
  40.     float g22 = 1 / R1 + 1 / R6 + 1 / R7;
  41.     float g33 = 1 / R4 + 1 / R5 + 1 / R8;
  42.     float g44 = 1 / R2 + 1 / R3 + 1 / R7;
  43.     float g55 = 1 / R5 + 1 / R6;
  44.     float g66 = 1 / R3 + 1 / R4;
  45.     float g12 = 1 / R1, g13 = 1 / R8, g14 = 1 / R2, g15 = 0, g16 = 0;
  46.     float g21 = 1 / R1, g23 = 0, g24 = 1 / R7, g25 = 1 / R6, g26 = 0;
  47.     float g31 = 1 / R8, g32 = 0, g34 = 0, g35 = 1 / R5, g36 = 1 / R4;
  48.     float g41 = 1 / R2, g42 = 1 / R7, g43 = 0, g45 = 0, g46 = 1 / R3;
  49.     float g51 = 0, g52 = 1 / R6, g53 = 1 / R5, g54 = 0, g56 = 0;
  50.     float g61 = 0, g62 = 0, g63 = 1 / R4, g64 = 1 / R3, g65 = 0;
  51.     float Iy1 = J1 + E2 / R1;
  52.     float Iy2 = -J1 - E2 / R1 + E1 / R7;
  53.     float Iy3=-J2;
  54.     float Iy4=-E1/R7;
  55.     float Iy5=J2;
  56.     float Iy6=0;
  57.     std::cout << "\n\n\n";
  58.     std::cout << g22 << "  " << g23 << "  " << g24 << "  " << g25 << "  " << g26 << "  " << Iy2 << std::endl;
  59.     std::cout << g32 << "  " << g33 << "  " << g34 << "  " << g35 << "  " << g36 << "  " << Iy3 << std::endl;
  60.     std::cout << g42 << "  " << g43 << "  " << g44 << "  " << g45 << "  " << g46 << "  " << Iy4 << std::endl;
  61.     std::cout << g52 << "  " << g53 << "  " << g54 << "  " << g55 << "  " << g56 << "  " << Iy5 << std::endl;
  62.     std::cout << g62 << "  " << g63 << "  " << g64 << "  " << g65 << "  " << g66 << "  " << Iy6 << std::endl;
  63.     std::cout << "\n\n\n";
  64. }
  65.  
  66. void MDU() {
  67.     float R1 = 730.f, R2 = 260.f, R3 = 590.f, R4 = 260.f;
  68.     float R5 = 860.f, R6 = 770.f, R7 = 770.f, R8 = 410.f;
  69.     float J1 = 5.f, J2 = 8.f;
  70.     float E1 = 900.f, E2 = 400.f;
  71.     float E3 = J2 * R5, E4 = J1 * R1;
  72.     float R9 = (R2 * R8) / (R2 + R8 + R3 + R4);
  73.     float R10 = (R2 * (R3 + R4)) / (R2 + R8 + R3 + R4);
  74.     float R11 = (R8 * (R3 + R4)) / (R2 + R8 + R3 + R4);
  75.     float g1 = 1 / (R7 + R10), g2 = 1 / (R1 + R9), g3 = 1 / (R5 + R6 + R11);
  76.     float f2 = (E1 * g1 - (E2 + E4) * g2 + E3 * g3) / (g1+g2+g3);
  77.     std::cout << "F2: " << f2 << std::endl;
  78.     float I1 = ((-f2 - E2 - E4) / (R1 + R9)) + J1;
  79.     std::cout << "I1: " << I1 << std::endl;
  80. }
  81.  
  82. int main() {
  83.     MDU();
  84.  
  85.     return 0;
  86. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top