Question
i need help to write it in matlab 2.14) consider the boundary vale problem u''(x)= f(x) , u(0)=0 , u'(1)=1 s1= (U_n+1 - U_n )/h
i need help to write it in matlab
2.14) consider the boundary vale problem
u''(x)= f(x) , u(0)=0 , u'(1)=1
s1= (U_n+1 - U_n )/h = 1
s2 = (U_n+2 - U_n )/2h = 1
a) let f(x) = -e^(x-1)
Complete the work of Exercise 2.14 for the value of n = 10. You will implement your tridiagonal code for this problem but with slightly different coefficient matrices A1 and A 2 and right hand side vectors b1 and b2. The matrices will be almost the same but may be slightly changed due to the equations used to address the right boundary condition variations in part a, leading to a change in one or two elements of A 1and A2 associated with the schemes S1 and S2 . The vectors associated with the given right hand side function of part c, b1 and b2 , may be slightly changed due to the discrete equations used to address the right boundary condition variations in part a (possibly leading to a change in one or two elements of b1and b2 due to the schemes s1 and S2 .) Provide copies of the coefficient matrices A 1and A2 and copies of the right hand side vectors b1 and b2 from Matlab. Compute and provide the errors for each of the schemes. The numerical output of Task 2 should be 2 coefficient matrices, 2 right hand side vectors, 2 solution vectors and 2 vectors of error values. Also plot the solution vectors along with the true solution and a separate plot of the errors, there should be 2 or 4 plots. You may plot the true solution along with both approximate solutions.
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