
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
![## Exercise
Generate a log-log plot of your period \( T \) vs. dynamic mass \( m_d \). This is the same plot that you drew on the log-log graphing paper from your materials pack.
### Perform these steps:
1. **Define lists or numpy arrays** that contain your experimental data. For example, \( m_d = [0.10, 0.15, 0.20] \) defines a list of dynamic masses 0.1, 0.15, and 0.20 kg, and \( T = [0.75, 0.83, 0.91] \) defines a list of periods (in seconds).
2. **Generate a log-log plot** of \( T \) vs. \( m_d \) that shows your data as points (not lines!) using `plt.loglog()` with the `'o'` option. The dynamic mass should be on the horizontal (x) axis.
3. **Add grid lines** for both the "major" and "minor" ticks, and both axes. Look up the documentation of `plt.grid()` to see how this is done. Remember that you can get the documentation for any command by running it in a cell of its own and appending a question mark, e.g. `plt.grid?`.
4. **The axis tick labels will likely show up in scientific notation** (e.g. \( 6 \times 10^{-2} \)). For our values (mostly in the 0.1...1 kg range), this is undesirable. Add a line `plt.rcParams['axes.formatter.min_exponent'] = 2` to your code to fix this. This command tells matplotlib to print all numbers between \( 10^{-2} \) and \( 10^{2} \) in normal notation.
5. **Don't forget to label the x- and y-axes.** Look up your code from the "Projectile Motion" lab if you are unsure how to do this.
```python
# define your arrays here
#
# Dynamic masses
# md =
# Periods
# T =
# YOUR CODE HERE
raise NotImplementedError()
```](https://content.bartleby.com/qna-images/question/b7f470a0-93f2-43bf-9ed3-2f125d19f075/c948103b-fe73-47de-a27a-8acc8cb1ee14/iunns9_thumbnail.png)
Transcribed Image Text:## Exercise
Generate a log-log plot of your period \( T \) vs. dynamic mass \( m_d \). This is the same plot that you drew on the log-log graphing paper from your materials pack.
### Perform these steps:
1. **Define lists or numpy arrays** that contain your experimental data. For example, \( m_d = [0.10, 0.15, 0.20] \) defines a list of dynamic masses 0.1, 0.15, and 0.20 kg, and \( T = [0.75, 0.83, 0.91] \) defines a list of periods (in seconds).
2. **Generate a log-log plot** of \( T \) vs. \( m_d \) that shows your data as points (not lines!) using `plt.loglog()` with the `'o'` option. The dynamic mass should be on the horizontal (x) axis.
3. **Add grid lines** for both the "major" and "minor" ticks, and both axes. Look up the documentation of `plt.grid()` to see how this is done. Remember that you can get the documentation for any command by running it in a cell of its own and appending a question mark, e.g. `plt.grid?`.
4. **The axis tick labels will likely show up in scientific notation** (e.g. \( 6 \times 10^{-2} \)). For our values (mostly in the 0.1...1 kg range), this is undesirable. Add a line `plt.rcParams['axes.formatter.min_exponent'] = 2` to your code to fix this. This command tells matplotlib to print all numbers between \( 10^{-2} \) and \( 10^{2} \) in normal notation.
5. **Don't forget to label the x- and y-axes.** Look up your code from the "Projectile Motion" lab if you are unsure how to do this.
```python
# define your arrays here
#
# Dynamic masses
# md =
# Periods
# T =
# YOUR CODE HERE
raise NotImplementedError()
```
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a program in c that create a 5-by-6 array. All elements in the array are random integer numbers between 1 and 100. Then, calculate the mean values of each column, and also find the minimums and maximums of each column. Print out the array, mean values, minimums,arrow_forwardGiven two arrays A and B of equal size N, the task is to find a vector containing only those elements which belong to exactly one array - either A or B - but not both. That is, if some element x appears in both A and B it should not be included in the output vector. Complete the implementation of "getVector(vector<ll>A, vector<ll>B, int N)" function. Example: Input: 1 3 5 7 1 3 2 4 6 7 8 Output: 3 5 1 3 2 4 6 8 The driver codes are attached in the images below. DO NOT CHANGE THE PROVIDED DRIVER CODES AT ALL, LEAVE THEM EXACTLY THE SAME. ONLY ADD CODE TO THE "getVector(vector<ll>A, vector<ll>B, int N)" FUNCTIONarrow_forwardD3 no. D4. Coding. Thearrow_forward
- 9.). integer array nums and an integer k, return the length of the shortest non-empty subarray of nums with a sum of at least k. If there is no such subarray, return -1. A subarray is a contiguous part of an array. Example 1: Input: nums = [1], k = 1 Output: 1 Example 2: Input: nums = [1,2], k = 4 Output: -1 Example 3: Input: nums = [2,-1,2], k = 3 Output: 3.arrow_forwardGiven an array of integers, find the maximum sum of a contiguous subarray. Write a function called maxSubarraySum that takes an array of integers as input and returns the maximum sum of a contiguous subarray. Example: Input: [1, -3, 2, 1, -1] Output: 3 Explanation: The subarray with the maximum sum is [2, 1], and the sum is 3. You need to implement the maxSubarraySum function. You can use any programming language of your choice.arrow_forwardMatlab: How do I convert a matrix into a cell array? When I try to convert for some reason my cellA and cellB sees everything as 1 string but I want something like A = {'File_20210916_5823.tsv', 'File_20210918_5023.tsv'} % Matrices A and B (defined as matrices)A = ['File_20210916_5823.tsv', 'File_20210918_5023.tsv'];B = ['Record_2021_09_16.csv', 'Record_2021_09_18.csv']; % Convert matrices A and B into cell arrays with individual stringscellA = cellstr(A);cellB = cellstr(B);disp(cellA)arrow_forward
- Select the for-loop which iterates through all even index values of an array.A. for(int idx = 0; idx < length; idx++)B. for(int idx = 0; idx < length; idx%2)C. for(int idx = 0; idx < length; idx+2)D. for(int idx = 0; idx < length; idx=idx+2)arrow_forwardWrite a function to find the maximum sum of a subarray within a given array of integers. The subarray should be contiguous, meaning the elements are adjacent to each other in the array. For example, given the array [-2, 1, -3, 4, -1, 2, 1, -5, 4], the maximum sum of a subarray is 6, which corresponds to the subarray [4, -1, 2, 1]. Write a function named `maxSubarraySum` that takes an array of integers as input and returns the maximum sum of a subarray. Note: If all the elements in the array are negative, the function should return O. Example: Input: [-2, 1, -3, 4, -1, 2, 1, -5, 4] Output: 6 Input: [-1, -2, -3, -4] Output: 0 Write the 'maxSubarraySum` function that solves this problem efficiently.arrow_forward: You are given an array-like data structure Listy which lacks a sizemethod. It does, however, have an elementAt ( i) method that returns the element at index i in 0( 1) time. If i is beyond the bounds of the data structure, it returns -1. (For this reason, the data structure only supports positive integers.) Given a Listy which contains sorted, positive integers,find the index at which an element x occurs. If x occurs multiple times, you may return any index.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education