回路図エディタの起動
$ gschem &
適当に回路図を作ってセーブする。名前は適当 test.sch とか。
spice用のネットリスト作成
$ gnetlist -g spice-sdb -o test.net test.sch
エラーがでるときは、 -v をつけると何かわかるかも。
ngspice起動
$ ngspice
ネットリスト読み込み
ngspice> source test.net
過渡解析 (横軸時間、縦軸出力の解析)
ngspice> tran 0.01ms 0.2ms
意味は、過渡解析、インターバル0.01ms、解析終了時間 0.2ms
結果のグラフ表示
ngspice> plot n1 n2 n3
n1, n2, n3 は、回路図で定義した、回路上の点。
ngspiceのヘルプ
ngspice> help
ヘルプウィンドがあがる。
source コマンドのヘルプは、Subtopics: INTERACTIVE INTERPRETER / COMMAND / Sourceにある。
tran コマンドのヘルプは、Subtopics: ANALYSES AND OUTPUT CONTROL / ANALYSES / .TRANにある。
ngspice> help tran
とかでもOK
あと、ngspice の対話シェルでは、カーソルキーが使えないので注意。
代わりに、history や、! が使える。csh 風みたい。