Astronomical Applications Department, U.S. Naval Observatory Linear Least Squares Page 17
4
=
i 1
N
(
)
sin
t
i
(
)
cos
t
i
=
i 1
N
(
)
cos
t
i
3
(
)
sin
t
i
+
=
i 1
N
(
)
sin
t
i
(
)
cos
t
i
2
-
=
S
0
=
i 1
N
Y
i
=
T
0
=
i 1
N
(
)
cos
t
i
4
=
T
1
=
i 1
N
(
)
cos
t
i
2
,
,
,
,
=
T
2
=
i 1
N
(
)
cos
t
i
3
(
)
sin
t
i
=
T
3
=
i 1
N
(
)
sin
t
i
(
)
cos
t
i
,
,
=
S
1
=
i 1
N
Y
i
(
)
sin
t
i
(
)
cos
t
i
=
T
4
=
i 1
N
(
)
sin
t
i
2
(
)
cos
t
i
2
=
S
2
=
i 1
N
Y
i
(
)
cos
t
i
2
,
,
leastsqrs[1]: Verifying the solution...
=
A
-
+
+
S
0
T
4
(
)
-
+
2 T
2
T
3
S
1
2 S
2
T
4
,
=
B
+
+
-
T
2
1
2
T
3
S
0
-
+
2 T
0
2 T
1
1
2
N S
1
(
)
-
+
2 T
2
T
3
S
2
:=
tmp
(
)
array
(
)
map
,
x
( )
rhs x
(
)
eval
,
% _subslist
(
)
optimize
(
)
makeproc
,
tmp
=
parameters [
]
, ,
N Y t
, ,
N Y t
proc
(
)
local
;
, , , ,
, , , ,
,
,
,
,
tmp t1 t2 t8 t14 t7 t6 t4 t10 t17 t21 t27 t25
:=
tmp
(
)
array ..
1 2 ;
:=
t1
(
)
sum
,
[ ]
Y i
=
i
..
1 N ;
:=
t2
(
)
sum
,
^
(
)
sin
[ ]
t i
2
^
(
)
cos
[ ]
t i
2
=
i
..
1 N ;
:=
t4
(
)
sum
,
^
(
)
cos
[ ]
t i
3
(
)
sin
[ ]
t i
=
i
..
1 N ;
:=
t6
(
)
sum
,
(
)
sin
[ ]
t i
(
)
cos
[ ]
t i
=
i
..
1 N ;
:=
t7
- +
2 t4 t6;
:=
t8
(
)
sum
,
[ ]
Y i
(
)
sin
[ ]
t i
(
)
cos
[ ]
t i
=
i
..
1 N ;
:=
t10
(
)
sum
,
[ ]
Y i
^
(
)
cos
[ ]
t i
2
=
i
..
1 N ;
:=
t14
(
)
sum
,
^
(
)
cos
[ ]
t i
4
=
i
..
1 N ;
:=
t17
(
)
sum
,
^
(
)
cos
[ ]
t i
2
=
i
..
1 N ;
:=
t21
^
t4 2;
:=
t25
^
t6 2;
:=
t27
/
(
)
1
-
+
-
+
-
4
t2 t14 4
t17 t2
N t2 4 t21 4
t6 t4 t25 ;
:=
[ ]
tmp 1
(
)
-
+
+
t1 t2
t7 t8 2
t10 t2 t27;
Page 17