Question: Here is the example for - d2u/dx2 + u=1 x bigger or equal to 0 and lesser or equal to 1 u(0)=u(1)=0 As discussed in

Here is the example for - d2u/dx2 + u=1

x bigger or equal to 0 and lesser or equal to 1

u(0)=u(1)=0

Here is the example for - d2u/dx2 + u=1 x bigger or

As discussed in class: create a computer program that will numerically solve the equation:

- d2u/dx2 + u = x

du/dx = 0 at x=0,1.

Please submit the homework on paper.

If you get stuck, please ask in class. I prefer that you ask in class than that you come to office hours. If you are still stuck after we go over it in class, then come to office hours. Look at Section 8.1 for ideas.

Include the code, a brief explanation of the code, and a plot of the answer. Full credit will only be given if you include x=0,1 on the plot.

please show how to do this with matlab and show the plot for the solution thank you.

n=100; h=1; A=zeros(n-1, n-1); for i=1:n-1, if (i-1)0) A(i,i-1)=-1/h^2; end if (i+1

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!