Skip to content

Commit

Permalink
add assimilation methods to quadratic_model #1
Browse files Browse the repository at this point in the history
  • Loading branch information
lberti committed Jan 13, 2022
1 parent 9f8312e commit d002fbe
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 21 deletions.
24 changes: 24 additions & 0 deletions example/quadratic_model/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,27 @@ add_dependencies(quadratic_model quadratic_model_optimal_interpolation)
add_executable(quadratic_model_nudging nudging.cpp)
target_link_libraries(quadratic_model_nudging verdandi)
add_dependencies(quadratic_model quadratic_model_nudging)

add_executable(quadratic_model_enkf ensemble_kalman_filter.cpp)
target_link_libraries(quadratic_model_enkf verdandi)
add_dependencies(quadratic_model quadratic_model_enkf)

add_executable(quadratic_model_extkf extended_kalman_filter.cpp)
target_link_libraries(quadratic_model_extkf verdandi)
add_dependencies(quadratic_model quadratic_model_extkf)

add_executable(quadratic_model_extminmax extended_minimax_filter.cpp)
target_link_libraries(quadratic_model_extminmax verdandi)
add_dependencies(quadratic_model quadratic_model_extminmax)

add_executable(quadratic_model_mc monte_carlo.cpp)
target_link_libraries(quadratic_model_mc verdandi)
add_dependencies(quadratic_model quadratic_model_mc)

add_executable(quadratic_model_ukf unscented_kalman_filter.cpp)
target_link_libraries(quadratic_model_ukf verdandi)
add_dependencies(quadratic_model quadratic_model_ukf)

# add_executable(quadratic_model_hjb hjb.cpp)
# target_link_libraries(quadratic_model_hjb verdandi)
# add_dependencies(quadratic_model quadratic_model_hjb)
18 changes: 17 additions & 1 deletion example/quadratic_model/configuration/perturbation_manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ perturbation_manager = {
-- directory. It must end with a slash.
-- seed_directory = os.getenv("HOME") .. "/.newran/"

},
random = {

-- Choose between
-- * "time" for machine time,
-- * "number" for a fixed seed value between 0 and 1, and
-- * "directory" to use a Newran directory which stores the seeds.
seed_type = "number",

-- If 'seed_type' is set to "number", choose a number in ]0, 1[.
seed_number = 0.4,

-- If 'seed_type' is set to "directory", put the path to the Newran
-- directory. It must end with a slash.
-- seed_directory = os.getenv("HOME") .. "/.newran/"

},

output = {
Expand All @@ -24,4 +40,4 @@ perturbation_manager = {

}

}
}
4 changes: 2 additions & 2 deletions example/quadratic_model/ensemble_kalman_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ int main(int argc, char** argv)

if (argc != 2)
{
string mesg = "Usage:\n";
mesg += string(" ") + argv[0] + " [configuration file]";
std::string mesg = "Usage:\n";
mesg += std::string(" ") + argv[0] + " [configuration file]";
std::cout << mesg << std::endl;
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions example/quadratic_model/extended_kalman_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ int main(int argc, char** argv)

if (argc != 2)
{
string mesg = "Usage:\n";
mesg += string(" ") + argv[0] + " [configuration file]";
std::string mesg = "Usage:\n";
mesg += std::string(" ") + argv[0] + " [configuration file]";
std::cout << mesg << std::endl;
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions example/quadratic_model/extended_minimax_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ int main(int argc, char** argv)

if (argc != 2)
{
string mesg = "Usage:\n";
mesg += string(" ") + argv[0] + " [configuration file]";
std::string mesg = "Usage:\n";
mesg += std::string(" ") + argv[0] + " [configuration file]";
std::cout << mesg << std::endl;
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions example/quadratic_model/forward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ int main(int argc, char** argv)

if (argc != 2)
{
string mesg = "Usage:\n";
mesg += string(" ") + argv[0] + " [configuration file]";
std::string mesg = "Usage:\n";
mesg += std::string(" ") + argv[0] + " [configuration file]";
std::cout << mesg << std::endl;
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions example/quadratic_model/forward_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ int main(int argc, char** argv)

if (argc != 2)
{
string mesg = "Usage:\n";
mesg += string(" ") + argv[0] + " [configuration file]";
std::string mesg = "Usage:\n";
mesg += std::string(" ") + argv[0] + " [configuration file]";
std::cout << mesg << std::endl;
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions example/quadratic_model/hjb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ int main(int argc, char** argv)

if (argc != 2)
{
string mesg = "Usage:\n";
mesg += string(" ") + argv[0] + " [configuration file]";
std::string mesg = "Usage:\n";
mesg += std::string(" ") + argv[0] + " [configuration file]";
cout << mesg << endl;
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions example/quadratic_model/monte_carlo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ int main(int argc, char** argv)

if (argc != 2)
{
string mesg = "Usage:\n";
mesg += string(" ") + argv[0] + " [configuration file]";
std::string mesg = "Usage:\n";
mesg += std::string(" ") + argv[0] + " [configuration file]";
std::cout << mesg << std::endl;
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions example/quadratic_model/nudging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ int main(int argc, char** argv)

if (argc != 2)
{
string mesg = "Usage:\n";
mesg += string(" ") + argv[0] + " [configuration file]";
std::string mesg = "Usage:\n";
mesg += std::string(" ") + argv[0] + " [configuration file]";
std::cout << mesg << std::endl;
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions example/quadratic_model/optimal_interpolation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ int main(int argc, char** argv)

if (argc != 2)
{
string mesg = "Usage:\n";
mesg += string(" ") + argv[0] + " [configuration file]";
std::string mesg = "Usage:\n";
mesg += std::string(" ") + argv[0] + " [configuration file]";
std::cout << mesg << std::endl;
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions example/quadratic_model/unscented_kalman_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ int main(int argc, char** argv)

if (argc != 2)
{
string mesg = "Usage:\n";
mesg += string(" ") + argv[0] + " [configuration file]";
std::string mesg = "Usage:\n";
mesg += std::string(" ") + argv[0] + " [configuration file]";
std::cout << mesg << std::endl;
return 1;
}
Expand Down

0 comments on commit d002fbe

Please sign in to comment.