Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cmath>
- double incriment(double l, double e, double i, double y4, double y3, double y2, double y1, double y0) {
- double yStar;
- double x = pow((l / 554), 4);
- yStar = ((2 * 16 * (x)) / (e * i)) + 3 * y4 + 2 * y3 - 2 * y2 + 3 * y1 + y0;
- return yStar;
- }
- int main()
- {
- double e, q, l, y0, y1, y2, y3, y4, y5;
- e = 5; q = 10; l = 213; y0 = 0; y1 = 1; y2 = 2; y3 = 3; y4 = 4;
- std::cout <<"Y 0"<<" = "<< y0 << "\n";
- std::cout <<"Y 1"<<" = "<< y1 << "\n";
- std::cout <<"Y 2"<<" = "<< y2 << "\n";
- std::cout <<"Y 3"<<" = "<< y3 << "\n";
- std::cout <<"Y 4"<<" = "<< y4 << "\n";
- //y5 = incriment(l, e, 1, y4, y3, y2, y1, y0);
- for (int i = 1; i < 552; i++) {
- y5 = incriment(l, e, i, y4, y3, y2, y1, y0);
- std::cout <<"Y "<<i+4<<" = "<< y5 << "\n";
- y0=y1;
- y1=y2;
- y2=y3;
- y4=y5;
- }
- }
- // Run program: Ctrl + F5 or Debug > Start Without Debugging menu
- // Debug program: F5 or Debug > Start Debugging menu
- // Tips for Getting Started:
- // 1. Use the Solution Explorer window to add/manage files
- // 2. Use the Team Explorer window to connect to source control
- // 3. Use the Output window to see build output and other messages
- // 4. Use the Error List window to view errors
- // 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
- // 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