Repository navigation
Expand file tree
/
Copy pathtorquecal.cpp
More file actions
118 lines (88 loc) · 5.47 KB
/
Copy pathtorquecal.cpp
File metadata and controls
118 lines (88 loc) · 5.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#include "torquecal.h"
#pragma once
void torquecal::force(){
std::cout << " \n";
std::cout << " first gear with final " << torque * firstgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) << " pound force \n";
std::cout << " second gear with final " << secondgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque << " pound force \n";
std::cout << " third gear with final " << thirdgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque << " pound force \n";
std::cout << " fourth gear with final " << fourthgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque << " pound force \n";
std::cout << " fifth gear with final " << fifthgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque << " pound force \n";
std::cout << " sixth gear with final " << sixthgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque << " pound force \n";
std::cout << "\n";
}
torquecal::torquecal() {
std::cout << " This program is for calculating ";
std::cout << " Please enter first gear ";
std::cin >> firstgear;
std::cout << std::endl << " Please enter second gear ";
std::cin >> secondgear;
std::cout << std::endl << " Please enter third gear ";
std::cin >> thirdgear;
std::cout << std::endl << " Please enter fourth gear ";
std::cin >> fourthgear;
std::cout << std::endl << " Please enter fifth gear ";
std::cin >> fifthgear;
std::cout << std::endl << " Please enter sixth gear ";
std::cin >> sixthgear;
std::cout << std::endl << "Please enter final gear";
std::cin >> finaldrive;
std::cout << std::endl << " Please enter torque ";
std::cin >> torque;
std::cout << std::endl << " Please enter rimdiameter ";
std::cin >> rimdiameter;
std::cout << std::endl << " Please enter aspect ratio ";
std::cin >> aspectratio;
std::cout << std::endl << " Please enter tire width ";
std::cin >> tirewidth;
std::cout << std::endl << " enter the weight of your vehicle in ibs";
std::cin >> weight;
}
void torquecal::change()
{ // how do i take a input and check to see if
std::cout << " Please enter first gear \n";
std::cin >> firstgear;
std::cout << std::endl << " Please enter second gear ";
std::cin >> secondgear;
std::cout << std::endl << " Please enter third gear ";
std::cin >> thirdgear;
std::cout << std::endl << " Please enter fourth gear ";
std::cin >> fourthgear;
std::cout << std::endl << " Please enter fifth gear ";
std::cin >> fifthgear;
std::cout << std::endl << " Please enter sixth gear ";
std::cin >> sixthgear;
std::cout << std::endl << "Please enter final gear";
std::cin >> finaldrive;
std::cout << std::endl << " Please enter torque ";
std::cin >> torque;
std::cout << std::endl << " Please enter rimdiameter ";
std::cin >> rimdiameter;
std::cout << std::endl << " Please enter aspect ratio ";
std::cin >> aspectratio;
std::cout << std::endl << " Please enter tire width ";
std::cin >> tirewidth;
std::cout << std::endl << " enter the weight of your vehicle in ibs";
std::cin >> weight;
}
void torquecal::real()
{
std::cout << " \n this is under the assumption that the drivetrain loses and engine friction make the engine .85 efficient \n " ;
std::cout << " first gear with final " << torque * firstgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * .85 << " pound force \n";
std::cout << " second gear with final " << secondgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque *.85 << " pound force \n";
std::cout << " third gear with final " << thirdgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque *.85 << " pound force \n";
std::cout << " fourth gear with final " << fourthgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque *.85 << " pound force \n";
std::cout << " fifth gear with final " << fifthgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque * .85 << " pound force \n";
std::cout << " sixth gear with final " << sixthgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque *.85 << " pound force \n";
std::cout << "\n";
}
void torquecal::acceleration()
{
std::cout << " \n";
std::cout << " first gear with final " << torque * firstgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) / weight<< " g force \n ";
std::cout << " second gear with final " << secondgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque / weight << " g force \n ";
std::cout << " third gear with final " << thirdgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque / weight << " g force \n ";
std::cout << " fourth gear with final " << fourthgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque / weight<< " g force \n ";
std::cout << " fifth gear with final " << fifthgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque / weight<< " g force \n ";
std::cout << " sixth gear with final " << sixthgear * finaldrive / (rimdiameter / 2 / 12 + (aspectratio * tirewidth / 25.4 / 12)) * torque / weight << " g force \n ";
std::cout << "\n";
}