A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
9
Task/Euler-method/J/euler-method-1.j
Normal file
9
Task/Euler-method/J/euler-method-1.j
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
NB.*euler a Approximates Y(t) in Y'(t)=f(t,Y) with Y(a)=Y0 and t=a..b and step size h.
|
||||
euler=: adverb define
|
||||
'Y0 a b h'=. 4{. y
|
||||
t=. i.@>:&.(%&h) b - a
|
||||
Y=. (+ h * u)^:(<#t) Y0
|
||||
t,.Y
|
||||
)
|
||||
|
||||
ncl=: _0.07 * -&20 NB. Newton's Cooling Law
|
||||
16
Task/Euler-method/J/euler-method-2.j
Normal file
16
Task/Euler-method/J/euler-method-2.j
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
ncl euler 100 0 100 2
|
||||
... NB. output redacted for brevity
|
||||
ncl euler 100 0 100 5
|
||||
... NB. output redacted for brevity
|
||||
ncl euler 100 0 100 10
|
||||
0 100
|
||||
10 44
|
||||
20 27.2
|
||||
30 22.16
|
||||
40 20.648
|
||||
50 20.1944
|
||||
60 20.0583
|
||||
70 20.0175
|
||||
80 20.0052
|
||||
90 20.0016
|
||||
100 20.0005
|
||||
Loading…
Add table
Add a link
Reference in a new issue