hw10_p04RK4 - k42 = h*fxy2(t+h, Y1+k31, Y2+k32,k,D); k...

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

View Full Document Right Arrow Icon
function [ Y1new, Y2new ] = hw10_p04RK4(h,t,Y1,Y2,k,D) k11 = h*fxy1(t,Y1,Y2); k12 = h*fxy2(t,Y1,Y2,k,D); 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,D); 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,D); 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,D); 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, k, D) f_xy2 = k*y1/D;...
View Full Document

This note was uploaded on 02/22/2010 for the course CHE 348 taught by Professor Chelikowsky during the Spring '08 term at University of Texas at Austin.

Ask a homework question - tutors are online