Computer Aided Design of Flywheel Using C' Program: A. Thirugnanam, Rohitkumar and Lenin Rakesh
Computer Aided Design of Flywheel Using C' Program: A. Thirugnanam, Rohitkumar and Lenin Rakesh
ISSN 1990-9233
© IDOSI Publications, 2014
DOI: 10.5829/idosi.mejsr.2014.20.05.11337
Abstract: Flywheel, a machineelement is used to store rotational energy. Itwill have a specificmoment of inertia
and resists changes in speed. The amount of energy stored in it, is proportional to the square of its rotational
speed. Energy is stored in a flywheel by applying torque to it, thereby increasing its rotational speed. Then it
releases stored energy by applying torque to a mechanical load, thereby decreasing its rotational speed.
INTRODUCTION
These three are known as library function which is When the value of s is calculated it needs to be
use as a backup for any program. displayed on the screen. Output to screen is achieved
#include<stdio.h> using readymade library function printf( ). The general
#include<conio.h> form of printf( ) function is,
#include<math.h> printf ( "<format string>", <list of variables> );
Following are some examples of usage of printf( )
Any program start with library functions which function:
define the type of operation, like mathematical operation printf("Enter the Power to be transmitted \n");
the types of data structures provided by c can be printf("\nEnter the Newton value \n");
classified as Fundamental data types, Derived data types printf("\n\n Nominal Torque transmitted is %f nm \n",s);
Fundamental data types include the data types at the What is ‘\n’ doing in this statement? It is called newline.
lowest level, i.e. those which are used for actual data Therefore, you get the output split over two lines. ‘\n’ is
representation in the memory. All other data types are one of the several Escape Sequences available in C.
based on the fundamental data types. printf( ) can not only print values of variables and also
print the result of an expression. An expression is nothing
The fundamental data types: but a valid combination of constants, variables and
char: stand for characters and strings operators.
int: for integers getch();give the information to the computer programming
float: for numbers with decimals such as amounts, has completed.
quotients and salary
main( ) is a collective name given to a set of statements. Program:
All statements that belong to main( ) are enclosed within #include<stdio.h>
a pair of braces { } as shown below. #include<conio.h>
main( ) #include<math.h>
{ int p, n;
statement 1; float s, m, z,r;
statement 2; int main()
statement 3; { voidtorquecal();
} voidmaxtorq();
void diameter();
Technically speaking,main( ) is a function. Every voidbendstress();
function has a pair of parentheses ( ) associated with it. void elliptical();
Any variable used in the program must be declared printf("Enter the Power to be transmitted \n");
before using it. scanf("%d", and p);
printf("\nEnter the Newton value \n");
For example, scanf("%d", and n);
int p, n; torquecal();
float s m,z,r; maxtorq();
Any C statement always ends with a; diameter();
For example, bendstress();
floats,m,z, r; elliptical();
In the statement, getch();
s=(p*60)/(2*3.14*n); }
r=(m*1000*v)/(n*s*1000); voidtorquecal()
{ s=(p*60)/(2*3.14*n);
‘*’and ‘/’ are the arithmetic operators. The printf("\n\n Nominal Torque transmitted is %f nm \n",s);
arithmetic operators available in C are +, -, * and /. C is }
very rich in operators. There are about 45 operators voidmaxtorq()
available in C. { m=2*s;
578
Middle-East J. Sci. Res., 20 (5): 577-579, 2014
579