当前位置:首页 > 商业/管理/HR > 经营企划 > 热传导方程几种差分格式的MATLAB数值解法比较
252Vol.25No.22011.06JOURNALOFSHENYANGUNIVERSITYOFCHEMICALTECHNOLOGYJun.20112010-08-301980-.2095-2198201102-0179-04MATLAB110142MATLAB.MATLAB.MATLABCrank-NicolsonO241.82A.1-2.MATLAB、.MATLAB、3.MATLAB4-6.MATLAB7.8.MAT-LAB9.MATLAB.ut=a2ux2+fxt1uxttxafxt.11.1x-t.hτ2xj=jhtk=kτ0T×0L.Uk+1j-Ukjτ=aUkj+1-2Ukj+Ukj-1h2+fkJ.2Uk+1j-Ukjτ=aUk+1j+1-2Uk+1j+Uk+1j-1h2+fkJ.3Crank-NicolsonUk+1j-Ukjτ=aUk+1j+1-2Uk+1j+Uk+1j-1h2(+Ukj+1-2Ukj+Ukj-1h)2+fkj.4DuFortFrankelUk+1j-Uk-1j2τ=aUkj+1-Uk+1j-Uk-1j+Ukj-1h2+fkj.5TaylorOτ+h2Oτ+1802011h2Oτ2+h2Oτ2+h21.1.2、.U0j=uxj0=jj=01…MUk0=u0tk=g1kUkL=uLtk=g2kk=1…N.1.3r=aτh22Uk+1J=rUkj+1+1-2rUkj+rUkj-1+τfkj6Fourierr≤1/2.-rUk+1j-1+1+2rUk+1j-rUk+1j+1=Ukj+τfkj.7Fourier.Crank-Nicolson-r2Uk+1j-1+1+rUk+1j-r2Uk+1j+1=r2Ukj+1+1-rUkj+r2Ukj-1+τfkj.8r>0|G|≤1.DuFortFrankel1+2rUk+1j=1-2rUk-1j+2rUkj-1+2rUkj+1+2τfkj.9FourierDuFortFrankel.26Uk+1j=rUkj+1+1-2rUkj+rUkj-1+τfkjk=12…N-1j=01…M-1U0j=jj=01…MUk0=g1kUkL=g2kk=12…N10u10uu1j.ukj.7-rUk+1j-1+1+2rUk+1j-rUk+1j+1=Ukj+τfkjk=12…N-1j=01…M-1U0j=jk=01…NUk0=g1kUkL=g2kj=01…M11Uk+11Uk+12Uk+1M-2Uk+1M-1=Uk1+rg1j+1Uk2UkM-2UkM-1+rg2j+112..Crank-Nicolson8-r2Uk+1j-1+1+rUk+1j-r2Uk+1j+1=r2Ukj+1+1-rUkj+r2Ukj-1+τfkjk=12…N-1j=01…M-1U0j=jj=01…MUk0=g1kUkL=g2kk=12…N13kUkjk+1Uk+1j2MATLAB181Uk+11Uk+12Uk+1M-2Uk+1M-1+τfk1+r2Uk0+Uk+10fk2fkM-2fkM-1+r2UkM+Uk+1M14.functionU=HeatConductCrankNicolsonaInit-CondLeftCondRightCondrMNxt%InitializeparametersandUU=zerosNMF=zerosN1%RightfunctionconditionsF=fevalf0kN-1*k'%GeneratefirstrowU1=fevalInitCondx%BoundaryconditionsU1=fevalLeftCondtUM=fevalRightCondt%GenerateremainingrowsofUforkt=2NA=1+r*eyeM-2temp=-r/2*linspace11M-3A=A+diagtemp1+diagtemp-1%B=1-r*eyeM-2temp=r/2*linspace11M-3B=B+diagtemp1+diagtemp-1b=B*Ukt-12M-1'b1=b1+r/2*Ukt-11+Ukt1bend=bend+r/2*Ukt-1M+UktMUkt2M-1=A/b%solveequationAU^n+1=bb=BU^nendDuFortFrankel71+2rUk+1j=1-2rUk-1j+2rUkj-1+2rUkj+1+2τfkjk=12…N-1j=01…M-1U0j=jj=01…M-1Uk0=g1kUkL=g2kk=12…N-115321212.%GeneratesecondrowusingimplicitschemeA=1+2*r*eyeM-2temp=-r*linspace11M-3A=A+diagtemp1+diagtemp-1b=U12M-1'b1=b1+r*U11bend=bend+r*U1MU22M-1=A/b%solveequationAU=b%GenerateremainingrowsofUforkt=3Nforjx=2M-1Uktjx=2*r*Ukt-1jx-1+2*r*Ukt-1jx+1+1-2*r*Ukt-2jx/1+2*rendend34.ut=2ux20<t<10<x<1ux0=sinπx0≤x≤1u0t=0u1t=00≤t≤{1uxt=e-π2tsinπx.e=u-U‖ek‖2=‖uk-Uk‖2=1M∑Mj=1uxjtk-Ukj槡2.1822011h=0.11~6.1r=1‖ek‖2Fig.1r=1errorsofseveraldifferenceschemes‖ek‖22r=12‖ek‖2Fig.2r=12errorsofseveraldifferenceschemes‖ek‖23r=13‖ek‖2Fig.3r=13errorsofseveraldifferenceschemes‖ek‖24r=14‖ek‖2Fig.4r=14errorsofseveraldifferenceschemes‖ek‖2DuFortFrankel.r≤12..Crank-Nicolson.5r=15‖ek‖2Fig.5r=15errorsofseveraldifferenceschemes‖ek‖26r=0.67‖ek‖2Fig.6r=0.67errorsofseveraldifferenceschemes‖ek‖24MATLABDuFortFrankelCrank-Nicolson.1.M.2.2007131-138.2MortonKWMayersDF.NumericalSolutionofPartialDifferentialEquationsM.2thed.CambridgeUKCambridgeUniversityPress200519-26.3.MATLABM.2005175-182.1912PervovaIGetalSynthesisandApplicationofSolid-phaseReagentswithFormzaneGroupsinEnvironmentalAnalysis191IG1TV1TI1TA1GN2IN1331.6201002.6209003.110142.、..、.、.1824.MATLABJ.200336z2150-152.5.MATLABJ.200524317-19.6.MATLABJ.200524281-84.7.MATLABJ.200322422-27.8.J.20092411-5.9.matlabJ.200230991-93.AComparisonofNumericalSolutionsofSeveralDifferenceSchemesforHeatConductionEquationbyMatlabFENGLi-weiShenyangUniversityofChemicalTechnologyShenyang110142ChinaAbstractTheseveraldifferenceschemesforheatconductionequationwereanalyesed.ThemethodforsolvingPDEequationwasdiscussed.TheprogramsarewritteninMATLABusingseveraldifferenceschemes.Anumericalexperimentwasmade.Indifferentmeshsituationsthemeritsanddemeritsofsever-aldifferenceschemeswerecompared.Keywordstheheatconductequationsexplicitdifferenceschemeimplicitdifferenceschemecrank-nicolsonschemedufortfrankelscheme
本文标题:热传导方程几种差分格式的MATLAB数值解法比较
链接地址:https://www.777doc.com/doc-4954413 .html