Subversion Repositories svnkaklik

Rev

Rev 619 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
619 kaklik 1
#fituje harmonicke oscilace. vysledek ulozi ve formatu PostScript
2
# 
3
 
4
set terminal postscript # nastavi format vystupniho souuboru
5
set samples 2000 	# udava rozliseni Xve osy  
6
set key off	# vypne legendu v grafu
585 kaklik 7
set xlabel "time [s]"
8
set ylabel "amplitude [1]"
9
 
619 kaklik 10
set output "osc1.ps"	
584 kaklik 11
f(x)=a*exp(-d*x)*sin(o*x+fi)+s
12
s=1913
585 kaklik 13
#d=0.1
14
a=500
584 kaklik 15
o=14
585 kaklik 16
fi=pi
17
 
587 kaklik 18
fit f(x) "osc1.txt" using 1:2 via a, d, o,fi ,s 
19
plot f(x), "osc1.txt" using 1:2
585 kaklik 20
pause 1
21
 
22
set output "osc2.ps"
23
f(x)=a*exp(-d*x)*sin(o*x+fi)+s
24
s=1913
25
#d=0.1
26
a=500
27
o=14
28
fi=pi
29
 
30
fit f(x) "osc2.txt" using 1:2 via a, d, o,fi ,s 
31
plot f(x), "osc2.txt" using 1:2
32
pause 1
33
 
34
set output "osc3.ps"
35
f(x)=a*exp(-d*x)*sin(o*x+fi)+s
36
s=1913
37
#d=0.1
38
a=500
39
o=14
40
fi=pi
41
 
42
fit f(x) "osc3.txt" using 1:2 via a, d, o,fi ,s 
43
plot f(x), "osc3.txt" using 1:2
44
pause 1
45
 
619 kaklik 46
#prevod Postscriptu do PDF nutno mit nainstalovany program ps2pdf.
47
 
587 kaklik 48
!ps2pdf osc1.ps
49
!ps2pdf osc2.ps
50
!ps2pdf osc3.ps
585 kaklik 51