Answered step by step
Verified Expert Solution
Question
1 Approved Answer
fortran code pls help.! Purpose: The purpose of this assignment is to code Simpson's Rule as a Fortran code and to gain some experience with
fortran code pls help.!
Purpose: The purpose of this assignment is to code Simpson's Rule as a Fortran code and to gain some experience with carrying out convergence tests Your goal: Write a Fortran program that implements Simpson's Rule as a Fortran program to evaluate the following definite integral: 120[(x+cos(x))ecos(x)+aec(xb)2]dx where a=4000,b=15.15, and c=0.01. Carry out a convergence test and in the header block comments create a table which displays the value of the integral as a function the number of subintervals used. Clearly indicate in the comments what you think is the most accurate value of the integral and WHY you think it is the most accurate. Your code should prompt the user to enter the number of subintervals and should output the value of the integral to STDOUT. Hints: I suggest that you create this program in stages as follows: 1. Get a midpoint rule program running and verify that the program is working correctly by testing it on an integrand where the result is known analytically. Do a convergence test to see how the solution to the verification test converges. Save this version of the code. 2. Modify your midpoint rule code from step 1 to implement the trapezoidal rule. Do verification and convergence tests on this code. Save this version of the code also. 3. Modify your trapezoidal rule code from step 2 to implement Simpson's Rule. Verify that it is working on a problem with a known answer. Do the verification \& convergence tests. Save this version of the code. 4. Finally, modify your Simpson's Rule code from step 3 to use the integrand specified above. Carry out a convergence test to answer the questions posed above. Don't try to take shortcuts to create the final program! It has been my experience that students who try to skip skip steps 1-3 often encounter significant difficulties in this exercise. Therefore I am instructing the TA's to refuse to provide you with help on each step unless you can demonstrate that you got the program from the previous step working correctly! Note: Make sure that your submission conforms to the Instructions for Source Code Submission instructions and that you have followed all of the Good Programming Tips in the notesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started