Question
2a.) On solving u xx = f numerically for x (0, 1) with boundary condition u(0) = 0, u(1) = 1. Write a code to
2a.) On solving uxx = f numerically for x (0, 1) with boundary condition u(0) = 0, u(1) = 1.
Write a code to solve it with f(x) = sin(2x) + ex and the domain (0, 1) subdivided into 100 small intervals.
Write a subroutine to solve the equation with the number of intervals (denoted by m), and the right hand side function f(x) as input.
Pick a right hand side function so that you know the exact solution, run the code, calculate the error, and the convergence order by taking m = 10, 20, 40, 80, 160, 320, 640. Plot the error curve (as a function of the number of intervals) in a way that the convergence order is easily visualized.
2b.) Repeat number 2 with the boundary condition changed to u'(0) = 0, u(1) = 1 by adopting the first and then the second order treatment of the Neumann boundary condition at 0.
Step by Step Solution
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