given system of ODE:
function dy=fun(y)
dy=[0 -y(1) -sin(y(1)+y(2)) ; y(1) 0 -1 ; sin(y(1)+y(2)) 1 0];
with RK4 method:
function yout=RK4(y,h,f)
hF1 = h*f(y);
hF2 = h*f(y+hF1/2);
hF3 = h*f(y+hF2/2);
hF4 = h*f(y+hF3);
yout= y+(hF1+2*(hF2+hF3)+hF4)/6;
1) Why this problem preserves the invariant y1^2+y2^2+y3^2? (short answer question)
2) I want to solve given problem using RK4 mathod (matalb)
3) I want to solve given problem using Gauss 2 (matlab)
given that Gauss2 has the tableau in the form (which is order 2 implicit RK method)
1/2-sqrt(3)/6 | 1/4 (space) 1/4-sqrt(3)/6
1/2+sqrt(3)/6 | 1/4+sqrt(3)/6 (space) 1/4
----------------------------------------------------------
(space)(space) |1/2 (space)(space)1/2
Help please!