I need help developing a MATLAB code to solve the above triadiagonal system for
ID: 3632941 • Letter: I
Question
I need help developing a MATLAB code to solve the above triadiagonal system for temperature distribution along the rod for given conditions (i.e., given L, Ta, Tb, and h'). The code should be workable for any total number of nodes.
The code must perform the following
For the given thermal conditions, investigate the effect of the node number (n) one calculated temperatures with using your code.
Investigate the effect of h' and n on the calculated nodal temperature with using your code. Plots should be made to illustrate the results.
This is the starting code
function x = Tridiag (e,f,g,r)
%
% x= Tridiag (e,f,g,r(
% Input:
% e= subdiagonal vector
% f= diagonal vector
% g= superdiagonal vector
% r= right hand side vector
% Output:
%x= solution vector
n=lnegth(f);
%forward elimination
for k= 2:n
factor = e(k)/f(k-1);
f(k) = f(k) - factor *g(k-1);
r(k) = r(k)- factor * r(k-1);
end
% back sub
x(n) = r(n)/f(n);
for k = n-1: -1:1
x (k) = (r(k)-g(k)*x(k+1))/f(k);
end
Need advise!
Explanation / Answer
see this links. http://esr.lib.ttu.edu/bitstream/handle/2346/12428/31295019031086.pdf?sequence=1 http://www.math.umd.edu/undergraduate/schol/matlab/pde.html http://www.cs.bc.edu/~straubin/scicomp_2011/Assignment_4.html thx
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.