Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using MATLAB please!!! 2. Consider the setting for a two-point BVP: d (6(2) ) +r(a)u = f(x), (a,b), Bau=ga, Bb = 9b where the only

using MATLAB please!!!

image text in transcribed

2. Consider the setting for a two-point BVP: d (6(2) ) +r(a)u = f(x), (a,b), Bau=ga, Bb = 9b where the only unknown is the function u : [a, b] + R and the rest are data, i.e., ones provided by users. The operator Bm represents the boundary condition at m = a,b, which can be either Dirichlet: Bmu = u(m) or non-Dirichlet: Beu=k(a)u' (a) + Yau(a), Byu = -K(b)u'(6) + You(b). Note that when m = 0, a Neumann condition is recovered. Write a MATLAB function that creates all these data. Your MATLAB function should look like function [bvpdata] = set_bvp_data(), where it returns a structure array bvpdata. This structure should have the following fields: . . . domain, which contains [a, b], diffusioncoeff, which contains K, reactioncoeff, which contains r (if it exists in the problem), forcecoeff, which contains f (if it exists in the problem), leftbdryisDirichlet, which is a Boolean variable and should be set to true if Ba is a Dirichlet operator, and to false otherwise, rightbdryisDirichlet, which is a Boolean variable and should be set to true if Bo is a Dirichlet operator, and to false otherwise, leftbdryvalue, which contains the value of ga, rightbdryvalue, which contains the value of 9 leftgamma, which contains the value of Ya, rightgamma, which contains the value of %. . As an example, construct a data of BVP, which has C [a,b] = (-2,3], k(x) 1 1+22 f(x) Bau= u(a), By = -K(b)u'(b), ga = 2,96 = -1. 1 + x2 In your MATLAB function, among other things, you should write bvpdata.domain = [-2 ; 3]; bvpdata.forcecoeff = Q(x) x./(1+x.^2); bvpdata.leftbdryisDirichlet = true; Of course, the rest of the fields must be completed. 2. Consider the setting for a two-point BVP: d (6(2) ) +r(a)u = f(x), (a,b), Bau=ga, Bb = 9b where the only unknown is the function u : [a, b] + R and the rest are data, i.e., ones provided by users. The operator Bm represents the boundary condition at m = a,b, which can be either Dirichlet: Bmu = u(m) or non-Dirichlet: Beu=k(a)u' (a) + Yau(a), Byu = -K(b)u'(6) + You(b). Note that when m = 0, a Neumann condition is recovered. Write a MATLAB function that creates all these data. Your MATLAB function should look like function [bvpdata] = set_bvp_data(), where it returns a structure array bvpdata. This structure should have the following fields: . . . domain, which contains [a, b], diffusioncoeff, which contains K, reactioncoeff, which contains r (if it exists in the problem), forcecoeff, which contains f (if it exists in the problem), leftbdryisDirichlet, which is a Boolean variable and should be set to true if Ba is a Dirichlet operator, and to false otherwise, rightbdryisDirichlet, which is a Boolean variable and should be set to true if Bo is a Dirichlet operator, and to false otherwise, leftbdryvalue, which contains the value of ga, rightbdryvalue, which contains the value of 9 leftgamma, which contains the value of Ya, rightgamma, which contains the value of %. . As an example, construct a data of BVP, which has C [a,b] = (-2,3], k(x) 1 1+22 f(x) Bau= u(a), By = -K(b)u'(b), ga = 2,96 = -1. 1 + x2 In your MATLAB function, among other things, you should write bvpdata.domain = [-2 ; 3]; bvpdata.forcecoeff = Q(x) x./(1+x.^2); bvpdata.leftbdryisDirichlet = true; Of course, the rest of the fields must be completed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions