Question

3. Constler the folloving nitial valse proble dy Take one stop of the modified Euler8 nelloul Un+,-di +습 (J(z,la) + f(m+1 la

i need the code for this question please
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB Code:

close all
clear
clc

x0 = 1;
y0 = 1; % y(1) and y1 = y(1.2)
h = 0.2;
x1 = x0 + h;
f = @(x,y) cos(x*y);
eqn = @(y1) y1 - ( y0 + (h/2) * (f(x0,y0) + f(x1,y1)) ); % eqn. that needs to be solved
y1 = fsolve(eqn, 0); % with initial guess of y1 = 0
disp('y(1.2) ='), disp(y1)

Output:

y(1.2) =
1.0810

Add a comment
Know the answer?
Add Answer to:
i need the code for this question please 3. Constler the folloving nitial valse proble dy Take one stop of the modified Euler8 nelloul Un+,-di +습 (J(z",la) + f(m+1 lat)) with h 0.2 o find t...
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