Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Linearization and Mode-Shape Capabilities (and more) #373

Merged
merged 106 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from 149 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
6fa9273
broken: started adding changes for mode-shape visualization
bjonkman Apr 15, 2019
940b95f
Merge remote-tracking branch 'NREL/dev' into f/ModesViz
bjonkman Jun 20, 2019
b050870
Merge branch 'f/FloatingLin' into f/Envision-linear
bjonkman Jun 20, 2019
9892f76
Merge branch 'f/FloatingLin' into f/Envision-linear
bjonkman Jul 19, 2019
202bad9
Merge remote-tracking branch 'NREL/dev' into f/Envision-linear
bjonkman Jul 19, 2019
c6c40cb
update formatting and removed unnecessary variables in HD
bjonkman Jul 19, 2019
15deec0
Registry updates (+ corresponding change in NWTC Library)
bjonkman Jul 19, 2019
2cd45dd
fix syntax in UnsteadyAero.vfproj file
bjonkman Nov 12, 2019
f95b4d6
Merge remote-tracking branch 'NREL/dev' into f/Airfoil-interp
bjonkman Nov 14, 2019
f2892ca
Merge branch 'f/Airfoil-interp' into f/Linear
bjonkman Nov 15, 2019
118db2d
Update Registry and NWTC Library
bjonkman Nov 15, 2019
8885d9b
Merge branch 'f/Envision-linear' into f/Linear
bjonkman Nov 15, 2019
8b10bd2
Sync HydroDyn
bjonkman Nov 15, 2019
f7c5119
Sync ElastoDyn
bjonkman Nov 15, 2019
30e4fd9
Sync AeroDyn
bjonkman Nov 15, 2019
6e66429
fix length of AD all nodes output names
bjonkman Nov 15, 2019
18f9366
Sync AeroDyn driver
bjonkman Nov 15, 2019
f005362
Sync BeamDyn
bjonkman Nov 16, 2019
8ed374f
Sync ServoDyn
bjonkman Nov 16, 2019
4955d0f
SrvD: fix issue if only one blade is used
bjonkman Dec 3, 2019
d121b62
SrvD linear bug fix: units on YawMomCom
bjonkman Dec 3, 2019
3c247cd
Sync FAST library
bjonkman Dec 4, 2019
a821f71
Merge remote-tracking branch 'NREL/dev' into b/Envision-UA
bjonkman Dec 4, 2019
d65ce0d
Merge branch 'b/Envision-UA' into f/Linear
bjonkman Dec 5, 2019
09fcd62
Update autogenerated _Types.f90 files
bjonkman Dec 5, 2019
d67d308
BD docs [bug fix]: Update example input files
bjonkman Dec 5, 2019
1e85ffb
Merge remote-tracking branch 'NREL/dev' into f/Linear
bjonkman Dec 10, 2019
986e9bb
NWTC_Lib: add code to write binary files with more than 10-char headers
bjonkman Dec 10, 2019
12f3ef2
remove unused variables
bjonkman Dec 10, 2019
204da80
docs: update NREL 5MW damping in BD input file
bjonkman Dec 10, 2019
132444c
removed more unused variables
bjonkman Dec 10, 2019
ee37085
Updates to python scripts for regression tests
bjonkman Dec 11, 2019
3d79060
Merge branch 'b/manual_reg_test' into f/Linear
bjonkman Dec 11, 2019
6369282
NWTC Library: removed OutParmFFType
bjonkman Dec 11, 2019
eeace1e
Allow channel lengths up to 20 characters
bjonkman Dec 12, 2019
7cfafbf
Sync FAST_Prog
bjonkman Dec 12, 2019
b6cf2d3
regression test plots: fix syntax
bjonkman Dec 16, 2019
81c370f
Add AllBldNdOuts for ElastoDyn
bjonkman Dec 17, 2019
b64b54c
Update documentation for nodal outputs
bjonkman Dec 17, 2019
cd7a15d
sync OutListParameters.xlsx
bjonkman Dec 17, 2019
df31182
update prefix of AeroDyn channels in nodal output
bjonkman Dec 17, 2019
45f9d0f
Fix plot labels
bjonkman Dec 17, 2019
5f8ecc8
Merge branch 'b/Reg-Test-Plots' into f/Linear
bjonkman Dec 17, 2019
e15e964
update comments
bjonkman Dec 18, 2019
070dbfc
Merge remote-tracking branch 'NREL/dev' into f/Linear
bjonkman Dec 18, 2019
5e1604f
Merge remote-tracking branch 'NREL/dev' into f/Linear
bjonkman Dec 30, 2019
ec59dd9
Merge remote-tracking branch 'NREL/dev' into f/Linear
bjonkman Jan 14, 2020
2b1f7fd
Update of VS solution
ebranlard Jan 15, 2020
b325244
Merge pull request #8 from ebranlard/f/Linear
bjonkman Jan 15, 2020
3ee30af
Merge remote-tracking branch 'bjonkman/f/Linear' into f/Linear
bjonkman Jan 15, 2020
3b50028
docs: updated api_change.rst
bjonkman Jan 16, 2020
7e7393b
Error handling: write info message
bjonkman Jan 16, 2020
f5997c6
Merge remote-tracking branch 'NREL/dev' into f/Linear
bjonkman Jan 20, 2020
57efb70
Linear: update code for testing OLD_AD_LINEAR
bjonkman Jan 23, 2020
e1cd5f8
docs: fixed some spelling errors
bjonkman Jan 23, 2020
a53a1e7
AD: removed some unused code
bjonkman Jan 28, 2020
5651d13
Registry: fix issue with multi-dimension arrays in extrap/interp routine
bjonkman Feb 4, 2020
5a27563
Fix driver builds
bjonkman Feb 18, 2020
8262753
HD inputs from ED set before option 1 solve in fixed-bottom cases.
bjonkman Mar 9, 2020
b432f33
update comment
bjonkman Mar 25, 2020
c0beb20
Merge remote-tracking branch 'NREL/dev' into f/Linear
bjonkman Mar 31, 2020
fc15a8e
merge from OpenFAST/dev
bjonkman Apr 18, 2020
58d4a8c
minor update to batch file in vs-build
bjonkman Apr 17, 2020
07ff3b5
add backup xlsx file type to gitignore
bjonkman Apr 18, 2020
63de719
Minor updates
bjonkman Apr 18, 2020
d4254d6
ED linear: fix issue with rotations on blade mesh with TrimSolution
bjonkman May 12, 2020
89b1c69
Merge remote-tracking branch 'NREL/dev' into f/Linear
bjonkman May 13, 2020
66e308e
Merge remote-tracking branch 'NREL/dev' into f/Linear
bjonkman May 13, 2020
862d753
update r-test
bjonkman May 14, 2020
3ad48d2
fix typos
bjonkman May 19, 2020
89f4cd3
AD bug fix: return DTAero to glue code
bjonkman May 26, 2020
87f9162
FAST: put all modules' initialization data in a type
bjonkman May 26, 2020
09d5d3c
fix syntax in regression test python script
bjonkman Jun 8, 2020
50f854c
Merge remote-tracking branch 'NREL/dev' into f/Linear
bjonkman Jun 9, 2020
306e04a
ExtPtfm: move lapack interfaces to NWTC_LAPACK
bjonkman Jun 9, 2020
f85ff06
Fix index for BD current input OP in TrimSolution and mode shape
bjonkman Jun 11, 2020
766b9cc
Merge remote-tracking branch 'NREL/dev' into f/Linear
bjonkman Jun 16, 2020
41d39b6
Bug fix: AddOrSub2Pi had infinite loop if angles were exactly pi apart
bjonkman Jun 16, 2020
81930bc
Change github action to only list names of files that are different
andrew-platt Jun 18, 2020
c9c25b2
Change warning on nodal outputs, update tests
andrew-platt Jun 22, 2020
b3d70a8
Update 5MW_Land_BD_DLL_WTurb test case results
andrew-platt Jun 22, 2020
3e9dc0e
Merge pull request #10 from andrew-platt/f/Linear
bjonkman Jun 23, 2020
ce5acab
Updated reg-test
andrew-platt Jun 23, 2020
4132035
[BugFix] unitialized WaveDir when no waves
andrew-platt Jun 23, 2020
9df32ac
HD bug fix: WaveDir isn't always initialized
bjonkman Jun 23, 2020
b32598c
Make mode-shape input files specified relative to the input file
bjonkman Jun 23, 2020
9e6602e
Undo previous commit on setting wavedir (wrong location)
andrew-platt Jun 23, 2020
071b6d7
Merge remote-tracking branch 'andrew-platt/f/Linear' into f/Linear
bjonkman Jun 23, 2020
4c7e6b4
Merge remote-tracking branch 'bjonkman/f/Linear' into f/Linear
andrew-platt Jun 23, 2020
8a7a605
Merge branch 'f/Linear' of github.com:bjonkman/openfast into f/Linear
andrew-platt Jun 23, 2020
6a68cb7
Minor docs formatting so sphinx doesn't complain
andrew-platt Jun 23, 2020
d603d0e
Update API changes doc for HAWC wind (PR #437)
andrew-platt Jun 23, 2020
66565f4
Merge remote-tracking branch 'OpenFAST/dev' into f/Linear
andrew-platt Jun 25, 2020
5e3e535
Nodal outputs: minor error handling updates
andrew-platt Jun 25, 2020
e2e116c
Nodal Outputs: documentation on ElastoDyn Nodal Outputs
andrew-platt Jun 25, 2020
fd03306
Reg test: Update the linearization output format
rafmudaf Jun 25, 2020
b89ae35
Nodal Outputs: finalize documentation for nodal outputs
andrew-platt Jun 25, 2020
ad1dd86
Merge pull request #11 from rafmudaf/f/Linear
bjonkman Jun 25, 2020
f7345f2
Merge pull request #12 from andrew-platt/f/Linear
bjonkman Jun 25, 2020
4e23ee5
Fix copy-paste errors in documentation
bjonkman Jun 25, 2020
b775d2b
Remove DBG_OUTS from AD15
andrew-platt Jun 26, 2020
4d2ecb4
Merge pull request #13 from andrew-platt/f/AD15_remove_DBG_OUTS
bjonkman Jun 26, 2020
beea788
Documentation error.
andrew-platt Jun 26, 2020
c0167e9
Merge pull request #14 from andrew-platt/f/Linear
bjonkman Jun 26, 2020
4a81a85
Update r-test commit
rafmudaf Jul 13, 2020
62369e4
Merge pull request #17 from rafmudaf/pr373
bjonkman Jul 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions .github/actions/compile-and-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,9 @@

FROM rafmudaf/openfast-ubuntu:dev

# Move into the openfast directory and update
# Move into the openfast directory
WORKDIR /openfast
RUN git fetch
RUN git pull
RUN git submodule update

# Move into the "build" directory and compile
WORKDIR /openfast/build
RUN cmake ..
RUN make -j4 install
COPY entrypoint.sh /entrypoint.sh

# Run the tests

# BeamDyn-specific tests
RUN ctest -VV -j7 -R bd_
RUN ctest -VV -R beamdyn_utest

# OpenFAST linearization tests
RUN ctest -VV -j4 -L linear

# Subset of OpenFAST regression tests; do not run
## - 3, 4, 7, 14, 15, 16, since the free yaw is not well trusted
## - 9 because its super sensitive
## - 19, 20 because theyre too long
RUN ctest -VV -j8 -I 1,1,1,2,5,6,8,10,11,12,13,17,18,21,22,23,24,25
ENTRYPOINT ["/entrypoint.sh"]
52 changes: 52 additions & 0 deletions .github/actions/compile-and-test/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

cd /openfast

git fetch origin ${GITHUB_REF}:CI
git checkout CI
git submodule update

# Display the current git info
echo git-status from openfast:
git status

echo git-log from openfast:
git log -1

cd /openfast/reg_tests/r-test
echo git-status from r-test:
git status

echo git-log from r-test:
git log -1

cd /openfast

# Display the differences between this commit and `dev`
echo git-diff from ${GITHUB_REF} to dev:
git diff dev

# Move into the "build" directory, remove the old reg tests, and compile
cd /openfast/build
rm -rf reg_tests
cmake ..
make -j4 install

# Run the tests

# NWTC Library tests
ctest -VV -R nwtc_library_utest

# BeamDyn-specific tests
ctest -VV -j7 -R bd_
ctest -VV -R beamdyn_utest

# OpenFAST linearization tests
# Dont run these in parallel, copying the case files can fail in a race condition
ctest -VV -L linear

# Subset of OpenFAST regression tests; do not run
## - 9, 16 because they're very sensitive
## - 19, 20 because theyre too long
## - 17, 22, 23 becuase we dont know why they fail :(
ctest -VV -j8 -I 1,1,1,2,3,4,5,6,7,8,10,11,12,13,14,15,18,21,24,25
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ vs-build/

# backup files
*.asv
~$*.xlsx

# LaTeX compiling files
*.aux
*.nlo
*.log
18 changes: 6 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
OpenFAST
========

|travisci| |nbsp| |rtfd|
|actions| |nbsp| |rtfd|

.. |travisci| image:: https://travis-ci.org/OpenFAST/openfast.svg?branch=dev
:target: https://travis-ci.org/OpenFAST/openfast
.. |actions| image:: https://github.com/openfast/openfast/workflows/OpenFAST%20Build%20and%20Test/badge.svg?branch=dev
:target: https://github.com/OpenFAST/openfast/actions?query=workflow%3A%22OpenFAST+Build+and+Test%22
:alt: Build Status
.. |rtfd| image:: https://readthedocs.org/projects/openfast/badge/?version=dev
:target: https://openfast.readthedocs.io/en/dev
Expand All @@ -29,7 +29,7 @@ FAST v8 - OpenFAST v0.1.0
The transition from FAST v8 to OpenFAST v0.1.0 represents the effort to better
support an open-source developer community around FAST-based aero-hydro-servo-
elastic engineering models of wind-turbines and wind-plants. OpenFAST is the
next generation of FAST analysis tools. More inforation is available in the
next generation of FAST analysis tools. More information is available in the
`transition notes <http://openfast.readthedocs.io/en/latest/source/user/fast_to_openfast.html>`_.

FAST v8 is a computer-aided engineering tool for simulating the coupled dynamic
Expand Down Expand Up @@ -112,17 +112,11 @@ Details for compiling
`compiling <http://openfast.readthedocs.io/en/latest/source/install/index.html>`_,
`using <http://openfast.readthedocs.io/en/latest/source/user/index.html>`_, and
`developing <http://openfast.readthedocs.io/en/latest/source/dev/index.html>`_
OpenFAST on Unux-based and Windows machines are available at `readthedocs <http://openfast.readthedocs.io>`_.

Nightly Testing
---------------
The ``dev`` branch is automatically compiled and run through the test suite
nightly. The results are publicly available through the
`CDash Dashboard <http://my.cdash.org/index.php?project=OpenFAST&date=>`_.
OpenFAST on Unix-based and Windows machines are available at `readthedocs <http://openfast.readthedocs.io>`_.

Help
----
Please use `github issues <https://github.com/OpenFAST/OpenFAST/issues>`_ to:
Please use `GitHub Issues <https://github.com/OpenFAST/OpenFAST/issues>`_ to:

* ask usage questions
* report bugs
Expand Down
Binary file not shown.
238 changes: 238 additions & 0 deletions docs/OtherSupporting/DCM_Interpolation/DCM_Interpolation.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
%----------------------------------------------------------
%

\documentclass[10pt,letterpaper,oneside,notitlepage]{article}
%\documentclass{report}%
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{enumitem}
\usepackage{nomencl}
\usepackage{amsmath}%
%\usepackage{amsfonts}%
%\usepackage{amssymb}%
%\usepackage{graphicx}
%----------------------------------------------------------
\makenomenclature
%\theoremstyle{plain}
%\newtheorem{acknowledgement}{Acknowledgement}
%\newtheorem{definition}{Definition}
%\newtheorem{remark}{Remark}
%\numberwithin{equation}{section}
%-----------------------------------------------------------
\begin{document}
\title{Interpolation of DCMs}
\author{Bonnie Jonkman}
\maketitle


\section{Logarithmic maps for DCMs}

For any direction cosine matrix (DCM), $\Lambda$,
the logarithmic map for the matrix is a skew-symmetric matrix, $\lambda$:


\begin{equation}
\label{EqLog}
\lambda
= \log( \Lambda )
= \begin{bmatrix}
0 & \lambda_3 & -\lambda_2 \\
-\lambda_3 & 0 & \lambda_1 \\
\lambda_2 & -\lambda_1 & 0
\end{bmatrix}
\end{equation}

\section{Matrix exponentials}

The angle of rotation for the skew-symmetric matrix, $\lambda$ is
\begin{equation}
\label{EqRotationAng}
\theta = \left\|\lambda\right\| = \sqrt{{\lambda_1}^2+{\lambda_2}^2+{\lambda_3}^2}
\end{equation}

The matrix exponential is
\begin{equation}
\label{EqExp}
\Lambda = \exp(\lambda) =
\left\{
\begin{matrix}
I & \theta = 0 \\
I + \frac{\sin\theta}{\theta}\lambda + \frac{1-\cos\theta}{\theta^2}\lambda^2 & \theta > 0 \\
\end{matrix}
\right.
\end{equation}


\section{Solving for $\lambda$}

If the logarithmic map and matrix exponential are truly inverses, we need
\begin{equation}
\exp(\log(\Lambda)) = \Lambda.
\end{equation}
Using the expression for $\lambda$ from Equation \ref{EqLog}, we get
\begin{equation}
\label{EqExpMatrix}
\exp\left(
\begin{bmatrix}
0 & \lambda_3 & -\lambda_2 \\
-\lambda_3 & 0 & \lambda_1 \\
\lambda_2 & -\lambda_1 & 0
\end{bmatrix}
\right) = \Lambda =
\begin{bmatrix}
\Lambda_{11} & \Lambda_{12} & \Lambda_{13} \\
\Lambda_{21} & \Lambda_{22} & \Lambda_{23} \\
\Lambda_{31} & \Lambda_{32} & \Lambda_{33} \\
\end{bmatrix}
\end{equation}

Doing a little algebra for $\theta > 0$, Equation \ref{EqExpMatrix} becomes
\begin{equation}
\label{EqMatrixAlgebra}
\Lambda =
\begin{bmatrix}
1-\frac{1-\cos\theta}{\theta^2}\left( \lambda_3^2 + \lambda_2^2\right)
& \frac{\sin\theta}{\theta}\lambda_3+\frac{1-\cos\theta}{\theta^2}\lambda_1\lambda_2
& -\frac{\sin\theta}{\theta}\lambda_2+\frac{1-\cos\theta}{\theta^2}\lambda_1\lambda_3 \\
-\frac{\sin\theta}{\theta}\lambda_3+\frac{1-\cos\theta}{\theta^2}\lambda_1\lambda_2
& 1-\frac{1-\cos\theta}{\theta^2}\left( \lambda_3^2 + \lambda_1^2\right)
& \frac{\sin\theta}{\theta}\lambda_1+\frac{1-\cos\theta}{\theta^2}\lambda_2\lambda_3 \\
\frac{\sin\theta}{\theta}\lambda_2+\frac{1-\cos\theta}{\theta^2}\lambda_1\lambda_3
& -\frac{\sin\theta}{\theta}\lambda_1+\frac{1-\cos\theta}{\theta^2}\lambda_2\lambda_3
& 1-\frac{1-\cos\theta}{\theta^2}\left( \lambda_2^2 + \lambda_1^2\right) \\
\end{bmatrix}
\end{equation}
It follows that the trace is
\begin{eqnarray*}
\mathrm{Tr}(\Lambda) &=& 3 - 2\frac{1-\cos\theta}{\theta^2}(\lambda_1^2 + \lambda_2^2 + \lambda_3^2) \\
&=& 3 - 2\left(1-\cos\theta\right) \\
&=& 1 + 2\cos\theta
\end{eqnarray*} or
\begin{equation}
\theta= \begin{matrix} \cos^{-1}\left(\frac{1}{2}\left(\mathrm{Tr}(\Lambda)-1\right)\right) & \theta \in \left[0,\pi\right]\end{matrix}
\end{equation}
It also follows that
\begin{equation}
\Lambda - \Lambda^T=\frac{2\sin\theta}{\theta}
\begin{bmatrix}
0 & \lambda_3 & -\lambda_2 \\
-\lambda_3 & 0 & \lambda_1 \\
\lambda_2 & -\lambda_1 & 0 \\
\end{bmatrix}
\end{equation} or, when $\sin\theta \neq 0$
\begin{equation}
\label{EqLambdaSinNot0}
\lambda = \frac{\theta}{2\sin\theta} \left( \Lambda - \Lambda^T\right)
\end{equation}
We need an equation that works when $\sin\theta$ approaches 0, that is, when $\theta$ approaches 0 or $\theta$ approaches $\pi$. When $\theta$ approaches 0, Equation \ref{EqLambdaSinNot0} actually behaves well:
\begin{equation}
\lim_{\theta \to 0}\frac{\theta}{2\sin\theta} = \frac{1}{2}
\end{equation}
and since $\theta$ is the $l_2$ norm of the individual components of $\lambda$, it follows that they approach zero, and we get
\begin{equation}
\label{EqLambdaTheta0}
\lambda = 0
\end{equation}
However, when $\theta$ approaches $\pi$, $\Lambda - \Lambda^T$ approaches 0, and
\begin{equation}
\lim_{\theta \to \pi}\frac{\theta}{2\sin\theta} = \infty
\end{equation}
We need a different method to find $\lambda$. Going back to Equations \ref{EqExpMatrix} and \ref{EqMatrixAlgebra}, we can compute the following:
\begin{equation}
\Lambda_{11}+\Lambda_{22}-\Lambda_{33} = 1 - \frac{2\lambda_3^2(1-\cos\theta)}{\theta^2}
\end{equation}
%\begin{equation}
%\Lambda_{11}-\Lambda_{22}+\Lambda{33} = 1 - \frac{1-\cos\theta}{\theta^2}\left( 2\lambda_2^2\right)
%\end{equation}
%\begin{equation}
%-\Lambda_{11}+\Lambda_{22}+\Lambda{33} = 1 - \frac{1-\cos\theta}{\theta^2}\left( 2\lambda_1^2\right)
%\end{equation}
or
\begin{equation}
\label{EqLambda3}
\lambda_3 = \pm \theta\sqrt{ \frac{\left(1 + \Lambda_{33} - \Lambda_{11} - \Lambda_{22}\right)}{2\left(1-\cos\theta\right)} }
\end{equation}
Equations for the other two components of $\lambda$ are similar:
\begin{equation}
\label{EqLambda1}
\lambda_1 = \pm \theta\sqrt{ \frac{\left(1 + \Lambda_{11} - \Lambda_{22} - \Lambda_{33}\right)}{2\left(1-\cos\theta\right)} }
\end{equation}
\begin{equation}
\label{EqLambda2}
\lambda_2 = \pm \theta\sqrt{ \frac{\left(1 + \Lambda_{22} - \Lambda_{11} - \Lambda_{33}\right)}{2\left(1-\cos\theta\right)} }
\end{equation}
Equations \ref{EqLambda3}-\ref{EqLambda2} give us the magnitude, not the sign of the vector we are looking for. Here is one possibility for choosing the sign:
If $(\lambda_1) \neq 0$, choose $\mathrm{sign}(\lambda_1)$ positive.
\begin{equation}
\Lambda_{12}+\Lambda_{21} = \frac{2\left(1-\cos\theta\right)}{\theta^2}\lambda_1\lambda_2
\end{equation}
so
\begin{equation}
\mathrm{sign}(\lambda_2) = \mathrm{sign}(\Lambda_{12}+\Lambda_{21})
\end{equation}
and similarly,
\begin{equation}
\mathrm{sign}(\lambda_3) = \mathrm{sign}(\Lambda_{13}+\Lambda_{31})
\end{equation}
If $(\lambda_1) = 0$, similar arguments can be used to choose $\mathrm{sign}(\lambda_2)$ positive, and
\begin{equation}
\mathrm{sign}(\lambda_3) = \mathrm{sign}(\Lambda_{23}+\Lambda_{32})
\end{equation}
At this point, the relationships between the components of $\lambda$ are set, so we have computed $\pm\lambda$. If $\theta=\pi$, both values are a solution, so this good enough.

If $\theta$ is close to $\pi$, we will need to determine if we have the negative of the solution. This is required for numerical stability of the solution.
In this case, $\Lambda-\Lambda^T$ is not exactly zero, so we can look at the sign of the solution we would have computed if we had used Equation \ref{EqLambdaSinNot0}:
\begin{equation}
\Lambda_{23}-\Lambda_{32} = \left|\frac{2\sin\theta}{\theta}\right|\lambda_1
\end{equation}
\begin{equation}
\Lambda_{31}-\Lambda_{13} = \left|\frac{2\sin\theta}{\theta}\right|\lambda_2
\end{equation}
\begin{equation}
\Lambda_{12}-\Lambda_{21} = \left|\frac{2\sin\theta}{\theta}\right|\lambda_3
\end{equation}
For numerical reasons, we don't want to use these equations to get the magnitude of the components of $\lambda$, but we can look at the sign of the element with largest magnitude and ensure our $\lambda$ has the same sign.

\section{Interpolation}
\subsection{Periodicity of solutions}

Given $\lambda_k = \lambda \left( 1 + \frac{2k\pi}{\left\| \lambda \right\|}\right)$ for any integer $k$, it follows that
\begin{equation}
\theta_k = \left| 1 + \frac{2k\pi}{\left\|\lambda\right\|}\right| \theta
\end{equation}
or
\begin{equation}
\theta_k = \left|\theta + 2k\pi\right|
\end{equation}

\begin{eqnarray*}
\Lambda_k
&=& \exp(\lambda_k) \\
&=& I + \frac{\sin\theta_k}{\theta_k}\lambda_k + \frac{1-\cos\theta_k}{\theta_k^2}\lambda_k^2 \\
&=& I + \frac{\sin\left|\theta + 2k\pi\right|}{\left|\theta + 2k\pi\right|}\left( \frac{\theta+2k\pi}{\theta}\right)\lambda + \frac{1-\cos\left|\theta + 2k\pi\right|}{\left|\theta + 2k\pi\right|^2}\left(\frac{\theta+2k\pi}{\theta}\right)^2\lambda^2 \\
&=& I + \frac{\sin\left|\theta + 2k\pi\right|}{\theta}
\frac{\theta + 2k\pi}{\left|\theta + 2k\pi\right|}\lambda + \frac{1-\cos\left|\theta + 2k\pi\right|}{\theta^2}\lambda^2\\
&=& I + \frac{\sin\theta}{\theta} \lambda + \frac{1-\cos\theta}{\theta^2}\lambda^2\\
&=& \exp(\lambda) \\
&=& \Lambda \\
\end{eqnarray*}

Thus, if $\lambda$ is one solution to $\log(\Lambda)$, then so is
$\lambda_k = \lambda \left( 1 + \frac{2k\pi}{\left\| \lambda \right\|}\right)$ for any integer k.

\subsection{Finding values of $\lambda$ for interpolation}
Given a set of $\lambda^j$ to be interpolated, find equivalent $\tilde{\lambda}^j$ for integers $j=1,2,...n$:
Set $\tilde{\lambda}^1 = \lambda^1$.
For each $j\in\left[2,n\right]$,
check to see if $\tilde{\lambda}^{j-1}$ is closer (in the $l_2$-norm sense) to
$\lambda^j$ or $\lambda^j \left( 1 + \frac{2\pi}{\left\| \lambda^j \right\|}\right)$.
If the latter, set $\tilde{\lambda}^{j}=\lambda^j \left( 1 + \frac{2\pi}{\left\| \lambda^j \right\|}\right)$ and continue checking if we need to add more $2\pi$ periods.
Otherwise, check to see if $\tilde{\lambda}^{j-1}$ is closer to
$\lambda^j$ or $\lambda^j \left( 1 - \frac{2\pi}{\left\| \lambda^j \right\|}\right)$.
If the latter, set $\tilde{\lambda}^{j}=\lambda^j \left( 1 - \frac{2\pi}{\left\| \lambda^j \right\|}\right)$ and continue checking if we need to subtract more $2\pi$ periods.
Otherwise set $\tilde{\lambda}^{j} = \lambda^j$.


Interpolation must occur on the $\tilde{\lambda}^{j}$ and not the $\lambda^j$.

\end{document}
Binary file not shown.
Loading