Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write this code in MATALA AND PLEASE READ THE QUESTION FIRST AND THEN ANSWER... 2) Numerical Integration For each problem below, save 9 solutions.
Please write this code in MATALA AND PLEASE READ THE QUESTION FIRST AND THEN ANSWER...
2) Numerical Integration For each problem below, save 9 solutions. You will first save the trapezoid rule with 1 subinterval, then 5 subintervals, then 50 subintervals. Repeat the calculation using Simpson's rule instead. Then, finally, use Simpson's 3/8ths rule. a) Calculate 5,5 sin(x) dx. Save result on HW6_9.dat - HW6_17.dat b) Use the hitTheSpot function from Homework 3! Using 0 = 30, integrate from Vo = 10 m/s to 100 m/s. Save results on HW6_18 HW6_26.dat c) Calculate S" sin(x) dx. Instead of saving the value of your numerical calculation of the integral, instead save the difference between your calculation and the true value. Calculate True value minus numerical value for all 9 submissions. Save on HW6_27.dat - HW6_35.dat d) For this calculation, you will save only a single result. If f'(x) = sin(x) ?, and f(1) = 5, Save f(x) for x vector between x e [1,10], Ax = 0.2. For each subinterval (eg. x = [1,1.2]), use Simpson's 3/8ths rule. Save the resulting f(x) vector on HW6_36.dat. Plot f(x) and f'(x) on the same figure window. This problem is primarily testing your knowledge of the fundamental theorem of calculus. Center difference schemes 0 (Ax2) Yi+1 Yi-1 2Ax y' = Yi-1 2yi + Yi+1 Ax2 Forward and backward difference schemes 0(4x2) y -3yi + 4yi+1 Yi+2 2Ax 3yi - 4yi-1 + yi-2 y1 = 2Ax 2y; 5yi+1 + 4yi+2 Yi+3 x2 y 2yi - 5yi-1 + 4yi-2 - Yi-3 Ax2 Center difference Schemes 0(4x4) Yi-2 8yi-1 + 8yi+1 Yi+2 12Ax -Yi-2 + 16yi-1 - 30yi + 16Yi+1 Yi+2 yi' = 124x2 2) Numerical Integration For each problem below, save 9 solutions. You will first save the trapezoid rule with 1 subinterval, then 5 subintervals, then 50 subintervals. Repeat the calculation using Simpson's rule instead. Then, finally, use Simpson's 3/8ths rule. a) Calculate 5,5 sin(x) dx. Save result on HW6_9.dat - HW6_17.dat b) Use the hitTheSpot function from Homework 3! Using 0 = 30, integrate from Vo = 10 m/s to 100 m/s. Save results on HW6_18 HW6_26.dat c) Calculate S" sin(x) dx. Instead of saving the value of your numerical calculation of the integral, instead save the difference between your calculation and the true value. Calculate True value minus numerical value for all 9 submissions. Save on HW6_27.dat - HW6_35.dat d) For this calculation, you will save only a single result. If f'(x) = sin(x) ?, and f(1) = 5, Save f(x) for x vector between x e [1,10], Ax = 0.2. For each subinterval (eg. x = [1,1.2]), use Simpson's 3/8ths rule. Save the resulting f(x) vector on HW6_36.dat. Plot f(x) and f'(x) on the same figure window. This problem is primarily testing your knowledge of the fundamental theorem of calculus. Center difference schemes 0 (Ax2) Yi+1 Yi-1 2Ax y' = Yi-1 2yi + Yi+1 Ax2 Forward and backward difference schemes 0(4x2) y -3yi + 4yi+1 Yi+2 2Ax 3yi - 4yi-1 + yi-2 y1 = 2Ax 2y; 5yi+1 + 4yi+2 Yi+3 x2 y 2yi - 5yi-1 + 4yi-2 - Yi-3 Ax2 Center difference Schemes 0(4x4) Yi-2 8yi-1 + 8yi+1 Yi+2 12Ax -Yi-2 + 16yi-1 - 30yi + 16Yi+1 Yi+2 yi' = 124x2
Step 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