Department of Mathematics, Texas A&M University



plete Lab 3 in Python using the following hintsThis lab MUST be completed in groups. No individual work will be accepted. HINTS: Here are the key Python commands used in this lab, along with links to the online help pages.?After last week's barrage of material, there are NO new commands this week!symbols:?(Used to create symbolic variables)limit:?(Needed for #1a and 3b)print:?(ALL answers and explanations should be given using print commands.? Obviously, on #2a, you will need to run the code interactively to find the a and b values before giving the explanation using IVT!)plot:?(.extend?can-but does not have to-be used to plot multiple functions on the same graph like #1b and #3c (refer to the commented-out lines in the #3c solution).? Not shown here, but p1.show() will show the graph if matplotlib notebook has been activated, not just describe it!? You are already aware of the command "show=false" to enhance your plot).ylim:?(Used within the plot commands in #2a and #3c above to change the ymin and ymax of the graph: #2a as described in the problem, #3c to reduce the effect of the vertical asymptote)subs: subs:?(Used to compute V(a) and V(b) in #2b and can be used (with list comprehension below) to numerically estimate the limit in #3a.solve:?(used to solve the equation in #2c. See the NOTE at the bottom about what may happen as referenced in the question)for:?(Used to evaluate f(x) in #3a at ALL values at one time.? See NOTE at the bottom about data types as referenced in the question.)NOTES:?1) The?solve?command in #2 may take a while in PYTHON given the complexity of the equation.? If you print Python's solution, you get two values: one which is negative (and hence not practical), and one which contains a complex value that is extremely small (-8 x 10^-27).? Note that the real part agrees with you answer to part (b), so you may ignore the complex "residue" obtained by Python.2)? As mentioned last week, ENGR 102 discussed data types, which play a BIG role in #3a-particularly integer vs float. Using integers give exact answers, and?.evalf()?does NOT work on lists!? You can use list comprehension to?.evalf?each element of the list, but it is much easier if you use the float representations in your list.Let me know if you have any questions or comments about this week's lab.?Thanks ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download