Assignment 2 Outline

To do so you will need to call chainpoints and

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: owTermination() as the last line of code in your script file. 2. Define the constants you will need (e.g., the gravitational constant, the values of d = 0.98 [m] and h = 1.10 [m], and ρ, the density of the chain, set to 2.0 kg/m, the number of points) and print out the values of these constants. In each case put a comment behind the definition in your code stating the units for the constant and what it represents. If you obtained the value for the constant from a source outside the course, cite that source in a comment. Keep the constant definitions together, and the print statements together. 3. Create the table in the output by looping over values of a (see Figure 1 for appropriate a values). You will never be able to match the values shown in the sample output exactly, since the values of a that were used in the sample code are not shown in the table. For each a, call the function angleWithPost to get the corresponding chain length and the angle between the chain and the post. The call should look something like this:4 length, theta = angleWithPost(aa, hh, dd, NUM_POINTS) At this point you face a problem. Your code won’t run until angleWithPost is defined, but if you try to define angleWithPost now, you will have to write many lines of code to get it working, and your code will have many errors in it. The way to resolve this problem is to write a stub for angleWithPost. A stub is a highly simplified version of a function that does NOT produce the right answer, but allows you to continue with your coding. In this case use the following stub: def angleWithPost(a...
View Full Document

This note was uploaded on 02/10/2014 for the course COMP 1012 taught by Professor Terryandres during the Winter '14 term at Manitoba.

Ask a homework question - tutors are online