Rev 587 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download
#fituje harmonicke oscilace. vysledek ulozi ve formatu PostScript
#
set terminal postscript # nastavi format vystupniho souuboru
set samples 2000 # udava rozliseni Xve osy
set key off # vypne legendu v grafu
set xlabel "time [s]"
set ylabel "amplitude [1]"
set output "osc1.ps"
f(x)=a*exp(-d*x)*sin(o*x+fi)+s
s=1913
#d=0.1
a=500
o=14
fi=pi
fit f(x) "osc1.txt" using 1:2 via a, d, o,fi ,s
plot f(x), "osc1.txt" using 1:2
pause 1
set output "osc2.ps"
f(x)=a*exp(-d*x)*sin(o*x+fi)+s
s=1913
#d=0.1
a=500
o=14
fi=pi
fit f(x) "osc2.txt" using 1:2 via a, d, o,fi ,s
plot f(x), "osc2.txt" using 1:2
pause 1
set output "osc3.ps"
f(x)=a*exp(-d*x)*sin(o*x+fi)+s
s=1913
#d=0.1
a=500
o=14
fi=pi
fit f(x) "osc3.txt" using 1:2 via a, d, o,fi ,s
plot f(x), "osc3.txt" using 1:2
pause 1
#prevod Postscriptu do PDF nutno mit nainstalovany program ps2pdf.
!ps2pdf osc1.ps
!ps2pdf osc2.ps
!ps2pdf osc3.ps