function diff = HeatConductionForNLsolve(nmax,udes,t)
% temperature at x=50cm
u = 10;
for n = 1:nmax
    u = u + (800/n^2/pi^2*sin(n*pi/2)-40/n/pi)*exp(-1.14*n^2*pi^2/100^2*t)*sin(n*pi/2);
end

diff = u-udes;