Math 152 Lab 9 Use MATLAB to solve each problem. Some of the commands you may ne
ID: 3703173 • Letter: M
Question
Math 152 Lab 9 Use MATLAB to solve each problem. Some of the commands you may need on this assignment are: syms, int, symsum, solve, and double. The Remainder Estimate for the Integral Test says that for a convergent series ? an, the remainder or error), in using sn to approximate the sum of the series is denoted Rn and can be estimated by the integral below where f(n)-an and f is continuous, positive, and decreasing. I. (3 points) Consider the series ?- rt (a) Use the Integral Test to show that this series converges. (You do not need to show that f is continous, positive, and decreasing for the purposes of this lab.) (b) Find si0 (c) Use the Remainder Estimate for the Integral Test to find an estimate on the remainder in using sio to approximate the sum of the series, i.e. find an estimate for Rio (d) Find the sum of the series s (e) Find the exact remainder in using s10 to approximate the sum of the series. (f) By how much do the remainder estimate and the exact remainder differ? (g) Find a general formula for Rn (h) Determine the smallest value of n for which Rn0.00001 2. (3 points) Repeat all parts of Question 1 with the seriesn n=1 3. (4 points) Repeat all parts of Question 1 with the seriesExplanation / Answer
Function File-
function cxt=c(x,t,c0,k,L)
cxt=0;
for n=1:100
cxt=cxt+(4*c0./(n.*t)).*sin(pi*n.*x/L).*exp(-n.^2*pi^2*k.*t/(L^2));
end
cxt=c0-cxt;
end
Script File-
clc
clear
close all;
c0=0.3;
k=0.5;
L=0.7;
cxt=@(x,t) c(x,t,c0,k,L);
x=linspace(0,5,10);
t=linspace(0,1,10);
[X,T]=meshgrid(x,t);
cfcn=cxt(X,T);
?
meshc(X,T,cfcn)
grid on
xlabel('X')
ylabel('T')
zlabel('C(X,T)')