B7 - boundary conditions

types of boundary conditions

von neumann BC: 2nd derivative

f(x0+Δx)f(x0)+f(x0)Δx+12f(x0)(Δx)2+O[(Δx)3] f(x1)=f(x0+Δx)f(x0)+12f(x0)(Δx)2 f(x0)=2(Δx)2[f(x1)f(x0)] f(x0)=f(x1)+f(x1)2f(x0)(Δx)2 f(x0)=12Δx[f(x1)f(x1)]=0f(x1)=f(x1) f(x0)=2(Δx)2[f(x1)f(x0)]

boundary value problem

dTdt=d2Tdx2+S(x) 1(Δx)2[Tk1+Tk+12Tk]+Sk=0 A(Δx)2[T0TK1]=[S0SK1] 1(Δx)2[Tk1+Tk+12Tk]=Sk

C6 - boundary conditions.png|500
image: B Hnat, lecture notes

C6 - boundary conditions-1.png|500
image: B Hnat, lecture notes

aij=b[ku+ij]j

C6 - boundary conditions-2.png|500
image: B Hnat, lecture notes

C6 - boundary conditions-3.png|500
image: B Hnat, lecture notes

x2 - code for transforming indices

periodic boundaries

d2Tdx2=S(x) T(x0Δx)=T(x0Δx+L)=T[x0+(LΔx)]or, T1=TK1 1(Δx)2[T1+T12T0]=S01(Δx)2[TK1+T12T0]=S0 T|k=0=1(Δx)2[TK1+T12T0]=S0 T|k=K1=1(Δx)2[TK2+T02TK1]=SK1 (1Δx)2[2101121001201002][T0T1T2TK1]=[S0S1S2SK1]

matrix folding

C6 - boundary conditions-4.png|500
image: B Hnat, lecture notes

C6 - boundary conditions-5.png|500
image: B Hnat, lecture notes

j(i)=2ifor i<K/2j(i)=2(Ki)1otherwise