Euler Method Practical
Euler Method Practical
Euler’s Method
dy
Ques.1;Approximate the solution of = x + 2 y, with 0£x£1, y(0)=0 using four steps.
dx
Do@xnew = xold + h;
ynew = yold + h * Hf . 8x ® xold, y ® yold<L;
sollist = Append@sollist, 8xnew, ynew<D;
xold = xnew;
yold = ynew, 8steps<D;
Return@sollistDD
Out[18]= 880, 0<, 80.25, 0.<, 80.5, 0.0625<, 80.75, 0.21875<, 81., 0.515625<<
dy y
Ques.2;Approximate the solution of = 1 + , with 1£x£6, y(1)=1 using 10 steps.
dx x
Do@xnew = xold + h;
ynew = yold + h * Hf . 8x ® xold, y ® yold<L;
sollist = Append@sollist, 8xnew, ynew<D;
xold = xnew;
yold = ynew, 8steps<D;
Return@sollistDD
dy y
Ques.3;Approximate the solution of = , with 0£x£5, y(0)=1 using 10 steps.
dx x
2 Untitled-1
Do@xnew = xold + h;
ynew = yold + h * Hf . 8x ® xold, y ® yold<L;
sollist = Append@sollist, 8xnew, ynew<D;
xold = xnew;
yold = ynew, 8steps<D;
Return@sollistDD
dy
Ques.4;Approximate the solution of = xy3 - y, with 0£x£1, y(0)=1 using 4 steps.
dx
Do@xnew = xold + h;
ynew = yold + h * Hf . 8x ® xold, y ® yold<L;
sollist = Append@sollist, 8xnew, ynew<D;
xold = xnew;
yold = ynew, 8steps<D;
Return@sollistDD