Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. We will develop numerical methods to solve the equation u+au=0, aR>, (2) u(x, t) and a is a speed. You will also need
3. We will develop numerical methods to solve the equation u+au=0, aR>, (2) u(x, t) and a is a speed. You will also need the last non-zero digit of your ID where u = number a. i Perform a Taylor expansion of u(a, t + k), where k < 1, including terms of up to first order in k. Hence find a first order approximation to u ii. Substitute equation (2) into your Taylor expansion of u(x, t+k). (1 mark) iii. Perform a Taylor expansion of u(x-h, t), where h < 1, including terms of up to first order in h. Hence find a first order approximation to u (1 mark) (1 mark) iv. Substitute your approximation to u, into your first order expansion of u(x, t + k) in [ii] to find a forwards-in-time-backwards-in-space algorithm. In doing so, you should introduce discretisations of a and t, making sure you define all terms and notation. Your final algorithm should be in short-hand notation of the form u. where i and n denote discrete points in space and time, respectively. It should also include a CFL-type number F= a^t/Ar, and be written as concisely as possible. (4 marks) v. A skeleton Python code is provided for you on Moodle called "CWcodel". It includes an initial condition and periodic boundary conditions, but the algorithm is missing (line 32). Complete the code with the algorithm you just derived. The code includes input values for the CFL number, the timestep, the final time, and the length. It also includes a plotting command that plots the solution at 3 moments in time. The value of c must be the last non-zero digit of your ID number. Run your script and plot the solution. You should also include your ID number in the title of your plot (it will not be marked if you don't). Include a copy (a screenshot or a PDF) of your code and the plot (as well as uploading your code).
Step by Step Solution
★★★★★
3.54 Rating (168 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started