Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need to write matlab or python code to solve this problem Question 4: Creating Finite Difference Schemes (10 Marks) (a) Create a finite difference scheme

image text in transcribed

Need to write matlab or python code to solve this problem Question 4: Creating Finite Difference Schemes (10 Marks) (a) Create a finite difference scheme to approximate the slope of a function u at the point X; using values of the function at the points 2.1-2, 2-1, Lj, 21+1, and 21+2 that is of order O(A2). (b) Create a finite difference scheme to approximate the curvature of a function u at the point x; using values of the function at the points .3-5, 21-4, 2-3, 2-2, 2j-1, and 2, that is of order O(Ar). (c) Use these two schemes to estimate the slope and curvature of the function u(x) = sin(272) at x = 0.1 using the grid spacings Ax = 0.1, 0.1/2, 0.1/22, 0.1/23, and so-on to Ar = 0.1/210. Create a table with 5 columns showing: 1) the grid spacing Ar, 2) the slope obtained with the finite difference approximation, 3) the curvature obtained with the finite difference approximation, 4) the error between the finite difference and exact slope, 5) the error between the finite difference and exact curvature. (d) Create a log-log plot of error vs. grid spacing Ar for both the slope and curvature in part (c). What are the slopes of the lines in these plots and how do they compare to the expected/requested orders of accuracy in (a) and (b)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Apache Cassandra 3 X An Expert Guide To Improving Database Scalability And Availability Without Compromising Performance

Authors: Aaron Ploetz ,Tejaswi Malepati ,Nishant Neeraj

3rd Edition

1789131499, 978-1789131499

More Books

Students also viewed these Databases questions

Question

3. Comment on how diversity and equality should be managed.

Answered: 1 week ago

Question

describe the legislation that addresses workplace equality

Answered: 1 week ago