Question: Assignment 9 - Integration For this assignment, you will be computing magnetic fields using the following integral, B = - L 2 L 2 [

Assignment 9- Integration
For this assignment, you will be computing magnetic fields using the following integral,
B=-L2L2[0Ia4dx(a2+x2)32]
where a represents the distance away from a wire and L represents the length of the wire, and 0=1.25710-6Teslam2A(the permeability of free space). For all of your computations, let I=1.5Amps,L=10cm, and a=3cm. For all of your computations, report the magnetic field in units of microteslas (T).(Be sure to pay attention to all of the units!)
Use sympy to calculate this integral analytically and to determine the value of B. Measure the computation time for the sympy calculation.
Use the quad function to calculate this integral numerically to determine the value of B. Discuss the size of the numerical error for this computation. Measure the computation time for the quad calculation.
Create a function that works just like the quad function, but takes an extra input parameter "N" and computes the integral using a Riemann sum of N rectangles. Use your function to compute the integral for different values of N. For each of the different values of N, report both the result of the integral and the computation time. Discuss these results. Specifically, discuss how the results of the three different methods (sympy, quad, and Riemann sum) compare to each other in terms of both the accuracy of the computation and the computation time.
Assignment 9 - Integration For this assignment,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!