diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2023-05-07 23:49:10 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2023-05-07 23:49:10 +0200 |
commit | 13275eab2786c5cc8c6f14c226cc9e5ab4a0ec2f (patch) | |
tree | 5c72944ac0cf473516e8fd26a56f98ab4a6bb3bf /fiz/vaje/4 | |
parent | zgo zadnji test (upam) (diff) | |
download | sola-gimb-4-13275eab2786c5cc8c6f14c226cc9e5ab4a0ec2f.tar sola-gimb-4-13275eab2786c5cc8c6f14c226cc9e5ab4a0ec2f.tar.gz sola-gimb-4-13275eab2786c5cc8c6f14c226cc9e5ab4a0ec2f.tar.bz2 sola-gimb-4-13275eab2786c5cc8c6f14c226cc9e5ab4a0ec2f.tar.lz sola-gimb-4-13275eab2786c5cc8c6f14c226cc9e5ab4a0ec2f.tar.xz sola-gimb-4-13275eab2786c5cc8c6f14c226cc9e5ab4a0ec2f.tar.zst sola-gimb-4-13275eab2786c5cc8c6f14c226cc9e5ab4a0ec2f.zip |
Diffstat (limited to 'fiz/vaje/4')
-rw-r--r-- | fiz/vaje/4/makefile | 12 | ||||
-rwxr-xr-x | fiz/vaje/4/preseki.py | 2 |
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) |