Professional Documents
Culture Documents
% Calculate The Entries of (A) and (B) For The Equation of The First Cell
% Calculate The Entries of (A) and (B) For The Equation of The First Cell
% Calculate The Entries of (A) and (B) For The Equation of The First Cell
b = zeros(N,1);
Phi = zeros(N,1);
Phi = A \ b;
q_base=2*gamma*Area/dx*(Phi(1,1)-PhiA)
x = [0:L/32000:L];
m = sqrt(h*P/gamma/Area);
exact = cosh(m*(L-x))/cosh(m*L)*(PhiA-
Phi_infinite)+Phi_infinite;
M = sqrt(h*P*gamma*Area*PhiA)
error = zeros(N,1);
for a=1:N
error(a) = abs((Phi(a)-exact(32000/N*a)) /
exact(32000/N*a)*100);
end
maximum = zeros(N,1);
max(error)
legend('FVM', 'Exact')