Part C: Function, for and plotting We did a project in the lecture on calculating the free fall speeds and plotting them on a graph. This part is similar to the project. An engineer has derived a relationship between the force applied to a material and the extension in length that the force would cause. The relationship between force fand extension e is given by: e= [5.5f [f²-10f +55 if 0 ≤ f ≤ 10 if 10 < f < 20 You are asked to plot a graph showing the relationship between force and extension. You are asked to complete the following tasks: Task 1 Write a Python function which returns the value of e for a given input f. Do not use literals (e.g. 5.5, 10) in the expressions for e in the function. Instead you should define constants and use them. Note that the relationship between e and f depends on whether fis bigger than 10 or not, this means you need a certain Python construction in your function. If you can't think of that, have a look at Part A of Lab03.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section: Chapter Questions
Problem 4PP
icon
Related questions
Question

Part C: Function, for and plotting

We did a project in the lecture on calculating the free fall speeds and plotting them on a graph. This part is similar to the project.

An engineer has derived a relationship between the force applied to a material and the extension in length that the force would cause. The relationship between force f and extension e is given by:

You are asked to plot a graph showing the relationship between force and extension. You are asked to complete the following tasks:

Task 1

Write a Python function which returns the value of e for a given input f. Do not use literals (e.g. 5.5, 10) in the expressions for e in the function. Instead you should define constants and use them.

Note that the relationship between e and f depends on whether f is bigger than 10 or not, this means you need a certain Python construction in your function. If you can't think of that, have a look at Part A of Lab03.

Part C: Function, for and plotting
We did a project in the lecture on calculating the free fall speeds and plotting them on a graph. This part is similar to the
project.
An engineer has derived a relationship between the force applied to a material and the extension in length that the force would
cause. The relationship between force f and extension e is given by:
5.5f
e = { 551 1
fa10f+55
if 0 ≤ f ≤ 10
if 10 <f≤ 20
You are asked to plot a graph showing the relationship between force and extension. You are asked to complete the following
tasks:
Task 1
Write a Python function which returns the value of e for a given input f. Do not use literals (e.g. 5.5, 10) in the expressions for
e in the function. Instead you should define constants and use them.
Note that the relationship between e and f depends on whether f is bigger than 10 or not, this means you need a certain Python
construction in your function. If you can't think of that, have a look at Part A of Lab03.
Transcribed Image Text:Part C: Function, for and plotting We did a project in the lecture on calculating the free fall speeds and plotting them on a graph. This part is similar to the project. An engineer has derived a relationship between the force applied to a material and the extension in length that the force would cause. The relationship between force f and extension e is given by: 5.5f e = { 551 1 fa10f+55 if 0 ≤ f ≤ 10 if 10 <f≤ 20 You are asked to plot a graph showing the relationship between force and extension. You are asked to complete the following tasks: Task 1 Write a Python function which returns the value of e for a given input f. Do not use literals (e.g. 5.5, 10) in the expressions for e in the function. Instead you should define constants and use them. Note that the relationship between e and f depends on whether f is bigger than 10 or not, this means you need a certain Python construction in your function. If you can't think of that, have a look at Part A of Lab03.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Function Arguments
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning