Differential Equations with Linear Algebra This is kind of like an instruction..
ID: 3110644 • Letter: D
Question
Differential Equations with Linear Algebra
This is kind of like an instruction...you do not need the pages to solve my question
6. Use the third-order Runge-Kutta method with h = 0.1 to obtain the values for the problem
You have to find the values from x = 1.0 to x = 2.0( please show your work) Thank you
Section 8.3: Runge-Kutta Methods Read from page 389 to page 392. Use the second-order Runge-Kutta formula (8.7 (page 390) (ko kl) n-1 where n-1) and ko) h, w n-1, w the third-order Runge-Kutta formula (8.8) (page 391) (ko 4k1 k2) n-1 where ko 1, wn-1) ko) ko) h, w 2k and the fourth-order Runge-Kutta formula (8.9) (page 391) (ko 2k1 2k2 kits) n-1 where ko 1, wi n-1) ko) n-1 n-1 n-1 -t h, un-1 k2) with the initial value wo yo to solve an initial value problem of the form 2, y with the initial condition y(ro) yo. Make sure to read and try the example (on page 390) provided in the section to understand what to compute for the assigned exercises. Round to five decimal places.Explanation / Answer
Here is the Matlab code:
clear all
format long
P=10;
h=0.1;
X(1)=1.0;
Y(1)=-2;
f=@(x,y) 3*x^2-y/x;
for n=1:P
X(n+1)=X(n)+h;
k0=h*f(X(n),Y(n));
k1=h*f(X(n)+h/2,Y(n)+k0/2);
k2=h*f(X(n)+h,Y(n)+2*k1-k0);
Y(n+1)=Y(n)+(1/6)*(k0+4*k1+k2);
end
x y
1 -2
1.10000000000000 -1.50175000000000
1.20000000000000 -0.995666666666667
1.30000000000000 -0.467634615384615
1.40000000000000 0.0937142857142862
1.50000000000000 0.697916666666668
1.60000000000000 1.35325000000000
1.70000000000000 2.06710294117647
1.80000000000000 2.84622222222222
1.90000000000000 3.69688157894737
2.00000000000000 4.62500000000000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.