Stefan Schippers
12/15/2023, 2:55 PMappendwrite
must be set after the wrdata
, otherwise your text.txt file keeps growing.
For saving temperature I add the following device (vsource_arith.sym
in xschem):
et temperat 0 vol='temper'
and use temperat
as the variable to save.
test.cir
test
.param VCCGAUSS=agauss(3, 0.2, 1)
.param TEMPGAUSS = agauss(40, 30, 1)
v1 1 0 'VCCGAUSS'
r1 1 0 1k
et temperat 0 vol='temper'
.option temp = 'TEMPGAUSS'
.option savecurrents
.control
set wr_vecnames
set wr_singlescale
let run = 0
dowhile run < 10
reset
save all
op
remzerovec
wrdata ~/test.txt i(v1) v(1) temperat
if run eq 0
set appendwrite
set wr_vecnames = FALSE
end
let run = run + 1
end
.endc
test.txt
V(1) i(v1) v(1) temperat
2.45772633e+00 -2.45772633e-03 2.45772633e+00 3.78824124e+01
3.10929679e+00 -3.10929679e-03 3.10929679e+00 5.60570694e+01
3.17694682e+00 -3.17694682e-03 3.17694682e+00 6.36589293e+01
3.30505948e+00 -3.30505948e-03 3.30505948e+00 -8.22103055e+00
2.82714181e+00 -2.82714181e-03 2.82714181e+00 5.38148760e+01
3.04629013e+00 -3.04629013e-03 3.04629013e+00 8.11912411e+01
2.67778127e+00 -2.67778127e-03 2.67778127e+00 4.24921319e+01
2.76318961e+00 -2.76318961e-03 2.76318961e+00 4.48915296e+01
3.19722314e+00 -3.19722314e-03 3.19722314e+00 -7.51519555e+00
3.26020513e+00 -3.26020513e-03 3.26020513e+00 4.25405339e+01