日本語English

## カウンタ

 compteur (depuis le 1er décembre 2009)

## 電子講義集（全卓樹）

2019/12/12

#### 微分方程式特論２(12/13)

| by T_Zen
１２月１３日課題

dt\d x = a x + b y
dt\d y = c x + d y
を数値的に解くプログラムを作れ。この際a,b,c,dをスライドバーで変えることができて、絵画リアルタイムで変化するようにせよ。

ヒント；下のMathematicaのプラグラムをコピペして試してみよ。そして適宜書直せ。
------------------------------------------------------------------------------
(*Numerical solution of differential equation*)
(*T_Zen 11.12.R01*)

tx = 120;
a = 0.07; b = -1.5; c = 0.2; d = -0.1;

sol1 := NDSolve[{x'[t] == a x[t] + b y[t], y'[t] == c x[t] + d y[t],
x[0] == 5, y[0] == 4}, {x, y}, {t, 0, tx}];

vx = 2; vy = 6;

{Slider[Dynamic[a], {-3, 3}], "a: " Dynamic[a]}
{Slider[Dynamic[b], {-3, 3}], "b: " Dynamic[b]}
Dynamic[ParametricPlot[Evaluate[{x[t], y[t]} /. sol1], {t, 0, tx},
PlotRange -> {{-15, 15}, {-15, 15}}]]
------------------------------------------------------------------------------

------------------------------------------------------------------------------

さらに次の３つを続けざまに試してみよ
------------------------------------------------------------------------------
(*Numerical solution of differential equation*)
(*T_Zen 21.12.H28*)

tx = 120;
a = -1; b = -5; c = 5; d = -1;

sol1 := NDSolve[{x'[t] == a x[t] + b y[t], y'[t] == c x[t] + d y[t],
x[0] == 5, y[0] == 4}, {x, y}, {t, 0, tx}];

vx = 2; vy = 6;

{Slider[Dynamic[b], {-5, 5}], "b: " Dynamic[b]}
{Slider[Dynamic[c], {-5, 5}], "c: " Dynamic[c]}
Dynamic[ParametricPlot[Evaluate[{x[t], y[t]} /. sol1], {t, 0, tx},
PlotRange -> {{-5, 5}, {-5, 5}}]]
------------------------------------------------------------------------------

------------------------------------------------------------------------------
{Slider[Dynamic[b], {-5, 5}], "b: " Dynamic[b]}
{Slider[Dynamic[c], {-5, 5}], "c: " Dynamic[c]}
Dynamic[Plot[Evaluate[{x[t], y[t]} /. sol1], {t, 0, tx},
PlotRange -> {{0, tx/10}, {-2, 2}}]]
------------------------------------------------------------------------------

------------------------------------------------------------------------------
M = {{a, b}, {c, d}};
Print[M // MatrixForm];
Eigensystem[M]
------------------------------------------------------------------------------
 14:55 | Impressed! | Voted(10) | Comment(0) | 教育