RosettaCodeData/Task/Runge-Kutta-method/Jq/runge-kutta-method-2.jq
2017-09-25 22:28:19 +02:00

8 lines
175 B
Text

# yprime maps [t,y] to a number, i.e. t * sqrt(y)
def yprime: .[0] * (.[1] | sqrt);
# The exact solution of yprime:
def actual:
. as $t
| (( $t*$t) + 4 )
| . * . / 16;