Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please and thank you in advance. I will not just copy code, I need basic, beggin

ID: 3703481 • Letter: P

Question

Please and thank you in advance. I will not just copy code, I need basic, begginers level code to study so I can write my own up. I am struggling so badly in this course and Chegg is my last hope. If Chegg could answer number one, and will study that and rewrite my own for number one and do two on my own. Thank you! The language is Python!

.4 5% O 5:00 PM Homework#7, 2018-458373621 MET 3220 Due t 10:00 AM, Monday, April 8, 2018. Homework Submission Method email to TA Ruikai Yan, yanfsu.edu, and carbon copy to Homework #7 Instructor Zhaobua Wu, zwu@fsu.cdu. Note: (I) Since this is a computational class, any later submission after the due time will result in zero point for this homework assignment: and (2) copying codes and results from fellow students will be considered as cheating and will result in zero points of the homework and other potential consequences. Homework Problems: 1. Integration by midpoint rule: The idea of the Midpoint rule for integration is to divide the area under a curve x) inton equal-sized rectangles. The height of the rectangle is determined by the value of fat the midpoint of the rectangle. The figure below illustrates the idea, Zg????? To implement the midpoint rule, one has to compute the area of each rectangle, sum them up, just as in the formula for the Midpoint rule, sstih 0.5h) where h (b-avn is the width of each rectangle. Implement this formula and test the integrator with the following example input mathematical functions: (I) sx)-ex), for integration range (0, In3)]: and (2) f,(x)-sin(x), for integration range [O

Explanation / Answer

The implementation of both the parts are given below as function named AreaUnderCurve part1 and part2.

----------------------------------------------------------------------------------------------------------------------------------------

import numpy as np

def AreaUnderCurve_part1(a, b, n):
   area = 0.0
   h = (b-a)/float(n)
   f = np.exp
   for i in range(n):
       area += h*(f(a + i*h + 0.5*h))
   return area

def AreaUnderCurve_part2(a, b, n):
   area = 0.0
   h = (b-a)/float(n)
   f = np.sin
   for i in range(n):
       area += h*(f(a + i*h + 0.5*h))
   return area


if __name__=='__main__':
   print("for exponential", AreaUnderCurve_part1(1, 6, 10))
   print("for sinusoidal", AreaUnderCurve_part2(1, 6, 10))

----------------------------------------------------------------------------------------------------------------------------------------

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote