1 / 6

配列の応用

配列の応用. 偏微分方程式を解く. 偏微分方程式. 例 波動方程式 マクスウェルの方程式 シュレーディンガー方程式 熱伝導方程式 変位が時間だけでなく位置の関数(場) よって配列が有効. ここでは拡散方程式を解く. におい,熱などは分子が何度も散乱されて行ったりきたりしながら,観測点にたどり着く ランダムウォーク,または酔歩の問題 拡がっていく大きさは時間でなく,時間の平方根に比例. 簡単のため,時間に定常問題, 1 次元を考える. 偏微分方程式は. 定常状態では. 差分化して. X=100 で温度が 50 度, x =0 で 0 度の条件で解く.

kumiko
Télécharger la présentation

配列の応用

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. 配列の応用 偏微分方程式を解く

  2. 偏微分方程式 • 例 • 波動方程式 • マクスウェルの方程式 • シュレーディンガー方程式 • 熱伝導方程式 • 変位が時間だけでなく位置の関数(場) • よって配列が有効

  3. ここでは拡散方程式を解く • におい,熱などは分子が何度も散乱されて行ったりきたりしながら,観測点にたどり着く • ランダムウォーク,または酔歩の問題 • 拡がっていく大きさは時間でなく,時間の平方根に比例

  4. 簡単のため,時間に定常問題,1次元を考える簡単のため,時間に定常問題,1次元を考える • 偏微分方程式は 定常状態では 差分化して

  5. X=100で温度が50度,x=0で0度の条件で解く do while(dot_product(Tnew-Told,Tnew-Told).gt.error.and.iter.lt.niter) iter=iter+1 Told=Tnew do isize=1,nsize Tnew(isize)=(Told(isize-1)+Told(isize+1))/2._dp end do end do write(*,*) iter do isize=0,nsize+1 write(*,*)isize,Tnew(isize) end do stop end Program diffusion1d !------------------------- ! to solve the stationary diffusion equation !2008/12/20 Written by T. Ohtsuki !------------------------- implicit none ! Always begin with this statement integer,parameter::dp=selected_real_kind(11,50) integer,parameter::nsize=100,niter=1000000 real(kind=dp),parameter::error=1.0E-12 integer::isize,iter real(kind=dp),dimension(0:nsize+1)::Tnew,Told Tnew=0._dp Told=0._dp ! boundary condition Tnew(0)=50 ! x=0 is set to 50 degree. iter=0

  6. 2次元の場合

More Related