RosettaCodeData/Task/Euler-method/11l/euler-method.11l

12 lines
239 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
F euler(f, y0, a, b, h)
V t = a
V y = y0
L t <= b
print(#2.3 #2.3.format(t, y))
t += h
y += h * f(t, y)
V newtoncooling = (time, temp) -> -0.07 * (temp - 20)
euler(newtoncooling, 100.0, 0.0, 100.0, 10.0)