Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Euler-method/Smalltalk/euler-method.st
Normal file
13
Task/Euler-method/Smalltalk/euler-method.st
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
ODESolver>>eulerOf: f init: y0 from: a to: b step: h
|
||||
| t y |
|
||||
t := a.
|
||||
y := y0.
|
||||
[ t < b ]
|
||||
whileTrue: [
|
||||
Transcript
|
||||
show: t asString, ' ' , (y printShowingDecimalPlaces: 3);
|
||||
cr.
|
||||
t := t + h.
|
||||
y := y + (h * (f value: t value: y)) ]
|
||||
|
||||
ODESolver new eulerOf: [:time :temp| -0.07 * (temp - 20)] init: 100 from: 0 to: 100 step: 10
|
||||
Loading…
Add table
Add a link
Reference in a new issue