Question

Consider the linear equation Y ′(x) = λY (x) + (1 − λ) cos(x) − (1...

Consider the linear equation
Y ′(x) = λY (x) + (1 − λ) cos(x) − (1 + λ) sin(x), quadY (0) = 1

. The true solution is Y (x) = sin(x) + cos(x). Solve this problem using Euler’s method with several values of λ and h, for 0 ≤ x ≤ 10. Comment on the results.

(a) λ = −1; h = 0.5, 0.25, 0.125 (b) λ = 1; h = 0.5,0.25,0.125

(c) λ = −5; h = 0.5, 0.25, 0.125, 0.0625 (d) λ=5;h=0.0625

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

(a) del, -1h=0.5 y(a) = = -1 YOU +(-1) COS(W) + -(1+61)) Biu(3) > Ya)=-461) +2 Costa) Yo1 Y=1, to=o. foc.Y) = - YOU) + 2 CUa) % Euler Method clear all clc; format short for k=1:3 lambda=-1 h=1/24k f=@(X,Y)lambda*Y+(1-lambda)*cos(x)- (1+lambda)*sin(x_Y_TrueSol = 0 1.0000 1.0000 0.5000 1.5000 1.3570 1.0000 1.6276 1.3818 1.5000 1.3541 1.0682 2.0000 0.7478 0.4932 2.5000 -0.01.5000 1.2011 1.0682 1.7500 0.9362 0.8057 2.0000 0.6130 0.4932 2.2500 0.2517 0.1499 2.5000 -0.1253 -0.2027 2.7500 -0.4946 -0.b) % Euler Method clear all clc; format short for k=1:3 lambda=1 h=1/24k f=@(X,Y)lambda*Y+(1-lambda)*cos(x)- (1+lambda)*sin(x0.5000 1.5000 1.3570 1.0000 1.7706 1.3818 1.5000 1.8144 1.0682 2.0000 1.7241 0.4932 2.5000 1.6768 -0.2027 3.0000 1.9168 -0.842.0000 1.2464 0.4932 2.2500 1.1033 0.1499 2.5000 0.9901 -0.2027 2.7500 0.9384 -0.5426 3.0000 0.9822 -0.8489 3.2500 1.1572 -1.h = 0.1250 X_Y_TrueSol = 0 1.0000 1.0000 0.1250 1.1250 1.1169 0.2500 1.2345 1.2163 0.3750 1.3269 1.2968 0.5000 1.4012 1.35704.0000 1.2562 -1.4104 4.1250 1.6024 -1.3866 4.2500 2.0108 -1.3411 4.3750 2.4859 -1.2746 4.5000 3.0325 -1.1883 4.6250 3.6560 -8.5000 182.6340 0.1965 8.6250 205.2636 0.0203 8.7500 230.7422 -0.1561 8.8750 259.4288 -0.3301 9.0000 291.7268 -0.4990 9.1250

Here I have done for 1st two cases.

Thank you so much sir

Add a comment
Know the answer?
Add Answer to:
Consider the linear equation Y ′(x) = λY (x) + (1 − λ) cos(x) − (1...
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