还剩1页未读,继续阅读
文本内容:
求解热传导问题的几个例子matlab.金属板导热问题1・1例
3.21】热传导方程金属板的导热问题,考虑一个带有矩形孔的金属板上的热传导问题板的左边保持在100霓,板的右边热量从板向环境空气定常流动,其他边及内孔边界保持绝缘°初始S时板的温度为0cC,于是概括为如下定解问题:d——=0,diN二100,左边界上,域Q的外边界顶点坐标为-05-
0.8,顶05-
0.8,
050.8,L
050.8内边界点坐标为-0Q5,—0,4,05「
0.4,解
0.05,
04.-
0.05,
0.4力右边界上,其他边界上,[p e,t]=initmeshcrackg,;/u=parabolic0,0:
0.5:5,crackb\p^,^1,0,0,1;,pdeplotp e,t,,xydata,u:,ll/mesh7off7colormap,,hot,;///自带例子:
2.MatlabExamplesSolve theheatequation222onasquaregeometry-1x,y1squareg.Chooseu0=1onthediskx+y04,andu0=0otherwise.Use Dirichletboundaryconditionsu=0squarebl.Compute thesolutionat timeslinspace0,
0.1,
20.[p,ez t]=initmesh*squareg*;[p,e,t]=refinemesh1squareg,pz e,t;u0=zerossizep,2,1;ix=f indsqrt p1,:J2+p2,:.^
20.4;uO ix=onessizeix;tlist=linspace0,
0.1,20;ul=parabolicuO,tlist,*squarebl,pz e,t,1,0,1,1;NoteInexpressionsforboundaryconditionsandPDEcoefficients,thesymboltisusedtodenotetime.Thevariabletisoftenusedtostorethetrianglematrixofthemesh.You canuseanyvariable tostorethetrianglematrix,but inthePartialDifferentialEquation Toolboxexpressions,t alwaysdenotestime.[p,e,t]=initmesh,squareg;[p e t]=refinemesh,squareg pe,t;////;u0=zerossizep,2,lix=findsqrtpl,:.A2+p2,:.A
20.4;u0ix=onessizeix;tlist=linspace
00.120;.zul=parabolicuO,tlist/squarebl,,p,e,t l0,l,l;,/pdeplotp e t,xydata ul:,20,mesh7off,,colormap7hot;///,/.热传导问题的动画程序3cic,close all,clear all;%求解在正方形区域上非连续初始条件的、具有热源的典型热传导方程%du/dt-divgradu=l%定义问题描述正方形的文件名赋予符号变量是正方g=Kquareg,;%squareg gb=*squarebl;%squarebl形边界为的边界条件文件名1c=l;a=O;f=l;d=l;%初始化网格[p,e,t]=initmeshg;%初始条件:半径为的圆内部取外部取
0.41,0;u0=zerossizep,2,lix=findsqrtpl,:.A2+p2:.A
20.4;,uOix=onessizeix;%在时间段内取个点求解
00.120nframes=20;tlist=linspace0,
0.1,nframes;%解抛物型方程ul=parabolicuO,tlist b,p,e,t,c,a,f,d;z%为提高绘图速度,内插值成矩形网格x=linspace-l,l,31;y=x;[unused,tn a2,a3]=tri2gridp,t,u0,x y;,/%制作动画newplot;umax=maxmaxul;umin=minminul;for j=l:nframesu=tri2gridp t,ul:,j tna2,a3;///i=findisnanu;ui=zerossizei;surfx,y,u;caxis[umin umax];colormapcoolaxis[-l1-1101];mj=getframe;endmoviem;「热传导「movie2avim qualitylOOJfpsM;echo off若需要求解偏微分方程组,可用函数pdepe.非均质板壁的一维不稳定导热过程4ax t2%可用parabolic函数求解,该函数的说明如下:parabolicSolve parabolicPDE problemSyntaxul=parabolicu0tlist bp f,dz z z zul=parabolicu0tlist,b,p,rtolzul=parabolicu0,tlist,b,p,e,t,c,a,f,d,rtol,atolul=parabolicu0tlist KF Bud Mz zzzzzul=parabolicuO,tlist,K,F,B,ud,M,rtolul=parabolicu0tlist K,F,B,ud M,rtol,atolz zzDescriptionproduces thesolution tothe FEMformulation oftheui=paraboiic uO,tiist,g,b,p,e,t,c,a f,dzscalar PDEproblem=f onQ.-cVu+auor thesystem PDEproblem当~=f ond■£®Vu+aw Q类比可得系数c=La=0,f=0,d=L计算参考程序如下[p,et]=initmesh,squareg,;/[p,et]=refinemesh,squareg\p,e,t;,u0=zerossizep,2,l;ix=findsqrtpl,:.A2+p2:.A
20.8;zuOix=onessizeix;tlist=linspace0,
0.1,20;ul=parabolicuO,tlist,squarebl pe,t,l,0,0,l;//pdeplotP,e,t「xydatam:,8,mesh「off「colormap,,hot;x=linspace-l,l,31;y=x;[unused,tn,a2,a3]=tri2gridp t,uO x,y;//%制作动画newplot;umax=maxmaxul;umin=minminul;for j=l:8u=tri2gridp t,ul:,j,tn,a2,a3;/i=findisnanu;ui=zerossizei;surfxyu;caxis[umin umax];colormaphotaxis[-l1-1101];mj=getframe;endmoviem;。
个人认证
优秀文档
获得点赞 0