## Pmax and Contact Radius

A rigid circular punch indents an elastic medium as given in the figure below.

The maximum contact pressure, Pmax and contact radius, a is given as:

Where

W – Normal load (N);

E – Modulus Young (Pa);

R – Radius of the circular punch (m).

## User-defined Functions MATLAB Code

You are then required to write a MATLAB code using user-defined functions, each for the maximum contact pressure (Pmax) and contact radius (a). Each of the functions MUST have E, W and R as the input variable. Then, using the code, plot maximum contact pressure, Pmax against contact radius, a, using MATLAB, with proper title and axis labels, for conditions below:

Case #1:

a. Normal load, W, ranging from 1N to 20N

b. Modulus Young, E= 70GPa

c. Circular punch radius, R=2cm

Case #2:

a. Normal load, W=10N

b. Modulus Young, E= 70GPa

c. Circular punch radius, R, ranging from 0.1cm to 10cm

Case #3:

a. Normal load, W=10N

b. Modulus Young, E, ranging from 50GPa to 200GPa

c. Circular punch radius, R=2cm

Case #4:

a. Normal load, W, ranging from 1N to 20N

b. Modulus Young, E=70GPa

c. Circular punch radius, R, ranging from 0.1cm to 10cm

At the end of this, compare all the cases and discuss on the effect of 1) changing normal load, 2) circular punch radius and 3) material properties on the maximum contact pressure.

For the submission, prepare a short report not longer than 3-pages with:

1. An introduction to the problem/Problem statement

2. A flow chart explaining the approach to programming

3. Plots/figures with properly labeled axis

4. Discussions and Conclusions

## MATLAB Code Solution

def mainMenu():

print('What would you like to know?')

print('a) Favorite Animal')

print('c) Favorite Color)')

print('m) Favorite Meal')

print()

print('q) Quit')

return input('>')

while True:

choice = mainMenu().lower()

if choice == 'a':

print('My favorite animal is a cat.')

elif choice == 'c':

print('My favorite color is blue.')

elif choice == 'm':

print('My favorite meal is pizza.')

elif choice == 'q':

print('Goodbye')

break

else:

print('That option is not available')

print()