A Nonlinear Problem - Radiation :

Heat loss through radiation is a loss proportional to the absolute temperature to the fourth power (Stefan's Law). This adds to the loss by convection and gives the following boundary condition: $$\kappa{\partial u\over \partial n} +\alpha(u-u_e) + c[(u + 273)^4 - (u_e+273)^4] = 0$$

The problem is nonlinear, and must be solved iteratively. If $$m$$ denotes the iteration index, a semi-linearization of the radiation condition gives $${\partial u^{m+1}\over \partial n} + \alpha(u^{m+1}-u_e)+ c(u^{m+1}-u_e) (u^m+u_e +546) ((u^m + 273)^2 + (u_e+273)^2) = 0,$$ because we have the identity $$a^4 - b^4 = (a-b)(a+b)(a^2+b^2)$$. The iterative process will work with $$v=u-u_e$$.

 ...
fespace Vh(Th,P1);  //  finite element space
real rad=1e-8, uek=ue+273; // def of the physical constants
Vh vold,w,v=u0-ue,b;