Find Docs

Astronomical Applications Department, U.S. Naval Observatory - Linear Least Squares (Page 10)

Wodocs >> Science : Astronomy >> Astronomical Applications Department, U.S. Naval Observatory Linear Least Squares Page 10
Astronomical Applications Department, U.S. Naval Observatory - Linear Least Squares
:=
foo
(
)
optimize
(
)
makeproc
,
tmp
=
parameters [
]
, ,
N y t
foo
, ,
N y t
proc
(
)
:=
local
;
,
, , , ,
,
t8 t11 t4 t5 t1 tmp t2
:=
tmp
(
)
array ..
1 2 ;
:=
t1
(
)
sum
,
[ ]
y i
=
i
..
1 N ;
:=
t2
(
)
sum
,
^
[ ]
t i 2
=
i
..
1 N ;
:=
t4
(
)
sum
,
[ ]
t i
=
i
..
1 N ;
:=
t5
(
)
sum
,
[ ]
t i
[ ]
y i
=
i
..
1 N ;
:=
t8
^
t4 2;
:=
t11
/
(
)
1
- +
t8
t2 N ;
:=
[ ]
tmp 1
(
)
-
t1 t2
t4 t5 t11;
:=
[ ]
tmp 2
(
)
-
t5 N
t4 t1 t11;
tmp
end
(
)
writeto "d:/Maple/test.p"
(
)
print foo
(
)
writeto terminal
This is simple and straightforward in this example. Later on, we will see that the solutions can get
rather unwieldy, but that the optimized procedures created from them are still relatively simple.
Polynomial of degree 2
:=
printlevel
2




leastsqrs
, , ,
=
Y
+
+
A B t
i
C t
i
2
t i [
]
, ,
A B C
leastsqrs[0]: normal equations
=
-
+
+
+
2 S
0
2 A N 2 B T
1
2 C T
2
0
=
-
+
+
+
2 S
1
2 A T
1
2 B T
2
2 C T
3
0
=
-
+
+
+
2 S
2
2 A T
2
2 B T
3
2 C T
4
0
leastsqrs[0]: Solving the normal equations...
leastsqrs[0]: substitution list
2


=
i 1
N
t
i


=
i 1
N
t
i
2


=
i 1
N
t
i
3


=
i 1
N
t
i
3 2
N


=
i 1
N
t
i
2 3


=
i 1
N
t
i
4
N


=
i 1
N
t
i
2
-
+
+
-
=



=
i 1
N
t
i
4


=
i 1
N
t
i
2
+
=
S
0
=
i 1
N
Y
i
=
T
1
=
i 1
N
t
i
=
T
2
=
i 1
N
t
i
2
=
S
1
=
i 1
N
t
i
Y
i
=
T
3
=
i 1
N
t
i
3
,
,
,
,
,
,
Page 10

<< Previous       1 .. 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17       Next >>



Other Documents:
Sensitivity Integral, 3 D plot fits, lyap2, NAO 150, Rotate Vector, lyapcalc, wedges, Scifull, Precession Memo, Precession Maple, Curves 3 D, NOVAS 2004 Overview, NOVAS 2006 Overview, thesis, Ranson,


WODocs | |
All rights reserved. wodocs.com© 2009
WODocs


New Docs

Documents Category:
Arts (Design, Movies, Music, Radio, Television)
Automotive (Cars, Marine, Motorcycle, ATV, Snowmobiles)
Business (Biotechnology and Pharmaceuticals, Chemicals, Construction and Maintenance, Materials, Real Estate, Services)
Electronics (Computers, Motion Control, Power Supply)
Games (Board, Family, Party, Card, Construction, RC Toys)
Health (Animalm, Beauty, Healthcare, Medicine, Pharmacy, Surgery, Weight Loss)
Home (Accessories, Cooking, Decor and Design, Electrical, Family, Pets)
News (Newspapers, Sports, Television)
Recreation (Collecting, Hiking, Scouting, Survival, Travel)
Reference (Education, Libraries and Archives, Museums)
Science (Agriculture, Astronomy, Biology, Chemistry)
Shopping (Antiques and Collectibles, Clothing, Flowers, Food, Home and Garden)
Sports (Bicycle, Snowboard, Skiing, Other)