Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1: Write a script a6task1.py in which you export a function: def runTask1(): This function must create a figure that draws the following three

Task 1:

Write a script a6task1.py in which you export a function:

def runTask1():

This function must create a figure that draws the following three functions:

  1. y(x) = x sin(x) + 3 cos(x) - x
  2. y(x) = x (sin(x) - x cos(x))/5
  3. y(x) = (x3 - 2x2 + 5x - 25)/40

The curves must span a domain of x values from -6 to 6 and are to be generated from arrays of at least 150 points each. Draw curve 1 as a black line, curve 2 as a blue line and curve 3 as a red line. Label the x axis "x" and the y axis "y(x)". There is to be no title for the figure. The figure is to display a background grid. Resize the figure by including the following lines in your code:

from pylab import rcParams rcParams["figure.figsize"] = 6, 4

Note: you may need to run your script twice before this resizing takes effect.

The figure is to have a legend identifying the three curves by their formulae (given above). This legend is to be placed outside and to the right of the box of the figure. Vertically, the legend should be midway between top and bottom of the graph.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AutoCAD Database Connectivity

Authors: Scott McFarlane

1st Edition

0766816400, 978-0766816404

More Books

Students also viewed these Databases questions

Question

3. Are our bosses always right? If not, what should we do?

Answered: 1 week ago

Question

2. What, according to Sergey, was strange at this meeting?

Answered: 1 week ago