# Thermal numerical method：Improved Euler method

The idea of Euler method is to use an approximation yn stands for the real y(xn) and then use the inverse multiply  a step to calculate the yn+1. When we use a small step ‘h’, we will gain a curve similar to the real line. For more accurate, we improve the Euler method and it let us calculate with less works.

We first use the Euler method to get a yn+1 in the Improved Euler method. Then we use another method to amend the yn+1 to let it more similar to the real yn+1.

We express this new Improved Euler method by these two formulas:

yn+1yn + hf (xn , yn )
yn+1 = yn + h*[f (xn , yn )+f (xn+1yn+1 )]/2

When use computer for calculation in some engineering field, you should show the relationship between ‘y’ and ‘x’. You need also give a ‘h’.

## A example to use Improved Euler method for solving heat transfer problem:(Use Matlab)

```function [x,y]=eulerg(x,y,h,N) x=zeros(1,N+1); y=zeros(1,N+1); x(1)=0; y(1)=293; for n=1:N x(n+1)=x(n)+h; ybar=y(n)+h*dyfun(x(n),y(n)); y(n+1)=y(n)+(h/2)*(dyfun(x(n),y(n))+dyfun(x(n),ybar)); end plot(x,y,'red'); function m=dyfun(x,y) m=1/304+75/19*(1773-y)+(6.804e-8)/304*(1773^4-y^4);```