Docsity

Solving Stefan's Law of Cooling using Euler-Trapezoid Method for Differential Equations - , Study notes of Mathematics

Partial preview of the text

Download Solving Stefan's Law of Cooling using Euler-Trapezoid Method for Differential Equations - and more Study notes Mathematics in PDF only on Docsity!

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

(uk+1^ -uk)/h = c(usur - uk).

Solve for uk+1^ to get

uk+1^ =(1 - hc)uk^ + husurc.

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, lesson number clear; % %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 m=1:maxm newu = u(k) + h.5(oldfeuls + feuls(t(k+1),oldu)); if abs(newu-oldu)<eps break; end oldu = newu; end u(k+1) = newu; end*

Numerical Experiments.

The following system for two functions has known

solutions

y 1 (t) = exp(-4t) and y 2 (t) = exp(-t).

y 1 ' = -10004 y 1 + 10000 y 24

y 2 ' = y 1 - y 2 - y 24.

Matlab Solvers ode45, ode23s and Others.

One can use either Matlab’s

odedemo (buiode), or

ypcstiff.m and cstiff.m files.