A statement of collaboration is required. For this assignment, uses of Matlab built-in functions for solving boundary va
Posted: Mon May 02, 2022 4:27 pm
A statement of collaboration is required. For this assignment, uses of Matlab built-in functions for solving boundary value problems, such as bvp4c and bvpinit, are NOT allowed. Otherwise, you may use Matlab functions such as backslash ("\*) or inv to solve a system of linear equations or invert a matrix. Note: For any sinusoidal functions you might encounter in this homework, the argument of the function is always in radian
Problem 2 (5 points) Consider the following boundary value problem for u(x) defined on the interval of 1 3x33, xu" + (1 – x) u' + cos(x) u = 0, u(1) = 4, u(3) = 2. (Note that the left end point of the interval is x = 1, not x = 0.) Solve the BVP using the finite-difference method. Specifically, use the 3-point second-order central difference formula to approximate the second derivative: u; "=(-1-2 u; + u-1)/(Ar)?), and use the 2-point first-order forward difference formula to approximate the first derivative: u;' = U1 – u;)(Ax). Obtain the numerical solutions for the two cases: (1) Ar=0.2, (II) Ar=0.02. Plot the two numerical solutions over the interval of 1<x<3. Collect both curves in one plot and clearly label the curves. You do not need to find or show the analytic solution for this problem.
Problem 2 (5 points) Consider the following boundary value problem for u(x) defined on the interval of 1 3x33, xu" + (1 – x) u' + cos(x) u = 0, u(1) = 4, u(3) = 2. (Note that the left end point of the interval is x = 1, not x = 0.) Solve the BVP using the finite-difference method. Specifically, use the 3-point second-order central difference formula to approximate the second derivative: u; "=(-1-2 u; + u-1)/(Ar)?), and use the 2-point first-order forward difference formula to approximate the first derivative: u;' = U1 – u;)(Ax). Obtain the numerical solutions for the two cases: (1) Ar=0.2, (II) Ar=0.02. Plot the two numerical solutions over the interval of 1<x<3. Collect both curves in one plot and clearly label the curves. You do not need to find or show the analytic solution for this problem.