Section 1 consists of basic concepts, and can be done either with a numerical co
ID: 2087448 • Letter: S
Question
Section 1 consists of basic concepts, and can be done either with a numerical code or by hand (where "by hand" means with a normal calculator). For sections 2-4, the goal is to solve the following problems using the numerical schemes outlined during class. For each problem, you should submit the code from your program as well as the output. Note that you are not allowed to use any built-in Matlab programs (i.e. ODE45) for this project (unless you want to use them to check your own code). Also I don't expect to see the same code from two different people! Section 3: Integration 8) Evaluate the following integral using either the rectangular or trapezoidal rule. Do this first with = 0.1, then 0.01, and finally 0.001. 1 sin x dxExplanation / Answer
CODE:
clc;
clear all;
close all;
a=0;b=1;
h=0.1; %according to value given in question
y=0;
P=0 %sin 0/0= UNDEFINED
Q=sin(b)/b;
for i=a+h:h:b-h
y=y+sin(i)/i;
end
ans=(h/2)*(P+Q+2*(y))
OUTPUT
FOR h=0.1, ans= 0.8958
FOR h=0.01, ans=0.9411
FOR h=0.001, ans=0.9456
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.