Final Projects Math104 C 1Prof. Hector CenicerosInstructions: Choose one of the problems and write a jupyter notebook to integrate allthe parts of the problem solution; this includes any analytic calculations and theory, code,results and analysis of the results.1. The cellar. Neglecting the curvature of the Earth and the diurnal (daily) variation oftemperature, the distribution of temperature T(x, t) at a depth x and a time t is givenby the Heat equation:Here κ is thermometric diffusivity of soil whose value is approximately κ = 2 ×103cm2/sec (the fundamental time scale is a year, 3.15 × 107sec). Assume that thetemperature f(t) at the surface of the Earth (x = 0) has only two values, a “summer”value for half of the year and a “winter” value for the other half, and that this patternis repeated every year (i.e. at x = 0 the temperature is periodic with a period of ayear). The temperature T should decay to zero as x → ∞.a) Show that the backward (implicit Euler) difference scheme for (1) is consistentand unconditionally stable. What is the order of the scheme?b) Implement the backward difference scheme to find a numerical approximation to(1). Consider the initial condition u0(x) = f(t)eyour computational spatial domain take a sufficiently long interval so that theright-end boundary condition u = 0 can be used. Select k and h small enough toresolve well the numerical solution. Plot the numerical solution at several times.c) From your numerical solution, find the depth xc at which the temperature isopposite in phase to the surface temperature, i.e, it is summer at xc when iswinter at the surface. Note that the temperature variation at xc is much smallerthan that at the surface. This makes the depth xc ideal for a wine cellar orvegetable storage.2. A simple model for air quality control. An air pollutant gets advected by the windand at the same time diffuses as it travels. The time evolution of the concentrationu(x, y, t) of the pollutant at position (x, y) and at time t can be modelled by theadvection diffusion equationut + Uwux + Vwuy = D(uxx + uyy), (2)1All course materials (class lectures and discussions, handouts, homework assignments, examinations, webmaterials) and the intellectual content of the course itself are protected by United States Federal CopyrightLaw, the California Civil Code. The UC Policy 102.23 expre代写Math104 C 1作业、代写c/c++,Python实验作业、代做Java程序作业、代写analytic calssly prohibits students (and all other persons)from recording lectures or discussions and from distributing or selling lectures notes and all other coursematerials without the prior written permission of the instructor.1where (Uw, Vw) are the components of the wind velocity and D > 0 is the diffusivitycoefficient (assumed small) of the pollutant in the air.a) The one-dimensional case of (2) isut + Uwux = Duxx. (3)(If D = 0, this is the simple one-way wave equation (also called advection equation)we have seen in class). Assuming Uw condition for the schemeb) If D = 0, one gets an “upwind” scheme for the one-way way equation. Find themodified (model) equation for the “upwind” scheme and show that the schemeis dissipative. How do you have to take your numerical parameters to guaranteethat your numerical diffusion is much less than the “real” diffusion when D 6= 0.Explainc) Write a code to implement (4) with homogeneous boundary conditions (u = 0 atthe boundary) and use it to solve (3) in [5, 1] with initial conditionu0(x) = (1 for 0 ≤ x ≤ 1/20 otherwise(5)Take Uw = 1 and D = 0.1 and select k and h small enough to resolve well thenumerical solution. Plot the solution at t = 1, 2, 3.3. Acoustic waves. The air pressure p(x, t) in an organ pipe is governed by the wave equation.(6)where l is the length of the pipe and c is a constant. If the pipe is open, the boundarycinditions are given byp(0, t) = p0 and p(l, t) = p0. (7)If the pipe is closed at the end x = l the boundary conditions arep(0, t) = p0 and px(l, t) = 0. (8)Assume that c = 1, l = 1, and the initial conditions arep(x, 0) = p0 cos 2πx, and pt(x, 0) = 0 0 ≤ x ≤ 1. (9)a) Write down an explicit finite difference method for (5) and give stability conditionsand the order of the method.2b) Implement your method given in a) for the open pipe with p0 = 0.9, and withstep sizes k = h = 0.05. Plot your numerical solution at t = 0.5 and t = 1.0.c) Implement your method given in a) for the closed pipe at x = l with p0 = 0.9,and with step sizes k = h = 0.05. Plot your numerical solution at t = 0.5 andt = 1.0.d) Repeat b) for k = h = 0.025. Construct a higher order approximation by extrapolatingyour numerical solutions corresponding to k = h = 0.05 and k = h = 0.025.What’s the order of the new approximation.3转自:http://www.3daixie.com/contents/11/3444.html
讲解:Math104 C 1、c/c++,Python、Java、analytic calculationsR|
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。