Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. #include <iostream>
  2. #include<cmath>
  3.  
  4. double incriment(double l, double e, double i, double y4, double y3, double y2, double y1, double y0) {
  5. double yStar;
  6. double x = pow((l / 554), 4);
  7. yStar = ((2 * 16 * (x)) / (e * i)) + 3 * y4 + 2 * y3 - 2 * y2 + 3 * y1 + y0;
  8. return yStar;
  9. }
  10.  
  11. int main()
  12. {
  13. double e, q, l, y0, y1, y2, y3, y4, y5;
  14.  
  15. e = 5; q = 10; l = 213; y0 = 0; y1 = 1; y2 = 2; y3 = 3; y4 = 4;
  16. std::cout <<"Y 0"<<" = "<< y0 << "\n";
  17. std::cout <<"Y 1"<<" = "<< y1 << "\n";
  18. std::cout <<"Y 2"<<" = "<< y2 << "\n";
  19. std::cout <<"Y 3"<<" = "<< y3 << "\n";
  20. std::cout <<"Y 4"<<" = "<< y4 << "\n";
  21. //y5 = incriment(l, e, 1, y4, y3, y2, y1, y0);
  22. for (int i = 1; i < 552; i++) {
  23.  
  24. y5 = incriment(l, e, i, y4, y3, y2, y1, y0);
  25. std::cout <<"Y "<<i+4<<" = "<< y5 << "\n";
  26. y0=y1;
  27. y1=y2;
  28. y2=y3;
  29. y4=y5;
  30. }
  31.  
  32. }
  33.  
  34.  
  35.  
  36. // Run program: Ctrl + F5 or Debug > Start Without Debugging menu
  37. // Debug program: F5 or Debug > Start Debugging menu
  38.  
  39. // Tips for Getting Started:
  40. // 1. Use the Solution Explorer window to add/manage files
  41. // 2. Use the Team Explorer window to connect to source control
  42. // 3. Use the Output window to see build output and other messages
  43. // 4. Use the Error List window to view errors
  44. // 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
  45. // 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement