Computational Physics - Department of Physics
10.2 Diffusion equation 309 with a truncation errorO(∆t^2 ). Here we will stick to the backward formula and come back to the lat ...
310 10 Partial Differential Equations y(i) = u(i) = func(delta_x*i); } // Boundary conditions (zero here) y(n) = u(n) = u(0) = y ...
10.2 Diffusion equation 311 θ ∆x^2 ( ui− 1 ,j− 2 ui,j+ui+ 1 ,j ) + 1 −θ ∆x^2 ( ui+ 1 ,j− 1 − 2 ui,j− 1 +ui− 1 ,j− 1 ) = 1 ∆t ( u ...
312 10 Partial Differential Equations Scheme: Truncation Error: Stability requirements: Crank-NicolsonO(∆x^2 )andO(∆t^2 )Stable ...
10.2 Diffusion equation 313 vec u(n+1); // This is uinAu = r vec r(n+1); // Right side of matrix equation Au=r // setting up the ...
314 10 Partial Differential Equations ∇^2 u(x,t) = ∂u(x,t) ∂t , with initial conditions u(x, 0 ) =g(x) 0 <x<L. The boundar ...
10.3 Laplace’s and Poisson’s Equations 315 10.2.5Explict scheme for the diffusion equation in two dimensions We end this section ...
316 10 Partial Differential Equations uxx≈ u(x+h,y)− 2 u(x,y)+u(x−h,y) h^2 , and uyy≈ u(x,y+h)− 2 u(x,y)+u(x,y−h) h^2 , which we ...
10.3 Laplace’s and Poisson’s Equations 317 In order to illustrate how we can transform the last equations into a linear algebra ...
318 10 Partial Differential Equations function valuesui j. This means that, if we fix the endpoints for the two-dimensional case ...
10.3 Laplace’s and Poisson’s Equations 319 where we have defined the vector b= u 01 +u 10 −ρ ̃ 11 u 13 +u 02 −ρ ̃ 12 u 31 ...
320 10 Partial Differential Equations Update the new value ofufor the given iteration Go to step 2 A simple example may help i ...
10.3 Laplace’s and Poisson’s Equations 321 10.3.3Jacobi’s algorithm extended to the diffusion equation in two dimensions. In our ...
322 10 Partial Differential Equations or in a more compact form as uli,j= 1 1 + 4 α [ α ∆li j+uli,−j^1 ] , (10.18) with∆i jl= [ ...
10.4 Wave Equation in two Dimensions 323 and att= 0 it reduces to ut≈ ui,+ 1 −ui,− 1 2 ∆t =^0 , implying thatui,+ 1 =ui,− 1. If ...
324 10 Partial Differential Equations in our setup of the initial conditions. 10.4.1Closed-form Solution We develop here the clo ...
10.5 Exercises 325 Hm(x) =sin( mπx L ) Qn(y) =sin( nπy L), or Fmn(x,y) =sin( mπx L )sin( nπy L ). Withρ^2 =ν^2 −κ^2 andλ=cνwe ha ...
326 10 Partial Differential Equations ∇(λ(x,y)∇u) =∂ ∂x ( λ(x,y)∂u ∂x ) +∂ ∂y ( λ(x,y)∂u ∂y ) , as follows using again a quadrat ...
10.5 Exercises 327 doublealpha = tstep*tstep/(h*h) // We define the solution u at an explicit time step l // using Armadillotode ...
328 10 Partial Differential Equations The functionH(x,y)simulates the water depth using for example measurements ofstill water d ...
«
12
13
14
15
16
17
18
19
20
21
»
Free download pdf