-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathic
More file actions
executable file
·59 lines (53 loc) · 1.5 KB
/
Copy pathic
File metadata and controls
executable file
·59 lines (53 loc) · 1.5 KB
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
56
57
58
59
#!/bin/sh
#
# (c) 2018-2025 m4r35n357@gmail.com (Ian Smith), for licencing see the LICENCE file
echo "Sensitivity to Initial Conditions: [$0 $*]" >&2
tmpdir=${TMP_TAYLOR:-/tmp/$USER}
[ -d ${tmpdir} ] || mkdir ${tmpdir}
fileA=${tmpdir}/dataA
fileB=${tmpdir}/dataB
fileC=${tmpdir}/dataC
fileD=${tmpdir}/dataD
fileE=${tmpdir}/dataE
fileF=${tmpdir}/dataF
fileG=${tmpdir}/dataG
delta=$1
precision=$2
shift 2
perturb () {
start="$1 $2 $3 $4 $5"
x0=$6
y0=$7
z0=$8
shift 8
end="$*"
echo 'oo' $start $x0 $y0 $z0 $end >&2
$start $x0 $y0 $z0 $end >$fileG &
y=$y0
z=$z0
x=$(echo "scale=$precision; $x0 + $delta;" | /usr/bin/bc)
echo 'x+' $start $x $y $z $end >&2
$start $x $y $z $end >$fileA &
x=$(echo "scale=$precision; $x0 - $delta;" | /usr/bin/bc)
echo 'x-' $start $x $y $z $end >&2
$start $x $y $z $end >$fileB &
x=$x0
z=$z0
y=$(echo "scale=$precision; $y0 + $delta;" | /usr/bin/bc)
echo 'y+' $start $x $y $z $end >&2
$start $x $y $z $end >$fileC &
y=$(echo "scale=$precision; $y0 - $delta;" | /usr/bin/bc)
echo 'y-' $start $x $y $z $end >&2
$start $x $y $z $end >$fileD &
x=$x0
y=$y0
z=$(echo "scale=$precision; $z0 + $delta;" | /usr/bin/bc)
echo 'z+' $start $x $y $z $end >&2
$start $x $y $z $end >$fileE &
z=$(echo "scale=$precision; $z0 - $delta;" | /usr/bin/bc)
echo 'z-' $start $x $y $z $end >&2
$start $x $y $z $end >$fileF &
}
perturb $*
wait
./plot3d.py $fileA $fileB $fileC $fileD $fileE $fileF $fileG