



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Differential Equation Model. Stefan's law of cooling for a glowing hot mass ut =c(usur 4 - u 4 ). For large values of u this will be a stiff differential equation.
Method of Solution. Euler's method for Newton law of cooling is (u k+1^ -u k)/h = c(usur - u k^ ). Solve for u k+1^ to get uk+1^ =(1 - hc)uk^ + husur c. Need 1- ch > 0.
Matlab Implementation of Euler-trapezoid. function feuls = feuls(t,x) feuls = .6941(1 - (x/273)^4); %your name, your student number, clear;lesson number % %Euler-Trapezoid Algorithm with Picard Solver. % eps = .0001; maxm = 10; u(1) = 973.; T = 100; KK = 40 h = T/KK; t(1)= 0.;*
% %Begin Time Loop , % for k = 1:KK oldfeuls = feuls(t(k),u(k)); oldu = u(k) + holdfeuls; t(k+1) = t(k) + h; % %Begin Picard Loop. % for* (^) newu = u(k) + h.5(oldfeuls +m=1:maxm if abs(newu-oldu)<epsfeuls(t(k+1),oldu)); break; end oldu = newu; end u(k+1) = newu; end plot(t,u) title('your name, your student**
xlabel('time')number, lesson number') ylabel('temperature')
Matlab Solvers ode45, ode23s and ode15s. One can use either Matlab’s odedemo (buiode), or ypcstiff.m and cstiff.m files.