这个Homework是用Python解决一些数学计算问题的Python代写

Math 104C Homework #4
1.考虑初始条件下单位为[0,1]⇥[0,1]的热方程

ut = D(uxx + uyy)
u(0,x,y)= sin(⇡x)sin(⇡y)(1)
齐次Dirichlet边界条件u = 0。
(a)实施Peaceman-Rachford ADI方法,以找到该初始边界值问题的近似值。
(b)准确性检查。验证方案的准确性并作为可能的检查
错误应该始终进行解决方案研究。假设v(k)是您的数值
使用时间步长k计算固定时间的近似值,然后计算时间的二阶
准确性意味着
v(k)= u + c2k2 + c3k3 +···,(2)
u是确切值。保持空间结果固定(hx = hy = h,均匀
网格)现在使用k / 2进行计算,则您的近似值满足:
v(k / 2)= u +
1个
4
c2k2 +
1个
8
c3k3 +···(3)
然后是v(k / 4),依此类推。然后是比率:
R(k)= v(k)v(k / 2)
v(k / 2)v(k / 4)(4)
(c)计算D = 1的解,并绘制三个不同的时间。
course所有课程资料(课堂讲课和讨论,讲义,家庭作业,考试,网络资料)以及课程本身的知识内容均受美国联邦版权法,
加州民法典。 UC政策102.23明确禁止学生(和所有其他人员)录音
讲座或讨论,以及在没有事先通知的情况下分发或出售讲座笔记和所有其他课程材料
老师的书面许可。
1个

2. Consider the one-way wave equation ut + ux = 0 on the interval [1, 3] and for t 0 with
the following two sets of initial conditions:
u(x, 0) = (
1 |x| if |x|  1,
0 otherwise, (5)
and
u(x, 0) = e5x2
. (6)
(a) Use the forward-time forward-space scheme:
un+1
j un
j
k +
un
j+1 un
j
h = 0,
with right-point boundary condition un+1
M = un+1
M1 where xM = 3 to compute an approximation to the solution at several (up to 40) time steps. Use h = 0.02 and = k/h = 0.8.
Demonstrate numerically (plot the solution) the instability of the scheme and show that
the instability appears sooner with the less smooth initial data.
(b) Comment on the localization of the onset of instability for initial data (5) and give an
estimate of the expected growth rate of the instability per time step.
(c) Using the left boundary condition u(1) = 0, write a stable scheme and compute the
corresponding approximation for data sets (5) and (6). Plot the approximations at
representative time steps. Use again h = 0.02 and = k/h = 0.8.
2