hw10_p02RK4 - k42 = h*fxy2(t h ca k31 cb k32 cc k33 k43 =...

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

View Full Document Right Arrow Icon
function [ canew, cbnew, ccnew ] = hw10_p02RK4(h,t,ca,cb,cc) k11 = h*fxy1(t,ca,cb,cc); k12 = h*fxy2(t,ca,cb,cc); k13 = h*fxy3(t,ca,cb,cc); k k21 = h*fxy1(t+h/2, ca+k11/2, cb+k12/2, cc+k13/2); k22 = h*fxy2(t+h/2, ca+k11/2, cb+k12/2, cc+k13/2); k23 = h*fxy3(t+h/2, ca+k11/2, cb+k12/2, cc+k13/2); k k31 = h*fxy1(t+h/2, ca+k21/2, cb+k22/2, cc+k23/2); k32 = h*fxy2(t+h/2, ca+k21/2, cb+k22/2, cc+k23/2); k33 = h*fxy3(t+h/2, ca+k21/2, cb+k22/2, cc+k23/2); k k41 = h*fxy1(t+h, ca+k31, cb+k32, cc+k33);
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, ca+k31, cb+k32, cc+k33); k43 = h*fxy3(t+h, ca+k31, cb+k32, cc+k33); k canew = ca + 1/6*(k11 + 2*k21 + 2*k31 + k41); cbnew = cb + 1/6*(k12 + 2*k22 + 2*k32 + k42); ccnew = cc + 1/6*(k13 + 2*k23 + 2*k33 + k43); c function f_xy1 = fxy1(t, Ca, Cb, Cc) f_xy1 = -10*Ca*Cc + Cb; f function f_xy2 = fxy2(t, Ca, Cb, Cc) f_xy2 = 10*Ca*Cc - Cb; f function f_xy3 = fxy3(t, Ca, Cb, Cc) f_xy3 = -10*Ca*Cc + Cb - 2*Cc;...
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.

Ask a homework question - tutors are online