読み書きプログラミング

日常のプログラミングで気づいたことを綴っています

(46) 線形回路の定常解析

以下のようなLCR回路の周波数応答を考えます。

V1からV2を求める問題です。方程式を書き下すと、

周波数領域でMaximaに解かせてみましょう。

/* 8.1.3m */
output : solve([%e ^ (%i * w * t) - v2 * %e ^ (%i * w * t) = i0 * %e ^ (%i * w * t) * r,
  i0 = i1 + i2,
  c * diff(v2 * %e ^ (%i * w * t), t) = i1 * %e ^ (%i * w * t),
  l * diff(i2 * %e ^ (%i * w * t), t) = v2 * %e ^ (%i * w * t)], [v2, i0, i1, i2])$
ratsimp(output)$
v2 : at(v2, %[1]);

V2のV1に対する周波数応答がわかったので、特定のパラメータを例にBode線図を書いてみましょう。

/* 8.1.5m */
plot2d(makelist(at(cabs(v2), [c = 10 ^ (-6), l = 10 ^ (-3), r = 10 ^ s]), s, makelist(2 + 0.3 * i, i, 0, floor((4 - 2) / 0.3))), [w, 20000, 40000], [y, 0, 1], [gnuplot_preamble, "set nokey"]);

plot2d(makelist(at(carg(v2), [c = 10 ^ (-6), l = 10 ^ (-3), r = 10 ^ s]), s, makelist(2 + 0.3 * i, i, 0, floor((4 - 2) / 0.3))), [w, 20000, 40000], [y, -%pi, %pi], [gnuplot_preamble, "set nokey"]);


通常、Bode線図は、ゲインについて、対数グラフを取りますが、ここでは線形スケールを使ったことに注意してください。