hw10_p01RK4 - k42 = h*fxy2(t h Y1 k31 Y2 k32 k Y1new = Y1...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function [ Y1new, Y2new ] = hw10_p01RK4(h,t,Y1,Y2) k11 = h*fxy1(t,Y1,Y2); k12 = h*fxy2(t,Y1,Y2); k k21 = h*fxy1(t+h/2, Y1+k11/2, Y2+k12/2); k22 = h*fxy2(t+h/2, Y1+k11/2, Y2+k12/2); k k31 = h*fxy1(t+h/2, Y1+k21/2, Y2+k22/2); k32 = h*fxy2(t+h/2, Y1+k21/2, Y2+k22/2); k k41 = h*fxy1(t+h, Y1+k31, Y2+k32);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: k42 = h*fxy2(t+h, Y1+k31, Y2+k32); k Y1new = Y1 + 1/6*(k11 + 2*k21 + 2*k31 + k41); Y2new = Y2 + 1/6*(k12 + 2*k22 + 2*k32 + k42); Y function f_xy1 = fxy1(t, y1, y2) f_xy1 = y2; f function f_xy2 = fxy2(t, y1, y2) f_xy2 = 1E-7*(y1+273)^4 - 4*(150-y1);...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online