Answer to Question #181569 in MatLAB for Iqra Akhtar

Question #181569

compute Reimann sum of the function f(x)=e^(-x^2) for n=4 and n=10 by choosing ck at the right end of the point of the interval [0,2]


1
Expert's answer
2021-04-14T22:42:28-0400
%%
% Equations to solve the equations
% eqn1 at Node V1: (5/2)V1-V2+0V3-V4=-5
% eqn2 at node V2: -V1+(7/4)V2-(1/4)V3+0V4=0
% eqn3 at node V3: 0V1-(1/4)V2+(5/4)V3-V4=6
% eqn4 at node V4: -V1+0V2-V3+(7/3)V4=2
% from the above equations we can form a matrix equation as AV=B, where

A=[5/2 -1 0 -1; -1 7/4 -1/4 0; 0 -1/4 5/4 -1; -1 0 -1 7/3];
B=[-5;0;6;2];
% V=[V1;V2;V3;V4];
V=A^(-1)*B;
%Ans: V = [0.77844; 1.7725; 9.2934; 5.1737]
%
% if S is included
% syms S
% A=[5/2 -1 0 -1; -1 7/4 -1/4 0; 0 -1/4 5/4 -1; -1 0 -1 7/3];
% B=[-5*S;0;6*S;2*S];
% % V=[V1;V2;V3;V4];
% V=A^(-1)*B;
% %Ans: V = [(130*S)/167; (296*S)/167; (1552*S)/167; (864*S)/167]

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS