Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Euler-method/Factor/euler-method.factor
Normal file
17
Task/Euler-method/Factor/euler-method.factor
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
USING: formatting fry io kernel locals math math.ranges
|
||||
sequences ;
|
||||
IN: rosetta-code.euler-method
|
||||
|
||||
:: euler ( quot y! a b h -- )
|
||||
a b h <range> [
|
||||
:> t
|
||||
t y "%7.3f %7.3f\n" printf
|
||||
t y quot call h * y + y!
|
||||
] each ; inline
|
||||
|
||||
: cooling ( t y -- x ) nip 20 - -0.07 * ;
|
||||
|
||||
: euler-method-demo ( -- )
|
||||
2 5 10 [ '[ [ cooling ] 100 0 100 _ euler ] call nl ] tri@ ;
|
||||
|
||||
MAIN: euler-method-demo
|
||||
Loading…
Add table
Add a link
Reference in a new issue