$ \theta(0) = (T_0 - T_a) \hspace{1cm} \theta(L) = (T_L - T_a) \\
\theta(0) = 500^\circ C \hspace{1cm} \theta(L) = 200^\circ C $
Governing differential equation,
$ kA. \frac{d^2 \theta}{dx^2} - h_p \theta = 0 \hspace{0.5cm} $ where $ \theta = T_x - T_a $
i.e. $ \frac{d^2 \theta}{dx^2} - m^2 \theta = 0 \hspace{0.5cm} $ where $ m^2 = \frac{h_i}{kA} $
General governing element in local co-ordinate
Let, $ x = \bar{x} + x_A \\
\therefore dx = d \bar{x} \\
\therefore \frac{d \theta}{dx} = \frac{d \theta}{d \bar{x}} \implies \frac{d^2 \theta}{dx^2} = \frac{d^2 \theta}{d (\bar{x})^2} $
Local boundary condition
$ Q_1^e = -kA \frac{d \theta}{dx} \\
Q_2^e = kA \frac{d \theta}{dx} $
$ \therefore $ The general governing equation in local co-ordinate written as:
$ \frac{d^2 \theta}{d (\bar{x})^2} - m^2 \theta = 0 $
with local boundary condition
$ \frac{d \theta}{d \bar{x}}|_{\bar{x} = 0} = - \frac{Q_1}{kA} \\
\frac{d \theta}{d \bar{x}}|_{\bar{x} = h_e} = \frac{Q_2}{kA} $
Residue,
$ \frac{d^2 \theta}{d (\bar{x})^2} - m^2 \theta = R $
Weighted Integral Form
$ \int_0^1 w_iR \,\, dx = 0 \\
\int_0^{h_e} w_i (\frac{d^2 \theta}{d (\bar{x})^2} - m^2 \theta) \,\, d \bar{x} = 0 $
Weak Formulation
$ \int_0^{h_e} w_i [\frac{d^2 \theta}{d (\bar{x})^2} - m^2 \theta] \,\, d \bar{x} = 0 \\
\int_0^{h_e} w_i \frac{d^2 \theta}{d (\bar{x})^2} \,\, d \bar{x} - \int_0^{h_e} w_i m^2 \theta \,\, d \bar{x} = 0 \\
[w_i \frac{d \theta}{d \bar{x}}]_0^{h_e} - \int_0^{h_e} \frac{dw_i}{d \bar{x}} \frac{d \theta}{d \bar{x}} \,\, d \bar{x} - \int_0^{h_e} w_im^2 \theta \,\, d \bar{x} = 0 \\
[w_i]_{h_e}[\frac{d \theta}{dx}]_{h_e} - [w_i]_0[\frac{d \theta}{dx}]_0 - \int_0^{h_e} \frac{dw_i}{d \bar{x}} \frac{d \theta}{d \bar{x}} \,\, d \bar{x} - \int_0^{h_e} w_im^2 \theta \,\, d \bar{x} = 0 \hspace{0.25cm}...(1) $
Approximate solution
$ \theta = \theta_1 \phi_1 + \theta_2 \phi_2 $
where, $ \phi_1 = 1- \frac{\bar{x}}{h_e} \hspace{1cm} \phi_2 = \frac{\bar{x}}{h_e} \\
\frac{d \phi_1}{d \bar{x}} = - \frac{1}{h_e} \hspace{1cm} \frac{d \phi_2}{d \bar{x}} = \frac{1}{h_e} $
Rayleigh Ritz method, $ w_i = \phi_i $
Rewriting equation (1)
$ [\phi_i]_{h_e}[\frac{d \theta}{dx}]_{h_e} - [\phi_i]_{0}[\frac{d \theta}{dx}]_{0} - \int_0^{h_e} \frac{d \phi_i}{d \bar{x}} \frac{d \theta}{d \bar{x}} \,\, d \bar{x} - \int_0^{h_e} \phi_i m^2 \theta \,\, d \bar{x} = 0 \hspace{0.25cm} ...(A) $
For i = 1, $ \phi_i = \phi_1 = 1 - \frac{\bar{x}}{h_e} $
Substituting in equation (A)
$ 0 - [- \frac{Q_1}{kA}] - \int_0^{h_e} (- \frac{1}{h_e}). \frac{d}{d \bar{x}} [\sum_{j=1}^{2} \theta_j \phi_j] \,\, d \bar{x} - \int_0^{h_e} (1 - \frac{\bar{x}}{h_e})m^2 \sum_{j=1}^2 \theta_j \phi_j \,\, d \bar{x} = 0 $
Re-arranging the terms, we get,
$ - \frac{1}{h_e} \int_0^{h_e} \sum_{j=1}^{2} \theta_j \frac{d \phi_j}{d \bar{x}} \,\, d \bar{x} + m^2 \int_0^{h_e} \sum_{j=1}^{2} \theta_j (1 - \frac{ \bar{x}}{h_e}) \phi_j \,\, d \bar{x} = \frac{Q_1}{kA} $
Successively solving for j = 1 and j = 2, we get
$ - \frac{1}{h_e} [\int_0^{h_e} \theta_1 (\frac{-1}{h_e}) + \theta_2 (\frac{1}{h_e}) \,\, d \bar{x}] + m^2[\theta_1 (1 - \frac{\bar{x}}{h_e})^2 + \theta_2 (1 - \frac{\bar{x}}{h_e}) \frac{\bar{x}}{h_e} \,\, d \bar{x}] = \frac{Q_1}{kA} \\
\implies \frac{1}{h_e}[\theta_1 - \theta_2] + m^2[\frac{- \theta_1}{3} (1 - \frac{\bar{x}}{h_e})^3 h_e + \theta_2(\frac{(\bar{x})^2}{2h_e} - \frac{(\bar{x})^3}{3(h_e)^2})]_0^{h_e} = \frac{Q_1}{kA} \\
\implies \frac{1}{h_e}[\theta_1 - \theta_2] + m^2[\theta_1 \frac{h_e}{3} + \theta_2 \frac{h_e}{6}] = \frac{Q_1}{kA} $
For i = 2 $ \phi_i = \phi_2 = \frac{\bar{x}}{h_e} $
Substituting in equation (A),
$ \frac{Q_2}{kA} - \int_0^{h_e} \frac{1}{h_e}. \frac{d}{d \bar{x}} [\sum_{j=1}^{2} \theta_j \phi_j] \,\, d \bar{x} - \int_0^{h_e} (\frac{\bar{x}}{h_e})m^2 \sum_{j=1}^2 \theta_j \phi_j \,\, d \bar{x} = 0 $
Rearranging the terms
$ \frac{1}{h_e} \int_0^{h_e} \sum_{j=1}^{2} \theta_j \frac{d \phi_j}{d \bar{x}} \,\, d \bar{x} + m^2 \int_0^{h_e} \sum_{j=1}^{2} \theta_j \frac{ \bar{x}}{h_e} \phi_j \,\, d \bar{x} = \frac{Q_2}{kA} \hspace{0.25cm} ... (i) $
Solving for j = 1 and j = 2, we get
$ \frac{1}{h_e} \int_0^{h_e} [\theta_1 (\frac{-1}{h_e}) + \theta_2 (\frac{1}{h_e})] \,\, d \bar{x} + m^2[\int_0^{h_e} [\theta_1 \frac{\bar{x}}{h_e}(1 - \frac{\bar{x}}{h_e}) + \theta_2(\frac{\bar{x}}{h_e})^2 \,\, d \bar{x}]] = \frac{Q_2}{kA} \\
\implies \frac{1}{h_e}[- \theta_1 + \theta_2] + m^2[\theta_1 \frac{h_e}{6} + \theta_2 \frac{h_e}{3}] = \frac{\theta_2}{kA} \hspace{0.25cm} ...(ii)$
Writing equation(i) and (ii) in matrix form, we get,
$$
\begin{Bmatrix}
\frac{kA}{h_e} \begin{bmatrix}
1 & -1 \\
-1 & 1
\end{bmatrix} + \frac{kAm^2h_e}{6} \begin{bmatrix}
2 & 1 \\
1 & 2
\end{bmatrix}
\end{Bmatrix}
\begin{Bmatrix}
\theta_1 \\
\theta_2
\end{Bmatrix}
=
\begin{Bmatrix}
\theta_1 \\
\theta_2
\end{Bmatrix}
$$
Element matrix equation for each element taking two linear elements of equal size
Now, $ h_e = \frac{L}{2} = \frac{60}{2} = 30mm = 0.03m \\
A = \frac{\pi}{4}D^2 = \frac{\pi}{4} \times (0.02)^2 = 0.000314 m^2 $
k = 100 W/m $^\circ$ C; h = 25 W/m $^\circ$ C
$ m^2 = \frac{hP}{kA} = \frac{h \times \pi \times D}{k \times \pi/4 \times D^2} = \frac{4h}{kD} = \frac{4 \times 25}{100 \times 0.02} = 50 $
$ \frac{kA}{h_e} = \frac{100 \times 0.000314}{0.03} = 1.047 $
$ \frac{kAm^2h_e}{6} = \frac{100 \times 0.000314 \times 50 \times 0.03}{6} = 0.00735 $
Element matrix for both the elements
$$
\begin{Bmatrix}
1.047 \begin{bmatrix}
1 & -1 \\
-1 & 1
\end{bmatrix}+
0.00785 \begin{bmatrix}
2 & 1 \\
1 & 2
\end{bmatrix}
\end{Bmatrix}
\begin{Bmatrix}
\theta_1 \\
\theta_2
\end{Bmatrix}
=
\begin{Bmatrix}
\theta_1 \\
\theta_2
\end{Bmatrix}
$$
$$
\begin{bmatrix}
1.0627 & -1.0313 \\
-1.0313 & 1.0627
\end{bmatrix}
\begin{Bmatrix}
\theta_1 \\
\theta_2
\end{Bmatrix}
=
\begin{Bmatrix}
\theta_1 \\
\theta_2
\end{Bmatrix}
$$
Global matrix equation
$$
\begin{bmatrix}
1.0627 & -1.0313 & 0 \\
-1.0313 & 2.1254 & -1.0313 \\
0 & -1.0313 & 1.0627
\end{bmatrix}
\begin{Bmatrix}
\theta_1 \\
\theta_2 \\
\theta_3
\end{Bmatrix}
=
\begin{Bmatrix}
Q_1 \\
Q_2 \\
Q_3
\end{Bmatrix}
$$
Imposing boundary condition,
$ \theta(0) = \theta_1 = 500^\circ C \hspace{0.5cm} \theta(C) = \theta_3 = 200^\circ C $
For balancing take Q$_2$ = 0
Global matrix equation becomes
$$
\begin{bmatrix}
1.0627 & -1.0313 & 0 \\
-1.0313 & 2.1254 & -1.0313 \\
0 & -1.0313 & 1.0627
\end{bmatrix}
\begin{Bmatrix}
500 \\
\theta_2 \\
200
\end{Bmatrix}
=
\begin{Bmatrix}
Q_1 \\
0 \\
Q_3
\end{Bmatrix}
$$
Solving above matrix,
-1.0313 x 500 + 2.1254 x $\theta_2$ - 1.0313 x 200 = 0
$ \theta_2 = 339.65^\circ C $ at x = 3cm
Now,
1.0627 x 500 - 1.0313 x 339.65 = Q$_1$
Q$_1$ = 181.06 watts (Rate of heat input)