Menu Close

Other questions outside the present syllabus: UPSC Mechanical Engineering Optional PYQ Solutions (1995–2007)

All 18 Mechanical Engineering Optional questions from 1995 to 2007 on topics that are no longer in the syllabus – computer programming (FORTRAN and C), computer basics, lubrication and journal bearings, and a control-systems problem – solved step by step, latest first.

Try them yourself first: the same questions, without solutions, are on our Other Questions Outside the Present Syllabus topic-wise PYQs page. These topics are not in the present syllabus – the last question on them was set in 2007 – so expect few or no new questions on them. We solve them for students who practise from old papers, and because lubrication and journal bearings overlap with Machine Design.

How we check these solutions

These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:

  • ✓ Checked by computer the numbers were worked out again independently in code (Python with NumPy/SymPy) and matched.
  • ✓ Program compiled and tested every program was compiled (gcc for C, gfortran for FORTRAN) and run on test data, and its output was matched against an independent calculation.
  • ✓ Derivation checked step by step for derivations and “show that” questions, every step was checked against the governing laws.
  • ✓ Answer checked step by step for descriptive questions, every point was checked against the standard theory.

Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.

Jump to a question (year · question number):

2007 · 5d 2006 · 8c 2005 · 8c 2004 · 8b 2002 · 5d 2001 · 5c 2001 · 5d 2000 · 3b 2000 · 5d 1999 · 1c 1998 · 1a 1998 · 1d 1997 · 5b 1996 · 1d 1996 · 7c 1995 · 4a 1995 · 5c 1995 · 8a

Cover of the UPSC Prelims Topic-wise PYQ book with detailed explanations

From the Optional Province team

Preparing for Prelims too?

Our UPSC Prelims Topic-wise PYQ Book covers every Prelims question with detailed explanations, so you can see exactly where UPSC asks from. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

(i) With a neat sketch briefly explain organization of digital computer. (ii) Write down the general structure of a logical IF statement in modern FORTRAN language. (iii) Differentiate between a function sub programme and sub-routine.

2007 · Paper I · Q5d · 20 marks

Solution

(i) Organisation of a digital computer

A digital computer has five functional units. They follow the stored-program (von Neumann) design: the program and its data both sit in the same memory.

Central processing unit (CPU)Control unit (CU)fetch – decode – executeArithmeticand logicunit (ALU)Registers(accumulator,program counter)Input unitkeyboard, mouseOutput unitmonitor, printerMain memory (RAM, ROM)stored program and dataSecondarystorage (disk)system buscontrolcontrol
Organisation of a digital computer. Solid arrows carry data and instructions; dashed arrows carry control signals from the control unit. The CPU and main memory are linked by the system bus (data, address and control lines).
  • Input unit (keyboard, mouse, scanner, disk). It converts data and instructions into binary form and passes them to memory.
  • Memory unit.
    • Primary memory (RAM, with ROM for start-up) holds the running program and its data. The CPU can reach it directly.
    • Secondary memory (hard disk, CD, tape) stores large amounts of data permanently.
  • Arithmetic and logic unit (ALU). It does the arithmetic (+, −, ×, ÷) and the comparisons and logical operations (AND, OR, NOT, greater/less). Intermediate results sit in registers such as the accumulator.
  • Control unit (CU). It fetches each instruction from memory, decodes it and sends timing and control signals to every other unit. The fetch–decode–execute cycle repeats, step by step, for each instruction. The program counter holds the address of the next instruction.
  • Output unit (monitor, printer, plotter). It turns the binary results back into a form people can read.

The ALU, the CU and the registers together form the central processing unit (CPU). The units are linked by three buses:

  • the data bus carries the data;
  • the address bus carries the memory address;
  • the control bus carries the read/write and timing signals.

(ii) Logical IF statement in FORTRAN

The logical IF runs one statement only when a logical expression is true:

      IF (logical expression) statement

Example: IF (X .GT. XMAX) XMAX = X. The statement must be a single executable statement. It may not be a DO, another IF, or an END.

For more than one statement, modern FORTRAN (77 and later) uses the block IF:

      IF (logical expression 1) THEN
         block 1
      ELSE IF (logical expression 2) THEN
         block 2
      ELSE
         block 3
      END IF

The relational operators are .LT. .LE. .EQ. .NE. .GT. .GE. (Fortran 90 also allows < <= == /= > >=). The logical operators are .AND. .OR. .NOT..

(iii) Function subprogram and subroutine

Function subprogram Subroutine
Heading REAL FUNCTION AREA(R) SUBROUTINE STATS(X, N, AV, SD)
Result Returns one value, through its own name Returns any number of values (or none), through its arguments
How it is used Called by using its name inside an expression: A = 2.0*AREA(R) Called by a separate CALL statement: CALL STATS(X, N, AV, SD)
Name Has a type (REAL, INTEGER …), and is assigned a value inside the body Has no type and carries no value
Arguments Usually one or more; a function with none is still called with brackets, F() May have none: CALL INIT
Typical use A formula: area, factorial, friction law A task: sorting, input/output, solving a system

Both end with RETURN and END, are compiled separately, and get their data through dummy arguments (or COMMON).

✓ Answer checked step by step We checked the computer-organisation points and the FORTRAN 77 rules for the logical IF, functions and subroutines against the language standard.

↑ Back to the question list

Write a “C” program to calculate the factorial of a positive integer quantity by incorporating user defined function for calculating factorial in main program.

2006 · Paper I · Q8c · 20 marks

Solution

The factorial is n!=1×2×3×⋯×nn! = 1\times 2\times 3\times\cdots\times n, with 0!=10! = 1. A user-defined function factorial() works out the product in a loop. main() reads nn, calls the function and prints the result.

#include <stdio.h>

/* user-defined function: returns n! for n >= 0 */
unsigned long long factorial(int n)
{
    unsigned long long f = 1;
    int i;
    for (i = 2; i <= n; i++)
        f = f * i;
    return f;
}

int main(void)
{
    int n;
    printf("Enter a positive integer: ");
    if (scanf("%d", &n) != 1 || n < 0) {
        printf("Please enter a whole number 0 or more.\n");
        return 1;
    }
    if (n > 20) {              /* 21! does not fit in 64 bits */
        printf("n must be 20 or less for this program.\n");
        return 1;
    }
    printf("%d! = %llu\n", n, factorial(n));
    return 0;
}

How it works.

  • factorial() receives n by value. It starts with f = 1 and multiplies by 2, 3, …, n. For n = 0 or 1 the loop does not run, so it correctly returns 1.
  • The result type is unsigned long long (64 bits). Factorials grow very fast: 20! ≈ 2.4 × 10¹⁸ is the largest that fits, so the program rejects n > 20.
  • A recursive version of the function also works: return (n <= 1) ? 1 : n * factorial(n - 1);. The loop is preferred because it uses no stack.

Sample run: input 5 → 5! = 120.

✓ Program compiled and tested We compiled the program with gcc and ran it for n = 0, 5 and 20 (0! = 1, 5! = 120, 20! = 2 432 902 008 176 640 000), and for the invalid inputs n = 21 and n = −3.

↑ Back to the question list

Write a flow chart to solve the quadratic equation ax2+bx+c=0. Write also the corresponding C program.

2005 · Paper I · Q8c · 20 marks

Solution

The roots of ax2+bx+c=0ax^2 + bx + c = 0 are

x=−b±D2a,D=b2−4ac.x = \frac{-b \pm \sqrt{D}}{2a},\qquad D = b^2 – 4ac .

The sign of the discriminant DD decides the kind of roots. The case a=0a = 0 must be caught first, because the formula would then divide by zero.

Flow chart

StartRead a, b, ca = 0 ?D = b² − 4acD > 0 ?D = 0 ?x = −b / 2aPrint x (equal roots)b = 0 ?Print “noequation”Print x = −c / bx₁, x₂ =(−b ± √D) / 2aPrint x₁, x₂re = −b / 2aim = √(−D) / 2aPrint re ± i imStopNoNoYesYesYesNoYesNo
Flow chart for ax² + bx + c = 0. The case a = 0 is caught first (no division by zero); then the sign of the discriminant D = b² − 4ac selects real distinct, real equal or complex roots. All branches meet before Stop.

C program

#include <stdio.h>
#include <math.h>

int main(void)
{
    double a, b, c, d, x1, x2, re, im;

    printf("Enter a, b, c: ");
    scanf("%lf %lf %lf", &a, &b, &c);

    if (a == 0.0) {                       /* not a quadratic */
        if (b == 0.0)
            printf("a = b = 0: no equation to solve.\n");
        else
            printf("Linear equation: x = %g\n", -c / b);
        return 0;
    }

    d = b * b - 4.0 * a * c;              /* discriminant */

    if (d > 0.0) {                        /* real and distinct */
        x1 = (-b + sqrt(d)) / (2.0 * a);
        x2 = (-b - sqrt(d)) / (2.0 * a);
        printf("Real, distinct roots: x1 = %g, x2 = %g\n", x1, x2);
    } else if (d == 0.0) {                /* real and equal */
        x1 = -b / (2.0 * a);
        printf("Real, equal roots: x1 = x2 = %g\n", x1);
    } else {                              /* complex conjugate */
        re = -b / (2.0 * a);
        im = sqrt(-d) / (2.0 * a);
        printf("Complex roots: x1 = %g + %gi, x2 = %g - %gi\n", re, im, re, im);
    }
    return 0;
}

Sample runs

Input a, b, c Output
1 −3 2 Real, distinct roots: x1 = 2, x2 = 1
1 2 1 Real, equal roots: x1 = x2 = −1
1 2 5 Complex roots: x1 = −1 + 2i, x2 = −1 − 2i
0 2 4 Linear equation: x = −2

Notes:

  • The program is linked with the maths library (gcc quad.c -lm) for sqrt().
  • Testing d == 0.0 exactly is fine for whole-number data. For measured data, a small tolerance such as fabs(d) < 1e-12 is safer.

✓ Program compiled and tested We compiled the program with gcc and ran it on all four cases: x² − 3x + 2 (roots 2, 1), x² + 2x + 1 (−1, −1), x² + 2x + 5 (−1 ± 2i) and 2x + 4 = 0 with a = 0 (x = −2). The flow chart follows the same branches.

↑ Back to the question list

Write a flow chart for choosing the largest of three distinct numbers X, Y and Z.

2004 · Paper I · Q8b · 30 marks

Solution

Since the numbers are distinct, two comparisons are always enough. First compare X with Y. Then compare the larger of the two with Z.

StartRead X, Y, ZX > Y ?Y > Z ?X > Z ?BIG = YBIG = ZBIG = ZBIG = XPrint BIGStopNoYesYesNoNoYes
Largest of three distinct numbers. Compare X with Y, then compare the larger of the two with Z: every path uses exactly two decisions.

Trace.

  • X = 3, Y = 9, Z = 4: X > Y is No, so we test Y > Z; that is Yes, so the largest is Y = 9.
  • X = 9, Y = 3, Z = 4: X > Y is Yes, so we test X > Z; that is Yes, so the largest is X = 9.

Every path passes through exactly two decision boxes.

The same logic in C:

#include <stdio.h>
int main(void)
{
    double x, y, z, big;
    printf("Enter X, Y, Z: ");
    scanf("%lf %lf %lf", &x, &y, &z);
    if (x > y) {
        if (x > z) big = x; else big = z;
    } else {
        if (y > z) big = y; else big = z;
    }
    printf("Largest = %g\n", big);
    return 0;
}

✓ Program compiled and tested We traced the flow chart for all six orderings of three distinct numbers, and ran the matching C program (for example 3, 9, 4 → 9 and −1, −5, −2 → −1).

↑ Back to the question list

(i) Bevery Company, a weighing machine manufacturer essentially manufactures a mechanical weighing machine and another deluxe version which is a digital weighing machine. The company gives 7% commission on sales of the ordinary mechanical type and 8% commission on sales of the deluxe digital version. However, all such commissions are available, provided there is a base level sale of at least Rs. 10,000 of ordinary variety and Rs. 15,000 of deluxe variety. To motivate the sales engineers, for a sales exceeding Rs. 20,000 and Rs. 25,000 for the ordinary and deluxe variety respectively, there is a 1% increase in the commission levels for both varieties. Draw a flow chart to enable writing a computer programme for the above. (ii) Write a computer programme for the above situation.

2002 · Paper I · Q5d · 20 marks

Solution

Reading the scheme. We read the conditions variety by variety:

Variety Sales below the base level Sales from the base level up to the upper level Sales above the upper level
Ordinary (mechanical) below Rs 10 000: no commission Rs 10 000 – 20 000: 7 % above Rs 20 000: 8 %
Deluxe (digital) below Rs 15 000: no commission Rs 15 000 – 25 000: 8 % above Rs 25 000: 9 %

The commission is paid on the whole sale of that variety, and the higher rate applies to the whole sale once it crosses the upper level.

The question can also be read jointly: no commission at all unless both base levels are met, and the extra 1 % only when both upper levels are crossed. For that reading, change the two tests in the flow chart to ORD ≥ 10000 AND DLX ≥ 15000 and ORD > 20000 AND DLX > 25000.

(i) Flow chart

StartRead NK = 1Read ORD, DLXORD ≥ 10000 ?ORD > 20000 ?CO = 0CO = 0.08 × ORDCO = 0.07 × ORDYesNoYesNoDLX ≥ 15000 ?DLX > 25000 ?CD = 0CD = 0.09 × DLXCD = 0.08 × DLXYesNoYesNoPrint K, CO, CD, CO + CDK = K + 1K ≤ N ?StopNoYes
Commission flow chart (per-variety reading). Each variety earns nothing below its base level, its basic rate (7 % ordinary, 8 % deluxe) from the base level up to the upper level, and 1 % more above the upper level (Rs 20 000 ordinary, Rs 25 000 deluxe). The loop repeats for N sales engineers.

(ii) Program (C)

The same rule applies to both varieties with different numbers, so it is written once, as a function, and called twice.

#include <stdio.h>

/* commission on one variety:
   sales below the base level -> no commission
   sales at or above base     -> basic rate
   sales above the upper level -> basic rate + 1 % */
double commission(double sales, double base, double upper, double rate)
{
    if (sales < base)
        return 0.0;
    if (sales > upper)
        rate = rate + 1.0;
    return sales * rate / 100.0;
}

int main(void)
{
    int n, k;
    double ord, dlx, c_ord, c_dlx;

    printf("Number of sales engineers: ");
    scanf("%d", &n);
    for (k = 1; k <= n; k++) {
        printf("Engineer %d - sales of ordinary and deluxe (Rs): ", k);
        scanf("%lf %lf", &ord, &dlx);
        c_ord = commission(ord, 10000.0, 20000.0, 7.0);
        c_dlx = commission(dlx, 15000.0, 25000.0, 8.0);
        printf("Engineer %d: ordinary Rs %.2f, deluxe Rs %.2f, total Rs %.2f\n",
               k, c_ord, c_dlx, c_ord + c_dlx);
    }
    return 0;
}

Test run

Ordinary sales (Rs) Deluxe sales (Rs) Commission on ordinary (Rs) Commission on deluxe (Rs) Total (Rs)
8 000 30 000 0 2 700 2 700
10 000 15 000 700 1 200 1 900
20 000 25 000 1 400 2 000 3 400
20 001 25 001 1 600.08 2 250.09 3 850.17
40 000 12 000 3 200 0 3 200

✓ Program compiled and tested We compiled the program with gcc and checked five sales cases by hand: below the base level, exactly at the base levels, at the upper levels, just above them, and one variety only. For example, deluxe sales of Rs 30 000 earn 9 % = Rs 2 700, and ordinary sales of Rs 8 000 earn nothing.

↑ Back to the question list

(i) List the primary hardware components of a personal computer. (ii) List some of the options for each of the above components. (iii) What do you understand from the following terms? (a) RAM (b) ROM (c) 5 GB (d) 860 MHz (e) 57.6 KBPS.

2001 · Paper I · Q5c · 20 marks

Solution

(i) Primary hardware components of a PC

  1. Processor (CPU) on the motherboard, with the chipset, the expansion slots and the BIOS ROM.
  2. Main memory (RAM).
  3. Storage devices: hard disk, floppy disk, CD-ROM/CD-writer.
  4. Input devices: keyboard, mouse.
  5. Output devices: monitor (with its display adapter) and printer.
  6. Communication device: modem or network card.
  7. Cabinet with its power supply (SMPS), plus a UPS.

(ii) Options for each

Component Options around 2001 Today
Processor Intel Pentium III / Pentium 4, Celeron; AMD Athlon, Duron; 500 MHz – 1.5 GHz multi-core Intel Core / AMD Ryzen, 3–5 GHz
RAM 64–512 MB SDRAM (PC-100/133), RDRAM, DDR 8–32 GB DDR4/DDR5
Hard disk 10–40 GB IDE (ATA) or SCSI 0.5–2 TB SSD or HDD
Removable storage 1.44 MB floppy, CD-ROM, CD-RW, Zip drive USB flash drive, DVD
Monitor 14–17 inch CRT, LCD 22–27 inch LCD/LED
Printer dot-matrix, inkjet, laser inkjet, laser
Input keyboard; ball or optical mouse; scanner; joystick keyboard, optical mouse, touchpad, webcam
Communication 33.6 / 56 kbps modem, 10/100 Mbps Ethernet card broadband router, Wi-Fi, gigabit Ethernet

(iii) Terms

(a) RAM (random access memory).

  • It is the computer’s main working memory. The CPU can read and write any location directly, in the same time whatever the address.
  • It is volatile: its contents are lost when the power goes off.
  • It holds the operating system, the running programs and their data.

(b) ROM (read-only memory).

  • It is non-volatile memory whose contents are written once, at manufacture (PROM, EPROM and EEPROM can be reprogrammed in special ways).
  • Normally it can only be read.
  • In a PC it holds the BIOS start-up program.

(c) 5 GB.

  • Five gigabytes, a storage capacity (typically a hard disk). 1 GB = 2³⁰ bytes ≈ 1.07 × 10⁹ bytes; disk makers use 10⁹ bytes.
  • So 5 GB ≈ 5 × 10⁹ bytes. One byte is 8 bits and stores one character.

(d) 860 MHz.

  • The processor’s clock speed: 860 million clock cycles per second.
  • One cycle lasts 1/(860 × 10⁶) s ≈ 1.16 ns.
  • A higher clock means more instructions per second for the same design.

(e) 57.6 KBPS.

  • A data-transfer rate of 57.6 kilobits per second, typical of a dial-up modem or a serial port.
  • It is about 57 600 bits per second, or roughly 7 200 characters (bytes) per second.
  • Note the capital B in “KBPS” here means bits, not bytes. The standard symbol is kbit/s.

✓ Answer checked step by step We checked the component list and the meaning of each term against standard computer-fundamentals texts. The options listed are typical of the 2001 PCs the question had in mind; modern equivalents are noted.

↑ Back to the question list

Write a FORTRAN programme to accept data of heights of up to 100 students of a college. The programme should be able to calculate the main variance, and standard deviation of heights and print (i) the number of students (ii) the serial number and heights of individual students (iii) the mean, variance and standard deviation of heights.

2001 · Paper I · Q5d · 20 marks

Solution

We take the “main variance” in the question to mean the mean and the variance. For NN heights hih_i:

h‾=1N∑i=1Nhi,σ2=1N∑i=1N(hi−h‾)2,σ=σ2.\bar h = \frac{1}{N}\sum_{i=1}^{N} h_i,\qquad \sigma^2 = \frac{1}{N}\sum_{i=1}^{N}\left(h_i-\bar h\right)^2,\qquad \sigma = \sqrt{\sigma^2}.

The program stores up to 100 heights in an array. It makes two passes over the data: the first finds the mean, the second the sum of squared deviations about that mean. Working about the mean is more accurate than the one-pass formula h2¯−h‾2\overline{h^2}-\bar h^2.

C     HEIGHTS OF UP TO 100 STUDENTS: MEAN, VARIANCE, STANDARD DEVIATION
      PROGRAM HEIGHT
      INTEGER N, I
      REAL H(100), SUM, SUMSQ, AMEAN, VAR, SD
      WRITE (*,*) 'NUMBER OF STUDENTS (1 TO 100)?'
      READ (*,*) N
      IF (N .LT. 1 .OR. N .GT. 100) THEN
         WRITE (*,*) 'N MUST BE BETWEEN 1 AND 100'
         STOP
      END IF
      WRITE (*,*) 'ENTER THE HEIGHTS (CM)'
      READ (*,*) (H(I), I = 1, N)
C     FIRST PASS: MEAN
      SUM = 0.0
      DO 10 I = 1, N
         SUM = SUM + H(I)
   10 CONTINUE
      AMEAN = SUM / N
C     SECOND PASS: VARIANCE ABOUT THE MEAN
      SUMSQ = 0.0
      DO 20 I = 1, N
         SUMSQ = SUMSQ + (H(I) - AMEAN)**2
   20 CONTINUE
      VAR = SUMSQ / N
      SD  = SQRT(VAR)
C     OUTPUT
      WRITE (*,100) N
      WRITE (*,110)
      DO 30 I = 1, N
         WRITE (*,120) I, H(I)
   30 CONTINUE
      WRITE (*,130) AMEAN, VAR, SD
  100 FORMAT (/' NUMBER OF STUDENTS = ', I4)
  110 FORMAT (/' SERIAL NO.    HEIGHT (CM)')
  120 FORMAT (I8, F15.2)
  130 FORMAT (/' MEAN = ', F8.2, '  VARIANCE = ', F9.3,
     &        '  STANDARD DEVIATION = ', F8.3)
      STOP
      END

Sample output (6 students):

 NUMBER OF STUDENTS =    6

 SERIAL NO.    HEIGHT (CM)
       1         160.00
       2         172.00
       3         165.00
       4         158.00
       5         181.00
       6         170.00

 MEAN =   167.67  VARIANCE =    60.222  STANDARD DEVIATION =    7.760

Notes:

  • If the sample (rather than the population) variance is wanted, divide by N-1 instead of N (here: 72.27 cm², σ = 8.50 cm).
  • The check on N keeps the program from writing past the end of the 100-element array.

✓ Program compiled and tested We compiled the program with gfortran and ran it on six heights (160, 172, 165, 158, 181, 170 cm). It gave mean 167.67 cm, variance 60.222 cm² and standard deviation 7.760 cm, the same values Python’s statistics module gives.

↑ Back to the question list

A 150 mm diameter shaft supporting a load of 10 kN has a speed of 1500 rpm. The shaft runs in a bearing whose length is 1.5 times the shaft diameter. If the diametral clearance of the bearing is 0.15 mm and the absolute viscosity of the oil at the operating temperature is 11 centipoises find the power wasted in friction.

2000 · Paper I · Q3b · 30 marks

Solution

Data

  • Diameter d=150d = 150 mm, so radius r=75r = 75 mm.
  • Length L=1.5d=225L = 1.5d = 225 mm.
  • Load W=10W = 10 kN; speed N=1500N = 1500 rpm.
  • Diametral clearance =0.15= 0.15 mm, so radial clearance c=0.075c = 0.075 mm.
  • Viscosity μ=11\mu = 11 cP =0.011= 0.011 Pa·s (1 cP = 10⁻³ Pa·s).

With no eccentricity given, we use Petroff’s equation: the journal is taken as concentric, and the oil film as a thin layer sheared at a uniform rate.

rωbearingoil film (clearance c)journal, d = 150 mmbearing (fixed)journal surface, moving at U = rωcτ = μU / c
Petroff model (clearance exaggerated). Left: the journal of radius r = 75 mm turns at ω inside a concentric bearing; the oil film has radial clearance c = 0.075 mm. Right: across the film the velocity falls linearly from U = rω at the journal to zero at the bearing, so the shear stress is τ = μU/c everywhere on the area πdL.

Surface speed

ω=2πN60=2π(1500)60=157.08rad/s,U=rω=0.075×157.08=11.78m/s.\omega = \frac{2\pi N}{60} = \frac{2\pi(1500)}{60} = 157.08\ \text{rad/s},\qquad U = r\omega = 0.075\times157.08 = 11.78\ \text{m/s}.

Shear stress in the film (velocity varies linearly across the gap cc):

τ=μUc=0.011×11.780.075×10−3=1728N/m2.\tau = \mu\frac{U}{c} = 0.011\times\frac{11.78}{0.075\times10^{-3}} = 1728\ \text{N/m}^2 .

Friction force and torque

A=πdL=π(0.150)(0.225)=0.1060m2,F=τA=1728×0.1060=183.2N,A = \pi d L = \pi(0.150)(0.225) = 0.1060\ \text{m}^2,\qquad F = \tau A = 1728\times0.1060 = 183.2\ \text{N},

Tf=Fr=183.2×0.075=13.74N·m.T_f = F r = 183.2\times0.075 = 13.74\ \text{N·m}.

Power wasted in friction

P=Tfω=FU=183.2×11.78=2158W≈2.16𝐤𝐖.P = T_f\,\omega = F U = 183.2\times11.78 = 2158\ \text{W} \approx \mathbf{2.16\ kW}.

Cross-check with Petroff’s equation.

  • Bearing pressure: p=W/(Ld)=10000/(0.225×0.150)=296.3p = W/(Ld) = 10\,000/(0.225\times0.150) = 296.3 kPa.
  • Speed: n=25n = 25 rev/s.

f=2π2μnprc=2π2×0.011×25296300×750.075=0.01832.f = 2\pi^2\,\frac{\mu n}{p}\,\frac{r}{c} = 2\pi^2\times\frac{0.011\times25}{296\,300}\times\frac{75}{0.075} = 0.01832 .

So F=fW=183.2F = fW = 183.2 N, as before.

The Sommerfeld number is S=(r/c)2μn/p=0.93S = (r/c)^2\,\mu n/p = 0.93. This is high: the bearing runs lightly loaded and nearly concentric, so Petroff’s assumption holds well. A Raimondi–Boyd chart would raise the loss by only a few per cent.

✓ Checked by computer We recalculated the result in Python by two routes: the shear stress on the bearing area, and Petroff’s equation written with the Sommerfeld number. Both give f = 0.01832 and a friction loss of 2158 W.

↑ Back to the question list

A ball at the end of a very long pendulum can be assumed to move linearly between two metallic plates at a fixed distance apart. The inner distance between the plates is slightly more than the diameter of the pendulum bob which is spherical leaving clearance on the left or on the right. If the plates move in simple harmonic motion, the amplitude being very small, the bob may touch the left or the right side plate or it may not touch any, at any instant. If the bob touches the left plate, equation A is governed while if it touches the right plate, equation B is governed. If there is no contact by the bob on any of the plates, then equation C is governed. Write a flow chart in FORTRAN for the motion of the bob.

2000 · Paper I · Q5d · 20 marks

Solution

Setting up. Let the plates oscillate together: the centre of the gap is at xp=asinωtx_p = a\sin\omega t. Let xx be the bob’s position and δ\delta the clearance on each side, so the gap is dbob+2δd_{bob} + 2\delta. The relative position r=x−xpr = x – x_p decides which equation applies:

Condition Contact Equation
r≤−δr \le -\delta and the plate is closing on the bob (v≤vpv \le v_p) left plate A
r≥+δr \ge +\delta and the plate is closing on the bob (v≥vpv \ge v_p) right plate B
otherwise no contact C

A plate can only push. Once it starts to move away faster than the bob, contact ends and C takes over again.

The question does not print equations A, B and C, so we use the simplest physical model. A very long pendulum has a tiny restoring force g/Lg/L and a massive plate:

  • A: the bob moves with the left plate: x=xp−δx = x_p – \delta, v=vpv = v_p.
  • B: the bob moves with the right plate: x=xp+δx = x_p + \delta, v=vpv = v_p.
  • C: free pendulum motion, ẍ=−(g/L)x\ddot x = -(g/L)\,x, stepped forward by Δt\Delta t.

If the examiner’s own A, B and C are different, only the three subroutines change; the flow chart and the main program stay the same.

Flow chart

StartRead a, ω, D, g/L,Δt, TENDX = 0, V = 0, T = 0T > TEND ?Print step countsStopXP = a sin ωT, VP = aω cos ωTR = X − XPR ≤ −D andV ≤ VP ?R ≥ D andV ≥ VP ?Equation A (left plate)X = XP − D, V = VPEquation B (right plate)X = XP + D, V = VPEquation C (no contact)V = V − (g/L) X ΔtX = X + V ΔtPrint T, XP, X, equation(every NPRINT steps)T = T + ΔtYesNoYesNoYesNo
Flow chart for the bob. At each time step the bob position relative to the gap centre, R = X − XP, and the velocities decide whether the left plate (equation A), the right plate (equation B) or neither (equation C) governs; the loop runs until T exceeds TEND.

FORTRAN program

C     BOB OF A VERY LONG PENDULUM BETWEEN TWO PLATES IN SHM
C     XP = AMP*SIN(W*T) : CENTRE OF THE GAP (PLATES MOVE TOGETHER)
C     R  = X - XP       : BOB POSITION RELATIVE TO THE GAP CENTRE
C     R <= -D AND V <= VP : BOB TOUCHES LEFT PLATE  -> EQUATION A
C     R >= +D AND V >= VP : BOB TOUCHES RIGHT PLATE -> EQUATION B
C     (THE PLATE CAN ONLY PUSH: CONTACT LASTS WHILE IT CLOSES ON THE BOB)
C     OTHERWISE NO CONTACT              -> EQUATION C
      PROGRAM BOB
      REAL X, V, T, DT, TEND, AMP, W, D, GL, XP, VP, R
      INTEGER ISTATE, NPRINT, K, NA, NB, NC
      WRITE (*,*) 'AMPLITUDE, OMEGA, CLEARANCE D, G/L ?'
      READ (*,*) AMP, W, D, GL
      WRITE (*,*) 'TIME STEP, END TIME, PRINT EVERY N STEPS ?'
      READ (*,*) DT, TEND, NPRINT
C     START AT REST AT THE CENTRE OF THE GAP
      X = 0.0
      V = 0.0
      T = 0.0
      K = 0
      NA = 0
      NB = 0
      NC = 0
      WRITE (*,100)
   10 IF (T .GT. TEND) GO TO 90
      XP = AMP*SIN(W*T)
      VP = AMP*W*COS(W*T)
      R  = X - XP
C     DECIDE WHICH EQUATION GOVERNS THIS STEP
      IF (R .LE. -D .AND. V .LE. VP) THEN
         CALL EQA(X, V, XP, VP, D)
         ISTATE = 1
         NA = NA + 1
      ELSE IF (R .GE. D .AND. V .GE. VP) THEN
         CALL EQB(X, V, XP, VP, D)
         ISTATE = 2
         NB = NB + 1
      ELSE
         CALL EQC(X, V, GL, DT)
         ISTATE = 3
         NC = NC + 1
      END IF
      IF (MOD(K, NPRINT) .EQ. 0) WRITE (*,110) T, XP, X, X-XP, ISTATE
      T = T + DT
      K = K + 1
      GO TO 10
   90 WRITE (*,120) NA, NB, NC
  100 FORMAT (/'      T        XP         X       X-XP  EQN')
  110 FORMAT (F7.3, 3F11.5, I4)
  120 FORMAT (/' STEPS ON EQUATION A, B, C: ', 3I8)
      STOP
      END
C
C     EQUATION A: BOB PRESSED ON THE LEFT PLATE, MOVES WITH IT
      SUBROUTINE EQA(X, V, XP, VP, D)
      REAL X, V, XP, VP, D
      X = XP - D
      V = VP
      RETURN
      END
C
C     EQUATION B: BOB PRESSED ON THE RIGHT PLATE, MOVES WITH IT
      SUBROUTINE EQB(X, V, XP, VP, D)
      REAL X, V, XP, VP, D
      X = XP + D
      V = VP
      RETURN
      END
C
C     EQUATION C: FREE PENDULUM, X'' = -(G/L)*X  (ONE EULER-CROMER STEP)
      SUBROUTINE EQC(X, V, GL, DT)
      REAL X, V, GL, DT
      V = V - GL*X*DT
      X = X + V*DT
      RETURN
      END

Output (part, printed every 0.125 s; EQN 1, 2, 3 = A, B, C):

      T        XP         X       X-XP  EQN
  0.000    0.00000    0.00000    0.00000   3
  0.125    0.00707    0.00572   -0.00135   3
  0.250    0.01000    0.01200    0.00200   2
  0.375    0.00707    0.00907    0.00200   2
  0.500    0.00000    0.00200    0.00200   2
  0.625   -0.00707   -0.00585    0.00122   3
  0.750   -0.01000   -0.01200   -0.00200   1
  0.875   -0.00707   -0.00907   -0.00200   1

What the run shows.

  1. The plates start moving right, and the bob, left behind, is struck by the left plate.
  2. It is thrown ahead and flies freely (C) across the gap.
  3. It meets the right plate as the plate swings back, and is carried by it (B).
  4. The cycle then repeats on the left side (A).

Over 3 s the bob spends about half the time in contact, split equally between the two plates.

✓ Program compiled and tested The equations A, B and C are not printed in the question, so we stated a contact model for them. We then compiled the FORTRAN program with gfortran and ran it (amplitude 10 mm, ω = 2π rad/s, clearance 2 mm, g/L = 0.098 s⁻²). The same algorithm written independently in Python gave the same states at every printed time step.

↑ Back to the question list

Cover of the UPSC Mains Topic-wise and Year-wise PYQs book (2013–2026)

From the Optional Province team

Strengthen your GS papers

Our UPSC Mains Topic-wise & Year-wise PYQ Book (2013–2026) maps every GS question to the syllabus, so you know what UPSC asks and how often. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Draw the flow chart and write a computer programme in Fortran for computing standard deviation σ of a given set of 100 numbers x1,x2,…,x100, where σ=1N∑i=1N(xi−x¯)2 where x is an individual number of a group x¯ is the arithmetic mean of the group of numbers and N is the size of the group of numbers.

1999 · Paper I · Q1c · 20 marks

Solution

The formula in the question is the population standard deviation:

σ=1N∑i=1N(xi−x‾)2,x‾=1N∑i=1Nxi,N=100.\sigma = \sqrt{\frac{1}{N}\sum_{i=1}^{N}\left(x_i-\bar x\right)^2},\qquad \bar x = \frac{1}{N}\sum_{i=1}^{N}x_i,\qquad N = 100 .

It needs two passes over the data. The first pass finds x‾\bar x; the second adds up the squared deviations.

Flow chart

StartRead N = 100,x(1) … x(N)SUM = 0, I = 1SUM = SUM + x(I)I = I + 1I ≤ N ?XBAR = SUM / NS2 = 0, I = 1S2 = S2 + (x(I) − XBAR)²I = I + 1I ≤ N ?σ = √(S2 / N)Print XBAR, σStopNoNoYesYes
Standard deviation of N = 100 numbers in two passes: the first loop adds up the numbers to find the mean XBAR (x̄); the second adds up the squared deviations (x(I) − XBAR)²; finally σ = √(S2/N).

FORTRAN program

C     STANDARD DEVIATION OF 100 NUMBERS
      PROGRAM STDEV
      INTEGER N, I
      PARAMETER (N = 100)
      REAL X(N), SUM, XBAR, S2, SIGMA
      READ (*,*) (X(I), I = 1, N)
      SUM = 0.0
      DO 10 I = 1, N
         SUM = SUM + X(I)
   10 CONTINUE
      XBAR = SUM / N
      S2 = 0.0
      DO 20 I = 1, N
         S2 = S2 + (X(I) - XBAR)**2
   20 CONTINUE
      SIGMA = SQRT(S2 / N)
      WRITE (*,100) N, XBAR, SIGMA
  100 FORMAT (' N = ', I4, '   MEAN = ', F10.4, '   SIGMA = ', F10.4)
      STOP
      END

Notes:

  • PARAMETER (N = 100) fixes the array size and the loop limits in one place. To handle any N up to 100, read N first, as in the student-heights program on this page.
  • The 100 numbers can be typed in free format, separated by spaces or line breaks, or read from a file by redirection: ./stdev < data.txt.

✓ Program compiled and tested We compiled the program with gfortran and ran it on 100 test numbers. It gave mean 23.5145 and σ = 14.3004, matching Python’s statistics.pstdev.

↑ Back to the question list

Explain the mechanism of hydrodynamic and boundary lubrications. State with justification the important properties of lubricant in each case.

1998 · Paper I · Q1a · 20 marks · 200 words

Solution

Hydrodynamic (thick-film) lubrication

  • Mechanism. The moving surface drags viscous oil into a converging (wedge-shaped) gap. Squeezing the oil into the narrowing gap builds up a pressure.
  • In a journal bearing the shaft runs slightly off-centre, which makes the wedge itself. The film pressure supports the load, so the surfaces are fully separated by a film thicker than their roughness (h ≈ 5–50 µm).
  • Friction comes only from shearing the oil, so it is very low (f ≈ 0.001–0.005), and there is almost no wear.
  • It needs enough speed, viscosity and a not-too-high load, that is, a large μN/p\mu N/p.

Boundary (thin-film) lubrication

  • Mechanism. At low speed, high load, at starting and stopping, or with too little oil, the film becomes thinner than the surface roughness. The asperities (high points) then touch.
  • The load is carried by the asperities, coated with adsorbed or chemically reacted layers only a few molecules thick (polar fatty acids, or sulphides, chlorides and phosphates formed by additives).
  • These layers shear easily and keep the metal from welding together. Friction is higher (f ≈ 0.05–0.15) and some wear occurs.
  • Between the two regimes lies mixed lubrication.
μN / pfboundarymixedhydrodynamic (thick film)minimum frictionoil film thicker than roughnessHydrodynamicUasperities touch through adsorbed / EP layersBoundary
Left: the Stribeck (McKee) curve. At low μN/p the film is thinner than the surface roughness and the asperities rub through adsorbed layers (boundary lubrication, high friction). Friction falls through the mixed regime to a minimum, then rises slowly with μN/p once a full hydrodynamic film separates the surfaces (friction from oil shear only). Right: the two films.

Important properties of the lubricant

Regime Property Why it matters
Hydrodynamic Viscosity (the single most important) Sets the load capacity and the film thickness. Too low: the film breaks. Too high: large friction loss and heating.
Hydrodynamic High viscosity index Viscosity should change little with temperature, because the film heats up in running.
Hydrodynamic Oxidation and thermal stability The oil circulates hot for long periods, and must not form sludge or acid.
Hydrodynamic Low pour point; resistance to foaming and emulsifying It must flow at start-up and keep a continuous film.
Hydrodynamic Good thermal conductivity and specific heat The oil also carries the friction heat away.
Boundary Oiliness (lubricity) Polar molecules (fatty acids, esters) must cling to the metal and form a strong adsorbed layer.
Boundary Extreme-pressure (EP) and anti-wear additives (S, Cl, P compounds, ZDDP) They react with the hot asperities to form low-shear-strength films that prevent seizure.
Boundary High film strength and flash point Local flash temperatures at the asperity contacts are high.
Boundary Chemical stability; non-corrosive The additives must protect the surfaces, not attack them.

In short: in hydrodynamic lubrication the oil’s bulk property, viscosity, carries the load. In boundary lubrication the surface chemistry of the oil (oiliness and EP additives) prevents metal-to-metal contact.

✓ Answer checked step by step We checked the mechanisms and the lubricant properties against standard machine-design and tribology texts (the Stribeck curve and the film-thickness regimes).

↑ Back to the question list

Write an interactive file-oriented C programme that will maintain the list of names, addresses and telephone numbers in alphabetical order (by last name). Consider the information associated with each name to be a separate record and represent each record as a structure.

1998 · Paper I · Q1d · 20 marks · 200 words

Solution

Each entry is one structure. The program keeps an array of these structures in alphabetical order of last name at all times:

  • a new record is inserted in its place, by shifting the later records down one position;
  • a deleted record’s gap is closed up.

The array is read from a binary file at start-up and written back after every change, so the list survives between runs. A menu makes the program interactive.

#include <stdio.h>
#include <string.h>
#include <strings.h>

#define MAX   500
#define FNAME "phonebook.dat"

struct record {                 /* one entry = one structure */
    char last[30];
    char first[30];
    char address[80];
    char phone[20];
};

struct record book[MAX];
int count = 0;

void getline_s(const char *prompt, char *s, int size)
{
    printf("%s", prompt);
    if (fgets(s, size, stdin) == NULL) s[0] = '\0';
    s[strcspn(s, "\n")] = '\0';            /* drop the newline */
}

int compare(const struct record *a, const struct record *b)
{                               /* by last name, then first name, ignoring case */
    int c = strcasecmp(a->last, b->last);
    return c != 0 ? c : strcasecmp(a->first, b->first);
}

void load(void)                 /* read the file into memory */
{
    FILE *fp = fopen(FNAME, "rb");
    if (fp == NULL) return;                /* first run: no file yet */
    count = fread(book, sizeof(struct record), MAX, fp);
    fclose(fp);
}

void save(void)                 /* write memory back to the file */
{
    FILE *fp = fopen(FNAME, "wb");
    if (fp == NULL) { printf("Cannot write %s\n", FNAME); return; }
    fwrite(book, sizeof(struct record), count, fp);
    fclose(fp);
}

void add(void)                  /* insert in alphabetical position */
{
    struct record r;
    int i;
    if (count == MAX) { printf("List is full.\n"); return; }
    getline_s("Last name : ", r.last, sizeof r.last);
    getline_s("First name: ", r.first, sizeof r.first);
    getline_s("Address   : ", r.address, sizeof r.address);
    getline_s("Telephone : ", r.phone, sizeof r.phone);
    i = count - 1;
    while (i >= 0 && compare(&book[i], &r) > 0) {
        book[i + 1] = book[i];             /* shift larger names down */
        i--;
    }
    book[i + 1] = r;
    count++;
    save();
    printf("Added.\n");
}

int find(const char *last)
{
    int i;
    for (i = 0; i < count; i++)
        if (strcasecmp(book[i].last, last) == 0) return i;
    return -1;
}

void show(int i)
{
    printf("%-15s %-12s %-30s %s\n", book[i].last, book[i].first,
           book[i].address, book[i].phone);
}

void search(void)
{
    char key[30]; int i, found = 0;
    getline_s("Last name to find: ", key, sizeof key);
    for (i = 0; i < count; i++)
        if (strcasecmp(book[i].last, key) == 0) { show(i); found = 1; }
    if (!found) printf("Not found.\n");
}

void delete_rec(void)
{
    char key[30]; int i;
    getline_s("Last name to delete: ", key, sizeof key);
    i = find(key);
    if (i < 0) { printf("Not found.\n"); return; }
    for (; i < count - 1; i++) book[i] = book[i + 1];   /* close the gap */
    count--;
    save();
    printf("Deleted.\n");
}

void list(void)
{
    int i;
    printf("%d record(s)\n", count);
    for (i = 0; i < count; i++) show(i);
}

int main(void)
{
    char ch[8];
    load();
    for (;;) {
        printf("\n1 Add  2 Delete  3 Search  4 List  5 Quit\n");
        getline_s("Choice: ", ch, sizeof ch);
        switch (ch[0]) {
            case '1': add();        break;
            case '2': delete_rec(); break;
            case '3': search();     break;
            case '4': list();       break;
            case '5': save(); return 0;
            default : printf("Choose 1 to 5.\n");
        }
    }
}

Sample session (second run, the file already holds Agarwal, Kumar and Sharma; we add Bose, delete Kumar and list):

1 Add  2 Delete  3 Search  4 List  5 Quit
Choice: 4
3 record(s)
Agarwal         Meena        4 Park St, Kolkata             033-2221111
Bose            Tara         9 Lake Rd, Chennai             044-2445566
Sharma          Ravi         12 MG Road, Pune               020-2551234

Design points:

  • Structure: struct record groups the four fields of one person, so a whole record is copied, compared or written with one statement.
  • File-oriented: fread/fwrite move the whole array of structures to and from phonebook.dat in binary form. If the file does not exist on the first run, the program starts with an empty list.
  • Alphabetical order: compare() uses strcasecmp, so “kumar” sorts with “Kumar”. Equal last names are ordered by first name. Keeping the list sorted on insertion means it never needs a separate sort.
  • fgets reads whole lines, so addresses may contain spaces.

✓ Program compiled and tested We compiled the program with gcc and ran it in two sessions. In the first we added three people out of alphabetical order (including a lower-case name) and the list came out sorted. In the second, the file was reloaded, a new name was inserted in its place, one record was deleted, a search was made and the list was correct.

↑ Back to the question list

Write a FORTRAN programme for the amount payable (A) after n years on a principle amount (P) at a rate of interest (i%) compounded annually. The formula for calculating the amount is given below: A=P(1+i100)n

1997 · Paper I · Q5b · 20 marks · 200 words

Solution

A=P(1+i100)nA = P\left(1+\frac{i}{100}\right)^{n}

The program reads P, i and n, evaluates the formula with the exponentiation operator **, and also prints the balance at the end of each year.

C     AMOUNT AFTER N YEARS, INTEREST COMPOUNDED ANNUALLY
      PROGRAM COMPND
      INTEGER N, K
      REAL P, RATE, A
      WRITE (*,*) 'PRINCIPAL P, RATE I (PER CENT), YEARS N ?'
      READ (*,*) P, RATE, N
      A = P * (1.0 + RATE/100.0)**N
      WRITE (*,100) P, RATE, N, A
C     YEAR-BY-YEAR TABLE (SAME RESULT BY REPEATED MULTIPLICATION)
      A = P
      DO 10 K = 1, N
         A = A * (1.0 + RATE/100.0)
         WRITE (*,110) K, A
   10 CONTINUE
  100 FORMAT (' P = ', F12.2, '  I = ', F6.2, ' %  N = ', I3,
     &        /' AMOUNT PAYABLE A = ', F14.2)
  110 FORMAT (' END OF YEAR ', I3, F14.2)
      STOP
      END

Sample output (P = 10 000, i = 8, n = 5):

 P =     10000.00  I =   8.00 %  N =   5
 AMOUNT PAYABLE A =       14693.28
 END OF YEAR   1      10800.00
 END OF YEAR   2      11664.00
 END OF YEAR   3      12597.12
 END OF YEAR   4      13604.89
 END OF YEAR   5      14693.28

N is declared INTEGER, so (1.0 + RATE/100.0)**N is worked out by repeated multiplication, which is exact and fast. With a real exponent, FORTRAN would use logarithms instead.

✓ Program compiled and tested We compiled the program with gfortran and ran it for P = Rs 10 000, i = 8 % and n = 5 years. It gave A = Rs 14 693.28, the same as 10 000 × 1.08⁵ = 14 693.28 worked out in Python, and the year-by-year table ends at the same figure.

↑ Back to the question list

What is the classical Reynold’s Equation for one dimensional fluid flow based on Hydrodynamic lubrication theory? What are the assumptions made in arriving at this equation? Explain the significance of Sommerfeld Number, Temperature Rise and Minimum Film Thickness for assessing a bearing performance.

1996 · Paper I · Q1d · 20 marks · 200 words

Solution

Reynolds equation (one-dimensional flow)

Take the oil film between a surface moving at speed UU in the xx-direction and a fixed surface, with film thickness h(x)h(x). The flow is taken as unchanged across the width zz (an infinitely long bearing).

Ufixed padh₁h₂p_max (h = h*)p(x)
Hydrodynamic wedge (film thickness exaggerated). The lower surface moves at U; the film converges from h₁ to h₂. Velocity profiles (teal) are the linear shear flow plus a pressure-driven parabola: concave at entry, linear where h = h* (peak pressure, dp/dx = 0), convex at exit. The pressure (gold) is zero at both ends and peaks near the outlet.

Force balance on an element. The pressure gradient balances the viscous shear:

∂p∂x=∂τ∂y=μ∂2u∂y2.\frac{\partial p}{\partial x} = \frac{\partial \tau}{\partial y} = \mu\,\frac{\partial^2 u}{\partial y^2}.

Velocity profile. Integrate twice with u=Uu = U at y=0y = 0 and u=0u = 0 at y=hy = h. The profile is a linear shear part plus a pressure-driven parabola:

u=12μdpdx(y2−hy)+U(1−yh).u = \frac{1}{2\mu}\frac{dp}{dx}\left(y^2 – hy\right) + U\left(1-\frac{y}{h}\right).

Flow per unit width.

q=∫0hudy=Uh2−h312μdpdx.q = \int_0^h u\,dy = \frac{Uh}{2} – \frac{h^3}{12\mu}\frac{dp}{dx}.

Continuity. qq is the same at every section, so dq/dx=0dq/dx = 0. This gives the Reynolds equation:

ddx(h3μdpdx)=6Udhdx\boxed{\;\frac{d}{dx}\left(\frac{h^3}{\mu}\,\frac{dp}{dx}\right) = 6U\,\frac{dh}{dx}\;}

The wedge term on the right shows why a converging film (dh/dx<0dh/dx < 0) is needed to build up pressure.

For a 2-D film the equation becomes

∂∂x(h3∂p∂x)+∂∂z(h3∂p∂z)=6μU∂h∂x.\frac{\partial}{\partial x}\left(h^3\frac{\partial p}{\partial x}\right) + \frac{\partial}{\partial z}\left(h^3\frac{\partial p}{\partial z}\right) = 6\mu U\frac{\partial h}{\partial x}.

Assumptions

  1. The lubricant is Newtonian, and the flow is laminar.
  2. Inertia and body forces (gravity) are negligible compared with the viscous and pressure forces.
  3. The film is very thin compared with the other dimensions, so the pressure is constant across it (∂p/∂y=0\partial p/\partial y = 0). The curvature of the film is neglected.
  4. The viscosity is constant through the film (isothermal), and the fluid is incompressible.
  5. There is no slip at the surfaces.
  6. Only ∂u/∂y\partial u/\partial y matters: the velocity gradients along the film are negligible.
  7. For the 1-D form, there is no side leakage (an infinitely wide bearing).

Significance of the performance parameters

  • Sommerfeld number

S=(rc)2μNpS = \left(\frac{r}{c}\right)^2\frac{\mu N}{p}

where NN is in rev/s and p=W/(Ld)p = W/(Ld).

  • It is the dimensionless bearing characteristic number: it groups everything the designer can choose.

  • For a given L/dL/d, the Raimondi–Boyd charts give, in terms of SS alone: the eccentricity ratio, the minimum film thickness, the coefficient of friction (r/c)f(r/c)f, the oil flow and the temperature rise.

  • A large SS means light load or high speed: a thick film and higher friction.

  • A small SS means heavy load: a thin film, near the boundary regime.

  • Two bearings with the same SS and L/dL/d behave alike.

  • Temperature rise ΔT\Delta T

    • The friction power fWUfWU heats the oil: ΔT=fWU/(ρcpQ)\Delta T = fWU/(\rho\,c_p\,Q), where QQ is the oil flow.
    • Viscosity falls steeply with temperature, so the design must be iterated. Assume an average film temperature, find μ, work out ΔT, and repeat until they agree.
    • Too large a rise thins the oil, reduces the load capacity and speeds up oxidation. In practice the oil outlet temperature is kept below about 80–90 °C.
  • Minimum film thickness

hmin=c(1−ε)h_{min} = c(1-\varepsilon)

  • This is the critical safety criterion. It must exceed the combined surface roughness of the shaft and the bearing, with a margin for misalignment, deflection and dirt particles; a typical design value is hmin≥0.005h_{min} \ge 0.005–0.0250.025 mm.
  • If hminh_{min} is too small, the bearing goes into mixed or boundary lubrication and wears or seizes. Designers often choose cc to lie between the minimum-friction and maximum-load lines of the Raimondi–Boyd chart.

✓ Derivation checked step by step We checked the derivation of the Reynolds equation step by step from the force balance on a fluid element and continuity, together with the meaning of the performance parameters, against standard lubrication texts.

↑ Back to the question list

There are ‘NSTUD’ students in a class whose roll numbers are given in an array ‘NROLL’ and the marks obtained in the final examination are given in array ‘TOTAL’. Write a program, in FORTRAN, to read roll numbers and corresponding marks of all the students and arrange them in order of merit. Assume the value of ‘NSTUD’ as 40.

1996 · Paper I · Q7c · 20 marks

Solution

The program reads the 40 roll numbers into NROLL and the marks into TOTAL. It then sorts the marks in descending order, moving each roll number together with its marks, and prints the merit list.

An insertion sort is used. Each new student is slid up past all students with lower marks. Students with equal marks keep their input order, because the sort is stable.

C     ARRANGE NSTUD STUDENTS IN ORDER OF MERIT (HIGHEST TOTAL FIRST)
      PROGRAM MERIT
      INTEGER NSTUD
      PARAMETER (NSTUD = 40)
      INTEGER NROLL(NSTUD), I, J, KR, IRANK
      REAL TOTAL(NSTUD), T
      WRITE (*,*) 'ENTER ROLL NUMBER AND TOTAL FOR EACH STUDENT'
      DO 10 I = 1, NSTUD
         READ (*,*) NROLL(I), TOTAL(I)
   10 CONTINUE
C     INSERTION SORT, DESCENDING ON TOTAL. ROLL NUMBERS MOVE WITH
C     THEIR MARKS. EQUAL TOTALS KEEP THEIR INPUT ORDER.
      DO 30 I = 2, NSTUD
         T  = TOTAL(I)
         KR = NROLL(I)
         J  = I - 1
   20    IF (J .GE. 1) THEN
            IF (TOTAL(J) .LT. T) THEN
               TOTAL(J+1) = TOTAL(J)
               NROLL(J+1) = NROLL(J)
               J = J - 1
               GO TO 20
            END IF
         END IF
         TOTAL(J+1) = T
         NROLL(J+1) = KR
   30 CONTINUE
C     PRINT THE MERIT LIST. EQUAL TOTALS SHARE A RANK.
      WRITE (*,100)
      IRANK = 1
      DO 40 I = 1, NSTUD
         IF (I .GT. 1) THEN
            IF (TOTAL(I) .LT. TOTAL(I-1)) IRANK = I
         END IF
         WRITE (*,110) IRANK, NROLL(I), TOTAL(I)
   40 CONTINUE
  100 FORMAT (/'  RANK   ROLL NO.    TOTAL')
  110 FORMAT (I6, I10, F10.1)
      STOP
      END

Sample output (first lines; three students tied on 450):

  RANK   ROLL NO.    TOTAL
     1      1008     450.0
     1      1023     450.0
     1      1026     450.0
     4      1006     440.0
     4      1011     440.0
     4      1039     440.0
     7      1002     430.0

Notes:

  • The key point is to swap (or move) NROLL and TOTAL together; sorting only the marks would lose track of who scored them.
  • A bubble sort with the same paired exchange is equally acceptable for 40 students.
  • For a large class a faster sort such as heapsort would be used.

✓ Program compiled and tested We compiled the program with gfortran and ran it on 40 test students with several tied totals. The 40 totals came out in non-increasing order, each roll number stayed with its own marks, and tied students shared a rank (1, 1, 1, 4, 4, 4, 7 …). The order matched a Python sort of the same data.

↑ Back to the question list

A tank having liquid capacitance C1 is supplying liquid through a pipe of resistance R1 to another tank of liquid capacitance C2 which delivers this liquid through another pipe of resistance R2. The steady-state outflow rates of tank 1 and that of tank 2 are Q1 and Q2 and heads are H1 and H2 respectively. The flow balance equation for tank 1 is ΔQ=ΔQ1+C1ddt(ΔH1) Similarly for tank 2 is ΔQ1=ΔQ2+C2ddt(ΔH2) where ΔQ1=(ΔH1−ΔH2)/R1; ΔQ2=ΔH2/R2 and Δ’s show small variations of quantities. Draw the overall feedback block diagram of the system and obtain the transfer function.

[Figure: Two open tanks side by side, “Tank 1” (capacitance C1) on the left and “Tank 2” (capacitance C2) on the right, both containing liquid. Inflow Q enters Tank 1 from the top through a valve. A pipe at the bottom of Tank 1 carries flow Q1 (labelled below the pipe) to Tank 2; a pipe at the bottom of Tank 2 discharges to the right (arrow; its label is not legible in the copy)]

1995 · Paper I · Q4a · 30 marks

Solution

Equations in the Laplace domain (small changes, zero initial values; write Q,Q1,Q2,H1,H2Q, Q_1, Q_2, H_1, H_2 for the transforms of the Δ quantities):

Q−Q1=C1sH1,Q1=H1−H2R1,Q1−Q2=C2sH2,Q2=H2R2.Q – Q_1 = C_1 s\,H_1,\qquad Q_1 = \frac{H_1 – H_2}{R_1},\qquad Q_1 – Q_2 = C_2 s\,H_2,\qquad Q_2 = \frac{H_2}{R_2}.

Each equation is one block:

  • each tank is an integrator 1/(Cs)1/(C s) acting on the difference between its inflow and outflow;
  • each pipe is a gain 1/R1/R acting on the head difference across it.
+−+−+−1 / C₁s1 / R₁1 / C₂s1 / R₂QH₁Q₁H₂Q₂Q₁ (outflow of tank 1)H₂ (interaction)Q₂ (outflow of tank 2)tank 1pipe 1tank 2pipe 2
Block diagram of the two interacting tanks. Each tank integrates its net inflow (1/Cs); each pipe converts a head difference into a flow (1/R). Three negative feedbacks: Q₁ back to tank 1, H₂ back to the head difference across pipe 1 (the interaction), and Q₂ back to tank 2.

Block diagram

  1. Inner loop of tank 2. From Q1Q_1: the block 1/(C2s)1/(C_2 s) gives H2H_2, then 1/R21/R_2 gives Q2Q_2, which is fed back negatively. Reduced:

Q2Q1=1/(R2C2s)1+1/(R2C2s)=1R2C2s+1.\frac{Q_2}{Q_1} = \frac{1/(R_2C_2 s)}{1 + 1/(R_2C_2 s)} = \frac{1}{R_2C_2 s + 1}.

  1. Interaction loop. H2=R2Q2H_2 = R_2 Q_2 is fed back to the head difference H1−H2H_1 – H_2, so tank 2 “pushes back” on tank 1. This is why the two tanks do not simply act as two first-order lags in series.

  2. Outer loop of tank 1. Q−Q1Q – Q_1 passes through 1/(C1s)1/(C_1 s) to give H1H_1.

Transfer function. From the second equation, H1=H2+R1Q1H_1 = H_2 + R_1 Q_1. From the last two, Q1=Q2+C2sR2Q2=(R2C2s+1)Q2Q_1 = Q_2 + C_2 s R_2 Q_2 = (R_2C_2 s + 1)\,Q_2, so

H1=R2Q2+R1(R2C2s+1)Q2.H_1 = R_2Q_2 + R_1(R_2C_2 s + 1)\,Q_2 .

Substitute into the first equation, Q=Q1+C1sH1Q = Q_1 + C_1 s H_1:

Q=[(R2C2s+1)+C1s(R2+R1R2C2s+R1)]Q2.Q = \left[(R_2C_2s+1) + C_1 s\left(R_2 + R_1R_2C_2 s + R_1\right)\right]Q_2 .

Q2(s)Q(s)=1R1C1R2C2s2+(R1C1+R2C2+R2C1)s+1\boxed{\;\frac{Q_2(s)}{Q(s)} = \frac{1}{R_1C_1R_2C_2\,s^2 + \left(R_1C_1 + R_2C_2 + R_2C_1\right)s + 1}\;}

In terms of the head in tank 2:

H2(s)Q(s)=R2R1C1R2C2s2+(R1C1+R2C2+R2C1)s+1.\frac{H_2(s)}{Q(s)} = \frac{R_2}{R_1C_1R_2C_2\,s^2 + \left(R_1C_1 + R_2C_2 + R_2C_1\right)s + 1}.

Mason’s formula check.

  • Forward path: 1/(R1R2C1C2s2)1/(R_1R_2C_1C_2s^2).
  • Loops: L1=−1/(R1C1s)L_1 = -1/(R_1C_1s), L2=−1/(R1C2s)L_2 = -1/(R_1C_2s), L3=−1/(R2C2s)L_3 = -1/(R_2C_2s). L1L_1 and L3L_3 do not touch.
  • So Δ=1−(L1+L2+L3)+L1L3\Delta = 1 – (L_1+L_2+L_3) + L_1L_3. Multiplying through by R1R2C1C2s2R_1R_2C_1C_2s^2 gives the same denominator.

Interpretation.

  • The system is second order and overdamped: both poles are real and negative, so the response is non-oscillatory.
  • The cross term R2C1R_2C_1 is the interaction (loading) effect. If the tanks did not interact (tank 1 discharging freely into tank 2), the result would be 1/[(R1C1s+1)(R2C2s+1)]1/[(R_1C_1s+1)(R_2C_2s+1)], with no R2C1R_2C_1 term.
  • The steady-state gain is 1: in steady flow, all that enters leaves.

✓ Derivation checked step by step We checked the transfer function in SymPy by solving the four Laplace-domain equations, and checked it again by Mason’s gain formula on the block diagram (three loops, two of them non-touching). All three results agree.

↑ Back to the question list

Write complete program in C-language to obtain the output: Civil Services Examination.

1995 · Paper I · Q5c · 20 marks · 200 words

Solution

#include <stdio.h>

int main(void)
{
    printf("Civil Services Examination\n");
    return 0;
}

Output

Civil Services Examination

How it works:

  • #include <stdio.h> brings in the declaration of printf.
  • Execution starts at main().
  • printf sends the string to the standard output, and \n ends the line.
  • return 0 tells the operating system the program ended normally.

✓ Program compiled and tested We compiled the program with gcc and ran it; it printed the required line.

↑ Back to the question list

The frictional force f(x) acting on a body is expressed by the following: f(x)=0|x|≤0.5 =2x2forx>0.5 This function is required to be used in the following equation: g=(mvt)−f(v2)+at Write a FORTRAN programme for the stated problem.

1995 · Paper I · Q8a · 30 marks

Solution

Reading the problem.

  • The friction function has a dead band: f(x)=0f(x) = 0 for |x|≤0.5|x| \le 0.5 and f(x)=2x2f(x) = 2x^2 for x>0.5x > 0.5.
  • It is called with the argument x=v2x = v^2, so g=mvt−f(v2)+at.g = m\,v\,t – f\!\left(v^2\right) + a\,t .
  • Because v2≥0v^2 \ge 0, only the two printed branches are ever needed. The program treats |x|>0.5|x| > 0.5 as the second branch, which also covers the unprinted case x<−0.5x < -0.5.

The natural FORTRAN tool for ff is a function subprogram. It is called with any argument, here F(V**2).

The main program reads m, a and t, and a range of speeds. It prints a table of vv, f(v2)f(v^2) and gg, so the switch of the friction law at v2=0.5v^2 = 0.5 (v=0.707v = 0.707) can be seen.

C     G = M*V*T - F(V**2) + A*T  WITH THE PIECEWISE FRICTION FUNCTION F
      PROGRAM FRICT
      REAL M, A, T, V, V1, V2, DV, G, F
      INTEGER K, NSTEP
      WRITE (*,*) 'M, A, T ?'
      READ (*,*) M, A, T
      WRITE (*,*) 'FIRST V, LAST V, STEP DV ?'
      READ (*,*) V1, V2, DV
      NSTEP = NINT((V2 - V1)/DV)
      WRITE (*,100)
      DO 10 K = 0, NSTEP
         V = V1 + K*DV
         G = M*V*T - F(V**2) + A*T
         WRITE (*,110) V, F(V**2), G
   10 CONTINUE
  100 FORMAT (/'       V      F(V**2)         G')
  110 FORMAT (F8.3, 2F12.4)
      STOP
      END
C
C     FRICTION FUNCTION: ZERO INSIDE THE DEAD BAND |X| <= 0.5
      REAL FUNCTION F(X)
      REAL X
      IF (ABS(X) .LE. 0.5) THEN
         F = 0.0
      ELSE
         F = 2.0*X**2
      END IF
      RETURN
      END

Sample output (m = 2, a = 1.5, t = 3):

       V      F(V**2)         G
   0.000      0.0000      4.5000
   0.200      0.0000      5.7000
   0.400      0.0000      6.9000
   0.600      0.0000      8.1000
   0.800      0.8192      8.4808
   1.000      2.0000      8.5000
   1.200      4.1472      7.5528

Up to v=0.707v = 0.707 the friction term is zero and gg grows linearly with vv. Beyond it, friction grows as 2v42v^4 and soon outweighs the mvtm v t term.

✓ Program compiled and tested We compiled the program with gfortran and ran it for m = 2, a = 1.5, t = 3 and v from 0 to 1.2. A separate Python evaluation of the same formula gave the same g at every step (for example v = 0.8: f = 0.8192, g = 8.4808).

↑ Back to the question list

More on Other Questions Outside the Present Syllabus

Questions: UPSC Civil Services (Main) Examination, Mechanical Engineering Paper I, 1995–2007. Solutions: Optional Province. Found an error? Tell us.

Spotted an error? Tell us.

We classify every PYQ with care, but mistakes can slip in. If a question is in the wrong topic, has a typo, the wrong year, or is missing, let us know. We review every report and update the page.

Report an Error
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted