Question: Please solve in MATLAB 2. (4 points) Consider the following boundary value problems involving both first and second derivative -u(x)+u(x) + u(x)=2sin(x) + cos(x), a(0)=0,

Please solve in MATLAB 2. (4 points) Consider the following boundary valuePlease solve in MATLAB

2. (4 points) Consider the following boundary value problems involving both first and second derivative -u"(x)+u"(x) + u(x)=2sin(x) + cos(x), a(0)=0, u(1)=sin(1) xE [0, 1] The exact solution is u (x) sin(x) Use the finite difference scheme to solve the equation (1) with the setup in Matlab (see the code sent) h = 1/N; % mesh size = length of domain/N,N+1 is the number of grid points : 0:h:1; % grid points, x(1) and x(N-1) denote the boundary points a. What's the coefficient matrix for the unknown u? b. Write a Matlab code to implement the finite difference scheme c. Define the (infinity) error which can be computed by the command norm(u-sin(x), Inf) The convergence rate is defined by Errorh/Errorh/2- Complete the following table What's the convergence rate observed? Why? N mesh size h Errork raten 10 20 40 80

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!