CSC 110 - Short PA - Deflection Calculation

deflection 1

As you should have already read, deflection is the bend or curve that various materials can have when forces are applied to them. In this assignment, you’ll write a program that does a simple deflection calculation. The formula was provided to you previously.

Inputs

Your program should take 3 inputs. The input prompts, along with sample input values, are shown below:

Bridge length:
50
Distance to calculate deflection at:
20
Weight:
1000

deflection = 23.4127

The length of the bridge represents the length of the span of the bridge in meters. The second input is distance from one of the ends that you should compute the deflection for. The third is the weight (in Newtons) to calculate the deflection for.

Output

Given the 3 inputs shown in the previous section, You should calculate and print the deflection. Below, the computed deflection is shown for the three inputs.

Bridge length:
50
Distance to calculate deflection at:
20
Weight:
1000

deflection = 23.4127

This PA doesn’t require a lot of code! You should be able to do the whole thing in 5-10 lines of code (not including comments and blank spaces). You just need to get the inputs, plug in all of the values and claculate the deflection, and print it out, rounded to 5 decimal places.

An Example

Say that the inputs were 10, 4 and 1000, respectively. Going through the steps:

y = ( (w * x) / (48 * E * I) ) * ( (3 * L**2) - (4 * x**2) )

y = ( (1000 * 4) / (48 * 210 * 500) ) * ( (3 * 10**2) - (4 * 4**2) )

y = ( 4000 / 5040000 ) * ( (3 * 100) - (4 * 16) )

y = ( 4000 / 5040000 ) * ( 300 - 64 )

y = ( 4000 / 5040000 ) * 236

y = 0.18730

Examples

Bridge length:
30
Distance to calculate deflection at:
12
Weight:
2000

deflection = 10.11429
Bridge length:
100
Distance to calculate deflection at:
17
Weight:
500

deflection = 48.64563
Bridge length:
75
Distance to calculate deflection at:
32
Weight:
200

deflection = 16.2273
Bridge length:
10
Distance to calculate deflection at:
4
Weight:
1000

deflection = 0.1873

Submission

Submit deflection.py to gradescope by Feb 2, 2018. You should do your best to make sure that all of the test cases pass.