-
Notifications
You must be signed in to change notification settings - Fork 0
/
sm.converge.txt
55 lines (54 loc) · 1.2 KB
/
sm.converge.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /bin/sh
wait=$1
date=`date '+%D %H:%M'`
sm -s << FIN
if ($wait) {xterm_p} else {laser_pp converge.ps\n lweight 2}
# running this with argument 10 will put the plot on your screen and
# keep it there for 10 seconds. Running it with argument 0 will
# produce a postscript file called converge.ps. If you change
# "laser_pp converge.ps" to "laser_p", then running with 0 will
# send output straight to your default printer. Note that "p"
# indicates portrait mode; "l" for landscape and "s" for square
# are also options.
twowin 1
expand 0.95
limits 0.5 -5 -6 0
box
define iexact (2.*(1.-1.0/sqrt(5.0)))
da euler.out
read {n 1 h 2 i 3}
set ferr=lg(abs(i/\$iexact-1.0))
connect (lg(h)) ferr
echo
print {n h i ferr}
echo
ltype 2
da trapzd.out
read {n 1 h 2 i 3}
set ferr=lg(abs(i/\$iexact-1.0))
connect (lg(h)) ferr
echo
print {n h i ferr}
echo
ltype 1
da simpson.out
read {n 1 h 2 i 3}
set ferr=lg(abs(i/\$iexact-1.0))
connect (lg(h)) ferr
echo
print {n h i ferr}
echo
ltype 0
limits 0 10 0 10
urlinlbl 9.25 0 Euler
urlinlbl 8.50 2 Trapezoidal
urlinlbl 7.75 1 Simpson
relocate 5 -1.8
putlabel 5 log h
relocate -1.8 5
angle 90
putlabel 5 log(|I/I_{exact}-1|)
angle 0
putdate "$date"
if ($wait) {!sleep $wait} else {hardcopy}
FIN