再仿真时候往往会生成超多的数据,有些数据对我们来说是有用的,有些数据对我们来说只是辅助我们不会去看他,那么怎么去保证仿真软件只保存我要的数据。
在LTspice 里面可以用.save 指令限制我们的保存数据量。 .save的描述如下
.SAVE -- Limit the Quantity of Saved Data
Some simulations, particularly time domain simulations, can generate large amount of data. The amount of output can be restricted by using the .save directive to save only the specific node voltages and device current of interest.
Syntax: .save V(out) [V(in) [I(L1) [I(S2)]]] [dialogbox]
The directive .save I(Q2) will save the base, collector and emitter currents of bipolar transistor Q2. To save a single terminal current, specify Ic(Q2).
The wildcard characters '*' and '?' can be used to specify data traces matching a pattern. For example, ".save V(*) Id(*)" will save every voltage and every drain current.
If the keyword "dialogbox" is specified, then a dialog box with a list of all-available default nodes and currents is displayed allowing the user to select from the list which should be saved. If the netlist was generated from a schematic, then nodes and devices can be pointed to and clicked on in the schematic to highlight them as selected in the dialog box.
|
所以实际应用到电路里那是什么样,见下图
仿真代码:
V1 Vpulse1 0 6
V2 Vpulse2 0 5
.tran 8m
.save V(Vpulse1)
.backanno
.end
|
在上面的图里面我只保留了Vpulse1的电压,其他什么也没有保留。所以我点Vpulse2那是没有什么反应的。但我们怎么判断Vpulse参与了仿真,我们可以做个简单的实验如下图。
测试电路如下
测试电路代码如下:
V1 Vpulse1 0 6
V2 Vpulse2 0 1
R1 Vpulse3 Vpulse1 500
R2 Vpulse2 Vpulse3 500
.tran 8m
.save V(Vpulse3)
.backanno
.end
|
可以看到Vpulse3的结果符合我们的设定值,所以可以利用.save 提高仿真效率