JSFH
Application of Picard's method to solve the Cauchy problem:
dx(t) / dt = x(t)^2,
x(0) = x0 (x0 = 1)
An automated procedure is used for Picard's iterations
Number of iterations:
restart;
N := 10; U := Array(1..N);
un := x0;
printlevel := 0;
for i from 1 to N do
unp1 := simplify(x0 + int(un^2,t=0..T)):
un := subs(T=t,unp1):
U[i] := un;
end do;
Final solution
sort(collect(un,t),t,ascending);
Exact solution:
xt := x0/(1-t*x0);
taylor(xt,t=0,8);
nn := 2;
xt0 := subs(x0=1,xt): u10 := subs(x0=1,U[1*nn]): u20 := subs(x0=1,U[2*nn]): u30 := subs(x0=1,U[3*nn]): u40 := subs(x0=1,U[4*nn]): u50 := subs(x0=1,U[5*nn]):
plot([xt0,u10,u20,u30,u40,u50],t=0..0.9,color=[red,blue,black,green,yellow,magenta], thickness = [3,1,1,1,1,1]);
with(plots):
logplot([abs(u10-xt0),abs(u20-xt0),abs(u30-xt0),abs(u40-xt0),abs(u50-xt0)],t=0...1,numpoints = 10,color=[red,blue,black,green,yellow]);
JSFH