Question

5. (20 points) Prepare the necessary equations by hand and create a matlab script that solves the follo- wing non-linear BVP.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

lo lo 3 limenMatlab code

clc
clear all
n=10;
h=1/n;
x=0:h:0.9;
x=x'
A=full(gallery('tridiag',n,-1,2,-1))
v=zeros(n,1);
for k=1:20
v=-h.^2*inv(A)*(3*v+x.^2+10*v.^3);
end
%end
v

Output

x =

0
0.1000
0.2000
0.3000
0.4000
0.5000
0.6000
0.7000
0.8000
0.9000


A =

2 -1 0 0 0 0 0 0 0 0
-1 2 -1 0 0 0 0 0 0 0
0 -1 2 -1 0 0 0 0 0 0
0 0 -1 2 -1 0 0 0 0 0
0 0 0 -1 2 -1 0 0 0 0
0 0 0 0 -1 2 -1 0 0 0
0 0 0 0 0 -1 2 -1 0 0
0 0 0 0 0 0 -1 2 -1 0
0 0 0 0 0 0 0 -1 2 -1
0 0 0 0 0 0 0 0 -1 2


v =

-0.0048
-0.0098
-0.0149
-0.0201
-0.0250
-0.0291
-0.0315
-0.0313
-0.0271
-0.0173

Add a comment
Know the answer?
Add Answer to:
5. (20 points) Prepare the necessary equations by hand and create a matlab script that solves the follo- wing non-l...
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