-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a simple non-iip `update` in Joseph form * Implement first simple version of the ManifoldUpdate callback * Format the files with JuliaFormatter.jl * Make the ManifoldUpdate callback an IEKF update
- Loading branch information
1 parent
4508747
commit cd0fea4
Showing
5 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
function ManifoldUpdate(residualf; maxiters=100, ϵ₁=1e-25, ϵ₂=1e-15) | ||
condition(u, t, integ) = true | ||
|
||
function affect!(integ) | ||
@unpack u = integ | ||
@unpack x, SolProj = integ.cache | ||
|
||
f(m) = residualf(SolProj * m) | ||
|
||
m, C = x | ||
m_i = copy(m) | ||
|
||
local m_i_new, C_i_new | ||
for i in 1:maxiters | ||
z = f(m_i) | ||
J = ForwardDiff.jacobian(f, m_i) | ||
S = X_A_Xt(C, J) | ||
|
||
m_i_new, C_i_new = update(x, Gaussian(z .+ (J * (m - m_i)), S), J) | ||
|
||
if norm(m_i_new .- m_i) < ϵ₁ && norm(z) < ϵ₂ | ||
break | ||
end | ||
m_i = m_i_new | ||
end | ||
copy!(x, Gaussian(m_i_new, C_i_new)) | ||
|
||
return nothing | ||
end | ||
return DiscreteCallback(condition, affect!) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd0fea4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
cd0fea4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/45992
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: