EGR 103/Fall 2022/Lab 5

From PrattWiki
Revision as of 15:43, 4 October 2022 by DukeEgr93 (talk | contribs) (Created page with "<div class="noautonum">__TOC__</div> == Errors / Additions == None yet! == 5.1 Introduction == The main purpose of this lab will be to look at logical masks. The following...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Errors / Additions

None yet!

5.1 Introduction

The main purpose of this lab will be to look at logical masks. The following is a companion piece to the lab handout itself. The sections in this guide will match those in the handout.

5.2 Resources

5.3 Getting Started

5.4 Assignments

5.4.1 Group Gradescope Problems

You should complete these during the lab, or at least by next Friday.

5.4.1.1 Based on Chapra 3.14

The main concept here is to use logical masks to create piecewise functions. The function itself actually only needs to be one line of code! One really, really long "line" of code, but still... Also - all the parentheses are important - each relational operator needs a set, the logical operators need a set, and the products need a set. And if you go over one line, you will need another set on the outside to get Python to code wrap. Be sure to look at the code we generated in class on Monday as well.

If you are getting almost all correct, you may need to use ``np.exp(x)`` rather than ``m.e**x`` in computing your solution.

5.4.2 Individual Lab Report

5.4.2.1 Chapra 3.10 / Beam Deflection

The main concepts here are using logical masks to create piecewise functions, using different sets of points for mathematical analysis versus graphing, and determining and locating extrema as discussed in Plotting. Here is the test code and graph from the lab document:

For finding the values and locations of local extrema, see Python:Plotting#Using_Different_Scales for some examples.

General Concepts

This section is not in the lab report but rather has some items in it that span multiple problems in the lab.


Logical Masks

See Python:Logical Masks.


Class Document Protection