REM ****** Setting up graphics ******
 
  CLS : SCREEN 9: PAINT (1, 1), 9
  xm = 3: tm = 5
  VIEW (180, 17)-(595, 330), 0, 13
  WINDOW (0, -xm)-(tm, xm)
  LINE (0, 0)-(tm, 0), 11: LINE (0, -xm)-(0, xm), 11
  LOCATE 12, 76: PRINT tm: LOCATE 1, 21: PRINT xm
 
REM ****** Function f(x,t) ******
 
  DEF fnf (x, t) = (1 + t) * x + 1 - 3 * t + t ^ 2
 
REM ****** Direction field ******

p = 25
  FOR x = xm TO -xm STEP -2 * xm / p
    FOR t = 0 TO tm STEP tm / p
      x1 = fnf(x, t) / xm: t1 = 2 / tm
      s = p * SQR(x1 ^ 2 + t1 ^ 2)
      x2 = fnf(x, t) / s: t2 = 1 / s
      LINE (t, x)-(t + t2, x + x2), 9
      CIRCLE (t + t2, x + x2), .003 * tm, 9
    NEXT t
  NEXT x

REM ****** Step-by-step method ******

DO
  t = 0: LOCATE 13, 1: INPUT "x0"; x
  h = .01
    DO
       GOSUB Euler
       t = t + h
       PSET (t, x), 14
    LOOP UNTIL ABS(t - tm) < h / 2 OR ABS(x) > xm
      LOCATE 19, 1: PRINT "t="; t
      LOCATE 20, 1: PRINT "x="; x
LOOP

REM ****** Subroutines ******

Euler:
   
    c1 = h * fnf(x, t)
    x = x + c1
    RETURN

This is Project 104

Proyecto Aves Icon
104 Birds Quiz is an identification game for Android
Snake Icon
Eh... the snake is a free videogame for Linux & Windows
RPNC104k Icon
104 RPN Calc is a Reverse Polish Notation calculator for Android
Anstoppable Icon
Anstoppable is a counter & stopwatch app for Android
Solarys Chat Icon
Solarys Chat is a local network chat
Solarys Calc Icon
Solarys Calc is a multiplatform calculator