summaryrefslogtreecommitdiffstats
path: root/fiz/vaje/4
diff options
context:
space:
mode:
Diffstat (limited to 'fiz/vaje/4')
-rw-r--r--fiz/vaje/4/makefile12
-rwxr-xr-xfiz/vaje/4/preseki.py2
2 files changed, 13 insertions, 1 deletions
diff --git a/fiz/vaje/4/makefile b/fiz/vaje/4/makefile
new file mode 100644
index 0000000..1def3b5
--- /dev/null
+++ b/fiz/vaje/4/makefile
@@ -0,0 +1,12 @@
+default: dokument.pdf
+
+dokument.pdf: dokument.lyx v_od_x.tsv
+ lyx -e pdf dokument.lyx
+
+v_od_x.tsv: nihanje.tsv preseki.py
+ ./preseki.py > $@
+
+clean:
+ rm -f v_od_x.tsv dokument.pdf
+
+.PHONY: default clean
diff --git a/fiz/vaje/4/preseki.py b/fiz/vaje/4/preseki.py
index 7a35c66..bafcec7 100755
--- a/fiz/vaje/4/preseki.py
+++ b/fiz/vaje/4/preseki.py
@@ -22,4 +22,4 @@ zero_crossings_v = numpy.where(numpy.diff(numpy.sign(v)))[0]
print("v\tx\tt\tabsx\tln")
for i in range(len(zero_crossings_x)-1):
print(f"{v[zero_crossings_x[i]]}\t{x[zero_crossings_v[i]]}\t{t[zero_crossings_v[i]]}\t{abs(x[zero_crossings_v[i]])}\t{log(abs(x[zero_crossings_v[i]])/0.0943867)}")
-print(f"za {len(zero_crossings_x/2)} nihajev je preteklo {t[zero_crossings_x[len(zero_crossings_x)-1]]-t[zero_crossings_x[0]]} sekund, zato je nihajni čas {(t[zero_crossings_x[len(zero_crossings_x)-1]]-t[zero_crossings_x[0]])/(len(zero_crossings_x)/2)}", file=stderr)
+print(f"za {len(zero_crossings_x/2)} nihajev je preteklo {t[zero_crossings_x[len(zero_crossings_x)-1]]-t[zero_crossings_x[0]]} sekund, zato je nihajni cas {(t[zero_crossings_x[len(zero_crossings_x)-1]]-t[zero_crossings_x[0]])/(len(zero_crossings_x)/2)}", file=stderr)