5. Consider the following partial differential equation on x € (0,1), t e [0,00): Ut = Duxx, u(x,0) = x(1 – x). (a) Code an e

5. Consider the following partial differential equation on x € (0,1), t e [0,00): Ut = Duxx, u(x,0) = x(1 – x). (a) Code an explicit Matlab routine that solves this PDE on the domain x E [0, 1], t E 0, 10), with the boundary conditions u(0,t) = 0 and u(1, t) = 0. Plot the solution as a surface in x-t for D = 0.1,1, and 10. Comment on the effect of the choice of D. (b) Code an implicit Matlab routine that solves this PDE on the domain x € [0, 1], t E (0,10], with the boundary conditions u(0,t) = sin(2t) and u(1,t) = – sin(2t). Plot the solution as a surface in x-t for different values for D = 0.1, 1, and 10. Comment on the effect of the choice of D. In this question, you are required to make sensible choices for space and time steps.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *