This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
print("哈囉!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
for (var i = 0; i < 4; i++) { | |
print('hello $i'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// f 為沿位移方向的施力 | |
// dx/dt = v, dv/dt = (f-kx-bv)/m | |
// dx / dt = (t - x)/2, 起始值 t0=0, x0=1, 求 t=2 時的 x 值 | |
// | |
// 已知起始值 t0 與 x0 後, 可以利用下列 rungeKutta 函式, 以 | |
// h 為每步階增量值, 求 dxdt 常微分方程式任一 t 的對應值 x | |
// 定義函式 rungeKutta, 共有四個輸入變數 | |
// 物體質量 | |
const num m = 1; | |
// 對質量的施力 f |