![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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
There's an error to this code when I run it in google collab
# objectives: 1) demonstrate numerical differentialtion,
# and 2) illustrate results graphically.
import numpy
import math
from numpy import arange, cos
import matplotlib.pyplot
from matplotlib.pyplot import *
# A general function for calculating the slope between two points: x and
# x+delta.
def der(x,delta):
delta = float(delta)
if delta < (0.0000001):
print ('Value chosen for delta is too small.')
return 1/delta
else:
slope = (f(x + delta) - f(x))/delta
return slope
# Define the function y=100e^(-0.0482t)
def f(x):
f = (100.0**(-0.0482*x))
return (f)
point = 2.0 #This is a point at which a derivative will be calculated.
# The following statements initialize variables for computation.
number = 510
increment =10
y = []
x = []
figure()
f=[3,-4,-12,0,2]
print ('\nFunction')
print (f)
print ('\nFirst Derivative')
g= f.deriv(m=1) # First derivative with m=1.
print (g)
print ('\nSecond Derivative')
q= f.deriv(m=2) # Second derivative with m=2.
print (q)
x=linspace(-2,3,101)
y=p(x)
yg=g(x) # These statements define points for plotting.
yq=q(x)
y0=0*x # This statement defines the y axis for plotting.
plot (x,y,label ='y=f(x)')
plot (x,yg,label ='First Derivative')
plot (x,yq,label ='Second Derivative')
legend(loc='best')
plot (x,y0)
xlabel('x-axis')
ylabel('y-axis')
title ('Plot Showing Function, First and Second Derivatives')
show()
![title ('Plot Showing Function, First and second Derivatives'
show()
File "kipython-input-8-4f8c3bed2442>", line 41
return (f)
SyntaxError: 'return' outside function
SEARCH STACK OVERFLOW](https://content.bartleby.com/qna-images/question/dbff33fd-8c85-4063-9fe9-f9a0ce75a461/d1d90d83-9893-42c8-9923-3796ca8d0b70/jbvb7au_thumbnail.png)
Transcribed Image Text:title ('Plot Showing Function, First and second Derivatives'
show()
File "kipython-input-8-4f8c3bed2442>", line 41
return (f)
SyntaxError: 'return' outside function
SEARCH STACK OVERFLOW
Expert Solution
![Check Mark](/static/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
![Blurred answer](/static/blurred-answer.jpg)
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
- 3. Write a program to obtain inverse matrix by entering a 3*3 matrix from the user.(using visual studio) output screen Enter the first line : 00 00 00 Enter the secon line : 00 00 00 Enter the third line : 00 00 00 entered matrix 00 00 00 00 00 00 00 00 00 inverse matrix is 00 00 00 00 00 00 00 00 00arrow_forwardGive an example of a while loop, then provide the equivalent do-while loop and for loop. Then give a different example of a do-while loop, along with the equivalent while loop and for loop. Finally, give an example of a for loop, along with the equivalent while loop and do-while loop. Use your examples to illustrate the advantages and disadvantages of each looping structure, and describe those advantages and disadvantages.arrow_forwardUSE PYTHON THANK YOUarrow_forward
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
![Text book image](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
![Text book image](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education