1 / 17

Mathematical Modeling

Mathematical Modeling. Heat Exchange. 7. 이안준 , 이정훈 , 이지훈. Preliminary. What is a heat exchange ?. Problems. 1. Newton’s Law of Cooling. 2. Stefan’s Law of Radiation. Summary. Preliminary. What is heat exchange ?. Preliminary. 1. Newton’s Law of Cooling.

raiden
Download Presentation

Mathematical Modeling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mathematical Modeling Heat Exchange 7. 이안준, 이정훈, 이지훈

  2. Preliminary What is a heat exchange ? • Problems 1. Newton’s Law of Cooling 2. Stefan’s Law of Radiation • Summary

  3. Preliminary What is heat exchange ?

  4. Preliminary 1. Newton’s Law of Cooling 2. Stefan’s Law of Radiation

  5. Codes of Improved Euler’s method function z=z(n,t0,t1,y0) h=(t1-t0)/n; t(1)=t0; z(1)=y0; fori=1:n t(i+1)=t(i)+h; z(i+1)=z(i)+(h/2)*(nlc(t(i),z(i))+nlc(t(i),z(i)+h*nlc(t(i),z(i)))); end; IE=[t',z']; plot(t,z); title('Newtons Law of Cooling'); n=1; e=1; tol=0.0001; U=ones(50,50); while e>=tol ans=ieuler(n,0,1,100); U(1:n+1,n+1)=ans'; e=abs(U(n+1,n+1)-U(n,n)); n=n+1; end function y=nlc(t,x) y=70-x; n=1; e=1; tol=0.0001; U=ones(50,50); while e>=tol ans=ieuler(n,0,2,100); U(1:n+1,n+1)=ans'; e=abs(U(n+1,n+1)-U(n,n)); n=n+1; end

  6. Codes of fourth order Runge-Kutta method function y=rk4(n,x0,x1,y0) h=(x1-x0)/n; x(1)=x0; y(1)=y0; fori=1:n x(i+1) = x(i) + h; k1 = h*f(x(i),y(i)); k2 = h*f(x(i)+h/2, y(i)+k1/2); k3 = h*f(x(i)+h/2, y(i)+k2/2); k4 = h*f(x(i)+h, y(i)+k3); y(i+1) = y(i) + (k1+2*k2+2*k3+k4)/6; end RK=[x', y']; plot(x,y); functionf=f(x,y) f=70-y; n=1; e=1; tol=0.0001; U=ones(50,50); while e>=tol ans=rk4(n,0,1,100); U(1:n+1,n+1)=ans'; e=abs(U(n+1,n+1)-U(n,n)); n=n+1; end n=1; e=1; tol=0.0001; U=ones(50,50); while e>=tol ans=rk4(n,0,2,100); U(1:n+1,n+1)=ans'; e=abs(U(n+1,n+1)-U(n,n)); n=n+1; end

  7. Results of Problem1

  8. Comparison with function built in Matlab

  9. Summary of Problem1

  10. Codes of Improved Euler’s method function z=z(n,t0,t1,y0) h=(t1-t0)/n; t(1)=t0; z(1)=y0; fori=1:n t(i+1)=t(i)+h; z(i+1)=z(i)+(h/2)*(nlc(t(i),z(i))+nlc(t(i),z(i)+h*nlc(t(i),z(i)))); end; IE=[t',z']; plot(t,z); title('Newtons Law of Cooling'); n=1; e=1; tol=0.0001; U=ones(50,50); while e>=tol ans=ieuler(n,0,1,100); U(1:n+1,n+1)=ans'; e=abs(U(n+1,n+1)-U(n,n)); n=n+1; end function y=nlc(t,x) y=(40^(-4))*(70^(4)-x^(4)); n=1; e=1; tol=0.0001; U=ones(50,50); while e>=tol ans=ieuler(n,0,2,100); U(1:n+1,n+1)=ans'; e=abs(U(n+1,n+1)-U(n,n)); n=n+1; end

  11. Codes of fourth order Runge-Kutta method function y=rk4(n,x0,x1,y0) h=(x1-x0)/n; x(1)=x0; y(1)=y0; fori=1:n x(i+1) = x(i) + h; k1 = h*f(x(i),y(i)); k2 = h*f(x(i)+h/2, y(i)+k1/2); k3 = h*f(x(i)+h/2, y(i)+k2/2); k4 = h*f(x(i)+h, y(i)+k3); y(i+1) = y(i) + (k1+2*k2+2*k3+k4)/6; end RK=[x', y']; plot(x,y); functionf=f(x,y) f=(40^(-4))*(70^(4)-y^(4)); n=1; e=1; tol=0.0001; U=ones(50,50); while e>=tol ans=ieuler(n,0,1,100); U(1:n+1,n+1)=ans'; e=abs(U(n+1,n+1)-U(n,n)); n=n+1; end n=1; e=1; tol=0.0001; U=ones(50,50); while e>=tol ans=ieuler(n,0,2,100); U(1:n+1,n+1)=ans'; e=abs(U(n+1,n+1)-U(n,n)); n=n+1; end

  12. Results of Problem2

  13. Comparison with function built in Matlab

  14. Summary of Problem2

  15. Q & A

More Related