Please help Show full working NOTE a significant amount of c
Please help. Show full working. NOTE: a significant amount of context information at the start. The actual task involves writing a function that generates vectors/matrices, solves the matrix system provided, and then plots the result. Thank you.
A thin wire with a uniform cross-section will radiate heat from its sides according to Newtonian Cooling - that is, the rate of loss of heat is proportional to the difference in temperature between the object and its surroundings. If the temperature at every point in the wire remains constant, then it satisfies the second-order ODE lt where k is the thermal diffusivity, h is the thermal conductivity of the interface be- tween the object and the environment, and Te is the temperature of the environ- ment. We can approximate the second derivative using a \"central difference formula\": dx2 If we apply this to a series of points in the wire, we can write down a series of equations of the form 2 Suppose that we require that T(0) - 0 and T(1) - 0. That is, the temperature at both ends is held at 0°C. We can let d-1 and this allows us to write down the matrix equation hTe hTe a b 0 0 2 0 b a b 3 hTe N-3 hTe N-2 where a = + 2k 2 and b = _KN2 Your task is to write a MATLAB function that will do the following: » Take in N, k, h, and Te as input variables, » Generate the relevant matrices and/or vectors (see below), . Solve the system (using chosen approach, see below), and . Plot the resulting solution T against position aSolution
The asker is suggested to use appropriate values for the constants such as thermal conductivity an diffusivity in the program given below:
----------------------------------------------------------------------------------------------------------------------------------------------------------
clc;
clear all;
close all;
N=input(\' number of points required \');
d=1/N; % defining d
h=1.172*10^-5; % defining thermal conductivity
k=50.2;
T_e=50;
a=h+2*k*N^2;
b=-k*N^2;
B=zeros(1,N-1);
T=zeros(1,N-1);
A=zeros(N-1,N-1);
for i=1:N-1;
B(i)=h*T_e;
l(i)=((i)/N);
end
for i=1:N-1;
for j=1:N-1;
if(i==j)
A(i,j)=a;
elseif (i==j-1)
A(i,j)=b;
elseif(j==i-1)
A(i,j)=b;
else
A(i,j)=0;
end
end
end
X=A/B;
plot(l,X)
-------------------------------------------------------------------------------------------------------------------------------------------------------

