F(i+1) = (F(i) + F(i+2))/2 -H(i)*(h/2)*(F(i+1)-F(i)) +(h^2)*(G(i)^2) - (h^2)*(F(i)^2) + (h^2)*(S/2)*((((i*h)+1)/2)*((F(i+1)-F(i))/h)+F(i)) - (h^2)*(k/2)*(((G(i+1)-G(i))/h)^2 - ((F(i+1)-F(i))/h)^2+2*F((F(i) -2*F(i+1) + F(i+2))/h^2));
G(i+1) = 2*G(i) - G(i+2) -(h/2)*H(i)*(G(i+1)-G(i+2)) + 2*F(i)*G(i) - (h^2)*S*(((i*h+1)/2)*((G(i+1)-G(i+2))/2*h)+G(i)) + (h^2)*2*k*(F(i)*((G(i+1) -2*G(i) + G(i+2))/h^2) - ((F(i+1)-F(i+2))/2*h)*((G(i+1)-G(i+2))/2*h));
theta(i+1) = 2*theta(i) - theta(i+2) + Pr*(h/2)*(theta(i+1)-theta(i+2)) - Pr*(h^2)*S*(((i*h+1)/2)*((theta(i+1)-theta(i+2))/2*h)+alpha1*theta(i)) + zeta*((theta(i+1) -2*theta(i) + theta(i+2))/h^2 - 2*F(i)*G(i)*((theta(i+1)-theta(i+2))/2*h)); phi(i+1) = 2*phi(i) - phi(i+2) + Sc*(h/2)*(theta(i+1)-theta(i+2)) - Sc*(h^2)*S*(((i*h+1)/2)*((phi(i+1)-theta(i+2))/2*h)+alpha2*phi(i)) + Sc*(h^2)*gamma*phi(i);
Line 1:
You forgot the loop index i you refer to:
2*F((F(i) -2*F(i+1) + F(i+2))/h^2));
Line 1,2 and 3:
You reference array elements of F, G and theta on the right-hand sides that are not yet defined:
If you define F(i+1), G(i+1) and theta(i+1), the expressions on the right-hand side can only reference F(k), G(k) and theta(k) with k < i+1.
Lines 2 and 3:
If you use /2*h, you want to divide by 2*h, but you divide by 2 and multiply the resulting expression by h. Use /(2*h) instead.