summaryrefslogtreecommitdiff
path: root/413/CH6/EX6.5/Table_6_4.sce
blob: 50ef64a56ee20cefff2a90d1859c98695d6bf540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
clc
clear 
x=[0 0.1 0.2 0.3 0.4 0.5 0.6]
h=0.1
y(1,1)=-1
for i=1:6
    k1(1,i)=h*(-2*x(1,i)-y(1,i))
    k2(1,i)=h*(-2*(x(1,i)+h/2)-(y(1,i)+k1(1,i)/2))
    k3(1,i)=h*(-2*(x(1,i)+h/2)-(y(1,i)+k2(1,i)/2))
    k4(1,i)=h*(-2*(x(1,i)+h)-(y(1,i)+k3(1,i)))
    kA(1,i)=(k1(1,i)+2*k2(1,i)+2*k3(1,i)+k4(1,i))/6
    y(1,i+1)=y(1,i)+kA(1,i)
end
for i=1:6
T=[x(1,i), y(1,i), k1(1,i),k2(1,i),k3(1,i),k4(1,i),kA(1,i)]
disp(T)
end