Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -6,20 +6,20 @@ TR := 20.0;
|
|||
k := 0.07;
|
||||
|
||||
main(args(2)) :=
|
||||
let
|
||||
results[i] := euler(newtonCooling, T0, 100, stringToInt(args[i]), 0, "delta_t = " ++ args[i]);
|
||||
in
|
||||
delimit(results, '\n');
|
||||
let
|
||||
results[i] := euler(newtonCooling, T0, 100, stringToInt(args[i]), 0, "delta_t = " ++ args[i]);
|
||||
in
|
||||
delimit(results, '\n');
|
||||
|
||||
newtonCooling(t) := -k * (t - TR);
|
||||
|
||||
euler: (float -> float) * float * int * int * int * char(1) -> char(1);
|
||||
euler(f, y, n, h, x, output(1)) :=
|
||||
let
|
||||
newOutput := output ++ "\n\t" ++ intToString(x) ++ "\t" ++ floatToString(y, 3);
|
||||
newY := y + h * f(y);
|
||||
newX := x + h;
|
||||
in
|
||||
output when x > n
|
||||
else
|
||||
euler(f, newY, n, h, newX, newOutput);
|
||||
let
|
||||
newOutput := output ++ "\n\t" ++ intToString(x) ++ "\t" ++ floatToString(y, 3);
|
||||
newY := y + h * f(y);
|
||||
newX := x + h;
|
||||
in
|
||||
output when x > n
|
||||
else
|
||||
euler(f, newY, n, h, newX, newOutput);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue