Question: ( a ) Given a function f ( x ) create an m - function function [ x , u ] = finite _ difference

(a) Given a function f(x) create an m-function
function [x,u]= finite_difference ({:a,u-a,b,u-b,N)
that solves the boundary value problem
a,bN-1xu(x)uLUu''(x)+u(x)=cos(x)+xcos(2x)u(0)=0u(5)=1N=3,N=6,N=12N=24Nf1(x),f2(x),f3(x)f=f1f=f2f=f3cdots in the vector x and the approximation of the solution u(x)at these points
in the vector u. Hint: use the LU factorization.
(b)Inhw04q2.m use the code from aa=x1
cdots in the vector x and the approximation of the solution u(x)at these points
in the vector u. Hint: use the LU factorization.
(b)Inhw04q2.m use the code from au''(x)+u(x)=f(x),a
on the interval a,b cut into N-1 equal pieces and returns the points a=x1
cdots in the vector x and the approximation of the solution u(x)at these points
in the vector u. Hint: use the LU factorization.
(b)Inhw04q2.m use the code from a
 (a) Given a function f(x) create an m-function function [x,u]= finite_difference

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!