Question

ter Problems 1. Use finite differences to approximate solutions to the linear BVPs for n=9, 19, and 39. (a) | y = y + ſet {MATH LAB CODE PLS

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student,

Following is the answer:

(a) Consider the following linear Boundary Value Problem, y(0) = 0 »(1) =- The above differential equation at 1, in the discr

Here, ya and by are the boundary conditions.

Differentiate y, -(2+h?) w; -25% e + W, = 0) with respect to w; . Thus, -(2+h+)=0 y(0) = 0, y(1) --- Use the following MATLA

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function y=f(Winter, bv,n) y=zeros(n,1); h=(inter(2)-inter(1)/(n+1); y(1)=bv(1)-(2+h^2)*

HOME PLOTS APPS Ayon 2 County New New Open compare port Des We w e - - - - Users De MATLAB >> veloved to 1). 10 exp (1)/). 20

The resulting solution curve yt is :

CHU Times New Roman - 12 - File Edit View the Tool Detop Window Help AaB obce. A nd S . S Approximate solutions of BVP by the

The exact solution for the linear BVP Y = y + e,y(0) = 0, y(1)=-e is given by, v(t) = zce Use the following MATLAB program

for i=0:10 t(i+1)=t(i+1)+i/10; z(i+1)=z(i+1)+t(i+1)*exp(t(i+1))/3; end plot([a a+(1:n)*h b].[ya W yb]);hold on plot(t,z) xlaa(i,i+1)=1; a (i+1,1)=1; end Use the MATLAB command w=nlbvpfdia( [0 1],[0 exp(1)/3],9) to plot the approximate solutions toMARA 2013 HOME PLOTS APPS w e Es www Open de View that too Desktop Window DOBRODD Plot of the approximate and the exact solut

Use the following MATLAB program to calculate errors and make a semilog plot for the errors. This program is saved as nlbvpf

z(i)=z(i)+t(i)*exp(t1))/3; err(i)=err(i)+abs(w(1)-z(i)); end disp([ Errors=]) disp(err) semilogy(t.err) xlabel(t),ylabel(

end for i=1:n-1 a(i,i+1)=1; a (i+1,1)=1; end Use the MATLAB command w=nlbvpfdia( [01],[O exp(1)/3],9) to calculate errors a

MAR 2018 HOME PLOTS APPS s e Save New Come t de de view met Tool Desktop Window Help waa94. GOED A semilog plot for the error

(b) Consider the following linear Boundary Value Problem, y = (2+41?)y y(0)=1 y(1)=e The above differential equation at 1, i

Here, ya and by are the boundary conditions.

Use the following MATLAB program to approximate solutions for the linear BVP y = (2+41° ) y, y(0)=1, y(1)=e. This program is

y(1)=bv(1)-(2+2+h^2+4*h^4)*W(1)+W(2); y(n)=W(n-1)-(2+2*h^2+4**40*W(n)+bv(2); for i=2:n-1 y(i)=W(i-1)-(2+2*h^2+4*h^4)*W(1)+W(i

Consider n=9. Use the MATLAB command w=nlbvpfdib( [01],[1 exp(1)],9) to approximate solutions for the linear BVP y = (2+41

HOME APPS L PLOTS E compare Wate Aye Cute h oto 2 Community New New Open port Gew e - Ch . The Users De MATLAB 19EPAT I Error

The resulting solution curve y(t) is given below:

MARA 2013 HOME PLOTS APPS F porte e e t View It To Desktop Window Help New New Open compare Approximate solutions of BVP by t

The exact solution for the linear BVP y = (2+41?)y, y(0) = 1, y(1)= e is given by, y(t)=en Use the following MATLAB program

for i=0:10 t(i+1)=t(i+1)+i/10; z(i+1)=z(i+1)+exp(t(i+1)^2); end disp([The exact solutions are]) disp(z) plot([a a+(1:n)*h bfor i=1:n ali,i)=-2-2*h^2-4*h^4; end for i=1:n-1 a(i,i+1)=1; a (i+1,1)=1; end Use the MATLAB command w=nlbvpfdib( [01],[1 exONU File Edit View AaB BCAA and Tool Detop Window Help OR GOOD Plot of the approximate and the exact solutions AaB 1 e Same S

t(i)=t(i)+i/10; z(i)=z(i)+t(i)*exp(ti))/3; err(i)=err(i)+abs(w(1)-z(i)); end disp(Errors=]) disp(err) semilogy(t,err) xlabe

a(i,i)=-2-2*h^2-4*h^4; end for i=1:n-1 a(i,i+1)=1; a (i+1,1)=1; endUse the MATLAB command w=nlbvpfd1b2( [01],[1 exp(1)],9) to calculate errors and make a semilog plot for the errors. See theHU ... 1 AN File Edit View the Tool Desktop Window Help Times New Roman AaB chce. A nd S e Suite Change Select A semilog plot

Consider n=19 Use the MATLAB command w=nlbvpfdib( [01],[1 exp(1)],19) to approximate solutions for the linear BVP b) = 1, y(

ONU File Edit View the Tool Desktop Window Help AdD ABG ABOCA Approximate solutions of BVP by the Finite Differrace Method Ap

Consider n = 39 Use the MATLAB command w=nlbvpfdi( [01],[1 exp(1)],39) to approximate solutions for the linear BVP y = (2+

MARA 2013 HOME PLOTS APPS F www com Nome mot Save e e t View It To Desktop Window Help waaASSO926.& DEOD Approximate solution

Add a comment
Know the answer?
Add Answer to:
MATH LAB CODE PLS ter Problems 1. Use finite differences to approximate solutions to the linear...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT