Question: I have to do this in Python. Activity 1: Preparation For this part of the project, put together a document (e.g. Microsoft Word file) you

I have to do this in Python.

Activity 1: Preparation

For this part of the project, put together a document (e.g. Microsoft Word file) you will use to plan your program. You will turn in a PDF of this document.

First, examine the stress-strain curve. The curve has an increasing linear elastic region (from O to A) in which the stress is directly proportional to the strain. The slope of this region is called Youngs Modulus. After this (from point A to point B), there continues to be increasing stress per strain, but not at a constant rate. From the upper yield point (B) to the lower yield point (C) is a plastic region that is not linear (although it appears so in the figure above). This is followed by a strain hardening region (C to D) up to the point of maximum strength (D), a necking region (D to E) and finally a fracture point (E). Points A and B are actually distinct, and the plastic region is not purely linear, but in this idealized model, we will not worry about that.

You are to come up with a simplified purely linear model of the stress-strain curve. That is, you are to approximate the curve by a series of line segments. You should approximate the graph by at least 4 linear segments. The lines should begin at 0,0, and end at the fracture point. Using more lines will give a more accurate representation, but will be more work in coding; for this assignment, you do not need to be precise and can use just 4 segments.

  • For the linear elastic portion, state what Youngs Modulus is
  • Record the endpoints (as strain and stress coordinates) for each of the linear segments. You will need to estimate these from the graph.

Youll now work on taking that linear approximation of the stress-strain curve and creating a program that can evaluate it for you. (i.e. given a strain, report the stress).

Next, consider what values you need to store, and the general steps you will need to follow in your program.

  • Make a list of the variables you believe you are likely to need, and the names you will use.
  • Create a sequence of steps that you will follow
    • If you have a conditional statement (and you should), you might want to indicate each part of the condition as a separate action.
    • The computation here will involve a few stages. Please separate the stages into different parts; do not just say compute stress.

Next, create a list of test cases that you will use in your program. Be sure to handle both typical and edge cases. Do this before writing the program itself!

  • Similar to the group activity, for each test case state what it is you are trying to test (e.g. a typical case, an edge case, which region(s) you are testing, etc.), the value you want as input and the value as output.
  • Note that you should try to come up with a complete set of test cases that thoroughly test the idea.

Part 2: Constructing your program

AFTER doing the above, construct your program. Your program should ask users for a strain, and report the corresponding stress. As you write your program, please be sure to do the following:

  • Include comments for your program. You should probably begin by converting your list of steps into comments.
  • Develop incrementally. That is, write some code, and test it before writing the next section of code.
  • Be sure your program runs on all test cases.
  • Be sure to include specific instructions to the user for getting input, and writing a descriptive output.
80 60 A, B 8 40 20 0.05 0.10 0.15 0.200.25 0.30 e Strain Figure 3. Stress-strain diagram for structural steel in tension. 80 60 A, B 8 40 20 0.05 0.10 0.15 0.200.25 0.30 e Strain Figure 3. Stress-strain diagram for structural steel in tension

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!