Answers

May 08, 2020 - 07:30 PM
Try this:
#STORAGE REAL:2
#LOCAL REAL X_OLD
#LOCAL REAL Y_OLD
X_OLD = STORF(NSTORF)
Y_OLD = STORF(NSTORF+1)
IF (TIMEZERO) Y_OLD = $Y0
$Y = Y_OLD + ($X + X_OLD)*0.5*DELT
STORF(NSTORF) = $X
STORF(NSTORF+1) = $Y
NSTORF = NSTORF+2
#STORAGE REAL:2
#LOCAL REAL X_OLD
#LOCAL REAL Y_OLD
X_OLD = STORF(NSTORF)
Y_OLD = STORF(NSTORF+1)
IF (TIMEZERO) Y_OLD = $Y0
$Y = Y_OLD + ($X + X_OLD)*0.5*DELT
STORF(NSTORF) = $X
STORF(NSTORF+1) = $Y
NSTORF = NSTORF+2

May 10, 2020 - 02:04 PM
Please choose my answer as the best answer if it has satified your needs as this will help other users in the future.
Add New Comment