1 answer

The colde provided solbe)() 1, y(5).nthe ntred aproimation o 100 no y value prob 1) -1. บู(5) -2,...

Question:

Please provide me the maximum computed y vector for the given domain

The colde provided solbe)() 1, y(5).nthe ntred aproimation o 100 no y value prob 1) -1. บู(5) -2, on the interval-rousing a c

The colde provided solbe)() 1, y(5).nthe ntred aproimation o 100 no y value prob 1) -1. บู(5) -2, on the interval-rousing a centred approximation of the derivative term and N-100 nodes. dr2 Matlab code for the solution of Module 2 3 xright-5; 4 N 188: 5 x=linspace(xleft , X right ,N); 6 x-x"; %this just turns x into a column vector 7 dx = (xright-xleft)/(N-1); %1f theres N nodes, theres N-1 separations 9 yright-2; 10 11 붜 here is the matrix which when multiplied by the vector y approxinates y"(x) numerically for all the INTERNAL nodes. 12 M (diag(-2ones (N,1,diag(ones (N-1,1),-1)+diag(ones(N-1,1),1))x2; 13 14 %updating the matrix to treat the boundaries differently 15 M( 1 , :)=[1, zeros(1,N-1)]; 16 M(end,:[zeros(1,N-1)11: 17 18 %The RHS vector (dont forget to sort out the boundaries separately), 19 bx."2.*cos(x) 29 b(1)= ylett; 21 bend) yright; 23 %solve Modify this code to solve the following problem and answer the associated question. d'y dy 0.5) = 1· y( 1 .5 = 1 on 0,5cxci 5 with 20 nodes. What is the maximum of the computed y vector on this domain, accurate to 3 decimal places do not round)? Hint1: First plot your solution to see if the boundaries look right Hint2: Assume an ODE of the form: y- /(r) The transformation matrices are: M2 (diag(-2 ones(N,1),0)+ diag(ones(N -1,1),-1) + diag(ones(N-11),1))/dr M1-(diag(ones(N -1,1,)-diag(ones(N 11),-1/(2 dz); M0 = eye(N);

Answers

I have implemented the code as required. I have attached the code as well as the screenshot with output.

Code:

clc
xleft = 0.5;
xright = 1.5;
N = 20;
x = linspace(xleft,xright,N);
x = x';
dx = (xright - xleft)/(N-1);
yleft = 1;
yright = 1;
M2 = (diag(-2*ones(N,1),0) + diag(ones(N-1,1),-1)+diag(ones(N-1,1),1))/dx^2;
M1 = (diag(ones(N-1,1),1) - diag(ones(N-1,1),-1))/(2*dx);
M0 = eye(N);
M = 1*M2 + 1*M1 + 3*M0;

b = log(x)./x;
b(1) = yleft;
b(end) = yright;

y = M\b;
fprintf('The maximum value of vector y in this domain is: %.3f\n',max(y));
plot(x,y)
title('y" + y'' + 3*y = log(x) for x = (0.5,1.5)')
xlabel('x')
ylabel('y')

Screenshot:

Editor- DAPrograms MATLAB boundaryValue.m boundaryValue.m x+ clc xleft -0.5 right = 1.5; N-20; xlinspace (xleft, xright,N); F

.

Similar Solved Questions

1 answer
Develop expressions for the current i flowing through each of the circuits illustrated in Figure 4....
Develop expressions for the current i flowing through each of the circuits illustrated in Figure 4. The expressions should only contain known values (i.e., parameters or constant voltage values) and time. wwww (b) FIGURE 4 - Equivalent external circuits : (a) charge phase and (b) discharge phase....
1 answer
NeptBune, Inc. has 175,000 shares of stock outstanding at a market price of $59 a share....
NeptBune, Inc. has 175,000 shares of stock outstanding at a market price of $59 a share. The company has just announced a 3-for-2 stock split How many shares of stock will be outstanding after the split? Select one a 350,000 shares b. 87,500 shares C 262,500 shares d 116,667 shares...
1 answer
Using the data from FRED, enter the values for the second quarters of 2018 and 1987...
Using the data from FRED, enter the values for the second quarters of 2018 and 1987 for the M1 and M2 velocity of money: (Enter your responses exactly as they appear in FRED) M1 Velocity M2 Velocity Year-Month-Day (M1V) 2018-04-01 5.581 1987-04-01 6.457 1.734 M2V) 1.454 Using the data above and the ...
1 answer
Write down problem number. Provide formula, HDI value, and a complete, chemically correct structure for each...
Write down problem number. Provide formula, HDI value, and a complete, chemically correct structure for each problem. Assign signals in the 1H and 13C spectra to specific atoms, identify structural units and/or functional groups. Example: Problem # 3 Formula: C8H8O2 HDI: 5 1H NMR: p-substituted...
1 answer
Calculate: ROI, Profit Margin, and Investment turnover for each division in the above question Hammer Time...
Calculate: ROI, Profit Margin, and Investment turnover for each division in the above question Hammer Time Asia has three divisions China, Thailand, and Japan The following are the income statement information for each division China Thailand Revenue 23,000,000 2,700,000 Operating exp 13,800,000 1,4...
1 answer
Denver Mountain Company Trial Balance 11/30/17 Dr 272,000 114,500 TH9 1,000 50,000 55,000 62,000 75,000 32,000...
Denver Mountain Company Trial Balance 11/30/17 Dr 272,000 114,500 TH9 1,000 50,000 55,000 62,000 75,000 32,000 100,000 12,000 18,000 26,250 Cash Accounts Receivable Allowance for Doubtful Accounts Short Term Note Receivable Supplies Inventory Equipment Building Accumulated Depreciation Copyright Acc...
1 answer
Average rate of change
how to find average rate of change of f(x) between x=2.72 and x=20.09...
1 answer
The slide shows for health people 2020, so what would be the answer for question 4?...
the slide shows for health people 2020, so what would be the answer for question 4? Goals e Health Promotion and disease prevention arena e Incorporate prevention, access, treatment, and follow-up at the individual, family, provider, work site, and community levels. s the ufrects of dise QUESTI...
1 answer
13. When using PP&E as the forecast driver for depreciation, which of the following is most...
13. When using PP&E as the forecast driver for depreciation, which of the following is most accurate? a) From both an ideal and a practical standpoint, the driver should be net PP&E. b) From both an ideal and a practical standpoint, the driver should be gross PP&E. c) Ideally, the driver...
1 answer
Where do the following occur in a cell? a) Glycolysis b) Citric Acid Cycle c) Oxidative...
Where do the following occur in a cell? a) Glycolysis b) Citric Acid Cycle c) Oxidative Phosphorylation d) Carbon Fixation...
1 answer
Question 1: Compute graphically the convolution, f(t) fit) f2(t), of the following two time-functions (t) and...
Question 1: Compute graphically the convolution, f(t) fit) f2(t), of the following two time-functions (t) and f2(t). Sketch your final result f(t)· (Hint: To avoid having to do twice as many calculations, you may want to use these properties of convolution: the distributive and the shift prop...
1 answer
Hing a) ee s ives folowin) 디
hing a) ee s ives folowin) 디...
1 answer
EXERCISE 4: (30 MARKS) Given the following circuit in figure 3 of a flash analog-to-digital converter...
EXERCISE 4: (30 MARKS) Given the following circuit in figure 3 of a flash analog-to-digital converter where VREF = 2.8V. Op-amp comparators Analog input Priority encoder A A 8. Parallel binary output A A A Sampling A pulses Figure 3 - Circuit of exercise 4 a) Determine the resolution of this convert...