Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
x3domlet
Commits
2c2f02f7
Commit
2c2f02f7
authored
Sep 26, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests
parent
aa894976
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
5 deletions
+60
-5
numbers.calculus.extra.js
js/numbers/numbers.calculus.extra.js
+60
-5
No files found.
js/numbers/numbers.calculus.extra.js
View file @
2c2f02f7
...
...
@@ -228,8 +228,6 @@ numbers.calculus.GaussNewton_forHeading = function(v,n,r,dr,eps,w){
rs1
=
[]
diff
=
[]
var
reiterate
=
false
for
(
var
i
=
0
;
i
<
n
;
i
++
){
rs0
.
push
(
r
(
i
,
v0
))
rs1
.
push
(
r
(
i
,
v1
))
...
...
@@ -238,7 +236,6 @@ numbers.calculus.GaussNewton_forHeading = function(v,n,r,dr,eps,w){
console
.
log
(
"V1:"
)
console
.
log
(
v1
)
console
.
log
(
"residuals old:"
)
console
.
log
(
rs0
)
console
.
log
(
"residuals new:"
)
...
...
@@ -403,8 +400,13 @@ numbers.calculus.GaussNewton_forHeading = function(v,n,r,dr,eps,w){
numbers
.
calculus
.
GaussNewton_nD
=
function
(
v
,
n
,
r
,
dr
,
eps
,
w
){
console
.
log
(
"GaussNewton_nD"
)
// degrees
var
STEP_SIZE_LIMIT
=
10
var
epsilon
=
eps
||
1
e
-
8
var
limit
=
100
0
var
limit
=
5
0
var
stop
=
false
var
counter
=
0
...
...
@@ -423,13 +425,64 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
}
}
console
.
log
(
"V0:"
)
console
.
log
(
v0
)
var
history
=
[]
while
(
!
stop
){
counter
++
var
v1
=
iterate
(
v0
,
n
,
r
,
dr
,
w
)
//console.log(v1);
rs0
=
[]
rs1
=
[]
diff
=
[]
for
(
var
j
=
0
;
j
<
xn
;
j
++
){
for
(
var
i
=
0
;
i
<
n
;
i
++
){
rs0
.
push
(
r
[
j
](
i
,
v0
))
rs1
.
push
(
r
[
j
](
i
,
v1
))
diff
.
push
(
r
[
j
](
i
,
v1
)
-
r
[
j
](
i
,
v0
))
}
}
console
.
log
(
"V1:"
)
console
.
log
(
v1
)
console
.
log
(
"residuals old:"
)
console
.
log
(
rs0
)
console
.
log
(
"residuals new:"
)
console
.
log
(
rs1
)
console
.
log
(
"difference:"
)
console
.
log
(
diff
)
var
max
=
Math
.
max
(...
diff
)
var
sscale
=
1
;
if
(
max
>
STEP_SIZE_LIMIT
){
console
.
log
(
"LAT or LON EXCEEDED STEP SIZE"
)
sscale
=
STEP_SIZE_LIMIT
/
max
;
}
if
((
v1
[
2
]
-
v0
[
2
])
>
STEP_SIZE_LIMIT
){
console
.
log
(
"DELTA HEADING EXCEEDED STEP SIZE"
)
sscale
=
STEP_SIZE_LIMIT
/
(
v1
[
2
]
-
v0
[
2
]);
}
if
(
sscale
!=
1
){
console
.
log
(
"SCALE = "
+
sscale
)
for
(
var
i
=
0
;
i
<
v0
.
length
;
i
++
){
v1
[
i
]
=
v0
[
i
]
+
sscale
*
(
v1
[
i
]
-
v0
[
i
])
}
console
.
log
(
"Corrected V1:"
)
console
.
log
(
v1
)
}
var
s0
=
sigma
(
v0
,
n
,
r
,
w
)
var
s1
=
sigma
(
v1
,
n
,
r
,
w
)
...
...
@@ -439,10 +492,12 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
}
v0
=
v1
history
.
push
(
v1
)
}
return
{
history
:
history
,
count
:
counter
,
error
:
s1
,
v
:
v0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment