首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
COMP5930M 代做、代写 c++,java 程序语言
项目预算:
开发周期:
发布时间:
要求地区:
School of Computing: assessment brief
Module title
Scientific Computation
Module code
COMP5930M
Assignment title
Coursework 2
Assignment type and description
Coursework assignment
Rationale
TBA
Weighting
20% of total mark
Submission dead- line
December 14th 2023 at 10:00
Submission method
Turnitin submission through Minerva
Feedback provision
Feedback provided on Minerva
Learning outcomes assessed
(i) Formulate and solve systems of nonlinear equations to solve challenging real-world problems arising from en- gineering and computational science; (ii) Implement al- gorithmic solutions to solve computational differential equation problems based on mathematical theory; (iii) Analyse computational linear algebra problems to iden- tify and implement the most efficient and scalable solu- tion algorithm to apply for large problems.
Module lead
Dr Toni Lassila
1
1. Assignment guidance
Provide answers to the two exercises below. Answer both exercises.
2. Assessment tasks
Exercise 1: The Burgers’ equation models the propagation of a pres- sure wave in shock tube. It is a nonlinear partial-differential equation in one spatial dimension to find u(x, t) s.t.
∂u + u∂u = ν ∂2u, (1) ∂t ∂x ∂x2
where the boundary conditions u(a, t) = ua and u(b, t) = ub for all t, and the initial condition u(x, 0) = u0(x) need to be prescribed in order to obtain a well-posed problem. Here ν is the kinematic viscosity of the fluid. For ν = 0 we have the inviscid Burgers’ equation, and for ν > 0 we have the viscous Burgers’ equation.
(a) Applying the central difference formula to the second order deriva- tive in space, the upwind difference formula
Uk−Uk
i−1
using implicit Euler’s method leads to the discrete formulation: Uk −Uk−1 Uk −Uk Uk −2Uk +Uk
Fi(U)= i i +Uik i i−1 −ν i+1 i i−1 =0 ∆t h h2
(2) for i = 2,3,...,m−1 where the interval has been discretised with
m uniformly distributed nodes and a spatial grid size h. Implement the function F as a python subroutine fun burgers.py
def fun_burgers( uk, ukp, dt, h, nu, ua, ub )
where uk is the vector Uk of size m, ukp is the previous time-step solution vector Uk−1, dt is the time-step ∆t, h is the spatial grid size parameter h, and nu is the kinematic viscosity ν. Include the boundary conditions ua and ub in the implementation. [6 marks]
2
Uik i
to the first order derivative in space, and discretising (1) in time
h
(b) Derive the analytical formulas for the nonzero elements on row i of the Jacobian matrix for (2): [4 marks]
∂Fi , ∂Fi, ∂Fi . ∂Ui−1 ∂Ui ∂Ui+1
(c) Solve problem (2) numerically using your fun burgers.py and the PDE solver template solver burgers.py provided in the course- work folder. Use the viscosity value ν = 0.01, the time-step ∆t=0.01,thegridsizeh=0.01,andafinaltimeofT =1. The initial solution u(x, 0) should be taken as a unit step located at x = 0.1 (see below) and the boundary conditions as: u(0, t) = 1 and u(1, t) = 0.
Figure 1: Initial condition u0(x) for the Burgers’ equation (1)
Plot the solution u(x, T ) at the final time step T = 1 and include it in your report. Also report the total number of Newton iterations required for the numerical solution (sum of Newton iterations over all time steps). [2 marks]
3
(d) The solution of Burgers’ equation (1) can be shown to be a (decay- ing) wavefront that travels from left to right at a constant velocity v. What is the approximate value of the numerical wavefront ve- locity vnum for ν = 0.01, ∆t = 0.01, and h = 0.01? Measure the approximate location of the wavefront using the point where the solution u(xmid) ≈ 0.5. [1 mark]
(e) Replace the discretisation of the nonlinear convection term with the downwind difference formula
Uk − Uk
i (3)
and solve the problem with same parameters as in (c). Plot the solution u(x,T) at the final time step T = 1 and include it in your report. Also report the total number of Newton iterations required for the numerical solution (sum of Newton iterations over all time steps). What is the numerical wavefront velocity vnum in this case?
Now set ν = 0.001 and solve the problem again using the down- wind difference formula. What do you observe? Now solve the problem with ν = 0.001 using the original upwind difference for- mula and compare the results. What is the numerical wavefront velocity vnum in this case? [7 marks]
Uik i+1
h
4
Exercise 2: Consider the anisotropic diffusion equation to find u(x, y) s.t.
∂2u ∂2u
− μx∂x2 +μy∂y2 =f(x,y), (x,y)∈(0,1)×(0,1), (4)
and the boundary condition u = 0 on Γ (the boundary of the unit square), where u is a scalar function that models the temperature of a heat-conducting object modelled here as a unit square and f(x,y) is a function modelling a heat source. The heat conductivity coefficients, μx > 0 and μy > 0, can have different magnitudes (anisotropy).
(a) Discretising the problem (4) using the second-order finite differ- ence formulas
∂2u ≈ ui,j−1 − 2ui,j + ui,j+1 .
Write the second-order finite difference stencil (similarly as in Tu- torial 7)
∂2u ≈ ui−1,j − 2ui,j + ui+1,j , ∂x2 h2
∂y2
−μx h2 −μy h2 = fi,j.
h2 ui−1,j − 2ui,j + ui+1,j ui,j−1 − 2ui,j + ui,j+1
leads to the discretised form
s11 s12 s13
S=s s s 21 22 23
s s s
corresponding to this finite difference scheme. [4 marks] (b) Implement a python function source function.py
def source_function( x, y, h )
that returns the right-hand side by evaluating the function:
f(x,y) :=
1, ifx≥0.1andx≤0.3andy≥0.1andy≤0.3 0, otherwise
.
Include the source code in your answer. [3 marks] 5
31 32 33
(5)
Figure 2: Computational domain for problem (4) and the sub-region where the heat source is located (in red).
(c) Modify the solver from Tutorial 7 to numerically solve the diffusion problem (4) for the right-hand side (5).
Solve the linear problem AU = F using the conjugate gradient method (without preconditioning) with the diffusion coefficients μx = 1 and μy = 1, stopping tolerance tol = 10−6, and maxi- mum of 1000 CG iterations. You can use the CG implementation in scipy.sparse.linalg.cg for this problem or code your own implementation.
Plot the solution surface and include the plot in your answer. How many iterations does it take for CG to converge in this case?
[2 marks]
(d) Consider now the use of a preconditioner to accelerate the con- vergence of CG. The incomplete-LU preconditioner approximates the system matrix A ≈ LincUinc by performing Gaussian elimi- nation but setting to zero any elements that are smaller than a dropoff tolerance ε chosen by the user. You can use the imple- mentation provided in scipy.sparse.linalg.spilu to compute
6
the incomplete factors Linc and Uinc.
Write a python implementation myPCG.py of the preconditioned
conjugate gradient from Lecture 18:
def myPCG( A, b, L, U, tol, maxit )
that solves the preconditioning step for the residual, Mzi+1 = LU zi+1 = ri+1 , using appropriate solution algorithms. Include the source code as part of your answer. [4 marks]
(e) Solve the problem (4) again using your preconditioned CG imple- mentation from (d). Use a dropout tolerance of ε = 0.1 for the incomplete LU-factorisation.
How many nonzero elements (nnz) do the factors Linc and Uinc have in this case?
How many PCG iterations does the problem take to converge to tol = 10−6 now?
[2 marks]
(f) Repeat the experiment from (e) with different values of the dif- fusion coefficients. Solve the problem (4) with μx = 0.1 and μx = 0.01, while keeping the other value at μy = 1. Solve the problem using PCG with the same ILU-preconditioner as before with a dropout tolerance of ε = 0.1. Plot the two respective solu- tions and the respective number of CG iterations. What do you observe?
[5 marks]
3. General guidance and study support
The MS Teams group for COMP5390M Scientific Computation will be used for general support for this assignment. If your question would reveal parts of the answer to any problem, please send a private message to the module leader on MS Teams instead. You can also use the tutorial sessions to ask questions about coursework.
4. Assessment criteria and marking process
Assessment marks and feedback will be available on Minerva within
three weeks of the submission deadline. Late submissions are allowed 7
within 14 days of the original deadline providing that a request for an extension is submitted before the deadline. Standard late penalties apply for submissions without approved extensions.
5. Presentation and referencing
When writing mathematical formulas, use similar notation and sym- bols as during the lectures and tutorials. Hand-written sections for mathematical notation are acceptable but need to be clearly readable.
You may assume theorems and other results that have been presented during lectures and tutorials as known. Any other theorems need to be cited using standard citation practice.
6. Submission requirements
This is an individual piece of work. Submit your answers through Tur- nitin as one PDF document (generated either in Word or with LaTeX). You may use hand-written and scanned pages for mathematical formu- las, but these need to be clearly legible and the document must contain at least some typeset text or Turnitin will reject it. All submissions will be checked for academic integrity.
7. Academic misconduct and plagiarism
Academic integrity means engaging in good academic practice. This involves essential academic skills, such as keeping track of where you find ideas and information and referencing these accurately in your work.
By submitting this assignment you are confirming that the work is a true expression of your own work and ideas and that you have given credit to others where their work has contributed to yours.
8. Assessment/marking criteria grid
Total number of marks is 40, divided as follows:
Exercise 1 (One-dimensional Burgers equation): 20 marks
Exercise 2 (Anisotropic diffusion and conjugate gradient): 20 marks
8
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!