Question: Using MATLAB please!!! 6. This problem concerns the setup for incorporating the boundary conditions: Beu= 9a and Byu = go in the algebraic equations governing
Using MATLAB please!!!

6. This problem concerns the setup for incorporating the boundary conditions: Beu= 9a and Byu = go in the algebraic equations governing the approximation. In what follows, denote the MATLAB variable mat to be the matrix obtained from assemble_diffusion_matrix and assemble reaction_matrix, the MATLAB variable F to be the vector obtained from assemble_force_vector. If Bau= K(21)'(a) + Yau(a), the resulting algebraic equation for the approximation is (Q1 + B1 - raun(xi) - ai un(x2) = F1 - ga, (6.7) where Q1, B1, and F1 are constants as described in the previous problems in this assignment. According to (6.7), to incorporate the non-Dirichlet condition, what is left to be done is n.1: to add the value representing - Ya to mat(1,1), n.2: to add the value representing -ga to F(1). On the other hand, if Bau= u(a), i.e., the Dirichlet condition, then the corresponding algebraic equation is un(x1) = 9a (6.8) Recall that mat and F have been constructed by calling assemble_diffusion_matrix, assemble_reaction_matrix, and assemble_force_vector, under the assumption of non-Dirichlet condition on the left boundary. Thus, should the left boundary be Dirichlet, to incorporate it, you just need to d.1: set mat(1,1) = 1 and mat(1,2) = 0, d.2: set F(1) to be equal to the value representing ga. Similar way can be done to incorporate the boundary condition on the right end point (Byu = 96). Implement the above the description in a MATLAB function. The skeleton of the function is listed below, from which you can complete the rest of the operations. function [F,mat] = set_boundary (mesh, bvpdata,F,mat) % if bvpdata. leftbdryisDirichlet % Left boundary is Dirichlet % implement d. 1 and d.2 else % This means left is either Neumann or Robin % implement n.1 and n.2 end % if bvpdata.rightbdryisDirichlet % Right boundary is Dirichlet % implement something similar to d.1 and d.2 else % This means right is either Neumann or Robin % implement something similar to n.1 and n.2 end % end 6. This problem concerns the setup for incorporating the boundary conditions: Beu= 9a and Byu = go in the algebraic equations governing the approximation. In what follows, denote the MATLAB variable mat to be the matrix obtained from assemble_diffusion_matrix and assemble reaction_matrix, the MATLAB variable F to be the vector obtained from assemble_force_vector. If Bau= K(21)'(a) + Yau(a), the resulting algebraic equation for the approximation is (Q1 + B1 - raun(xi) - ai un(x2) = F1 - ga, (6.7) where Q1, B1, and F1 are constants as described in the previous problems in this assignment. According to (6.7), to incorporate the non-Dirichlet condition, what is left to be done is n.1: to add the value representing - Ya to mat(1,1), n.2: to add the value representing -ga to F(1). On the other hand, if Bau= u(a), i.e., the Dirichlet condition, then the corresponding algebraic equation is un(x1) = 9a (6.8) Recall that mat and F have been constructed by calling assemble_diffusion_matrix, assemble_reaction_matrix, and assemble_force_vector, under the assumption of non-Dirichlet condition on the left boundary. Thus, should the left boundary be Dirichlet, to incorporate it, you just need to d.1: set mat(1,1) = 1 and mat(1,2) = 0, d.2: set F(1) to be equal to the value representing ga. Similar way can be done to incorporate the boundary condition on the right end point (Byu = 96). Implement the above the description in a MATLAB function. The skeleton of the function is listed below, from which you can complete the rest of the operations. function [F,mat] = set_boundary (mesh, bvpdata,F,mat) % if bvpdata. leftbdryisDirichlet % Left boundary is Dirichlet % implement d. 1 and d.2 else % This means left is either Neumann or Robin % implement n.1 and n.2 end % if bvpdata.rightbdryisDirichlet % Right boundary is Dirichlet % implement something similar to d.1 and d.2 else % This means right is either Neumann or Robin % implement something similar to n.1 and n.2 end % end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
